#Week 2 & 3 — Can’t Encapsulate This

Chuka Okoye-Ahaneku
5 min readJun 18, 2021

Back again this week and giving my thoughts on both Week 2 and 3 of my Makers Academy coding bootcamp experience, simply because I forgot to write this after my My Passion for Tech post!

Coming off the heels of Week 1, the learning and pace is really ramping up with new topics and tasks on the idea of web development, and also the application. It has been fascinating with the progress that we all have been making as a cohort in the past two weeks, and with so much more to go.

So to start off, let’s talk about Week 2!

Week 2

This week was a focus on encapsulation, cohesion of classes and building on the skills we learnt from week 1 and the challenges. Essentially applying the knowledge we have gained so far and building on new ideas that Software Developers would encounter.

I took the initiative to use my self-learning time to understand more about encapsulation and cohesion of classes, so that I make my code more succinct and not too complex.

The theory is that each class should have one purpose or job, sometimes referred to it as its responsibility, by separating methods into separate classes based on much the methods belong together. Which sounds simple enough until it came to the practical to create a Secret Diary app.

The idea is to create methods that can “lock”, “unlock”, “add entry” and “get entries” of a diary. Each with their own purposes in classes but interlinked due to their usage.

I wanted to make @locked an instance variable to be used throughout the program, so an error is raised if the user tried to call the add entry methods if the state of the @locked instance variable hasn’t been changed yet. Which all works when they are within their own class, however, that is not what the exercise is asking for.

The other methods need to be encapsulated from the other methods as the states are not relevant to them. So the real issues began when I separated the add_entry methods into separate class and utilising the same instance variable. It just never could work as the new class didn’t recognise whether the state was changed from true to false.

After many hours during the week, this exercise became way more frustrating for me then it had to be, and it was all my fault. Here is why:

* I spent way too much on this. I didn’t need to be by myself trying to find the solution, I left it too late to reach out to a coach and my peers for assistance.

* I was too focused on completing this task because I felt the solution was within reach, as a result the other practicals didn’t get any other attention because there is a lot more to learn during the week.

* I got too frustrated and it got in my mind that maybe I was much more behind then I was, I saw the weekly objectives as stages that was expected to be learnt and mastered by the students by the end of the week, which simply was not the case at all.

There is a lot of ‘too’s in those bullet points which clearly shows that I was putting a lot much energy/focus into it. To which there is nothing wrong with doing so, but it shouldn’t be at the detriment of all the other topics and practicals to learn.

Speaking to the coaches by the end of week helped ease my frustrations a lot because they simply mentioned that the objectives set by the end of the week is just an idea of what you can accomplish, there is no expectation that you will learn all the information in just one week.

Meanwhile, as the weeks go by we will be constantly be going over the same topics from previous, just like how another focus was on building the skills from the Week 1. With that information and a way to align my focus better, I was looking forward to Week 3.

Week 3

Now this week is where it starts to ramp up again, this time we are learning about creating an actual web application that would be blending the syntax we have been exploring with Ruby, with the visuals of HTML and servers. Actually building a website!

I made a focus to use what I learned from the previous week and to distribute my time during the self-learning parts of the day when I’m not in either a peer-session call or a workshop. Also, continuing my studies in the evening with either progressing the weekly challenging or reading over my notes that I made during the day, I believe if I put more time in then that can allow me to progress even further.

This is a week I really enjoyed because of how you can actually see how powerful the code process can be when exploring the MVC (Model View Component), and creating a website with the Ruby coding logic applied.

Not only creating the ruby code of the game/program, but also how it is all displayed in HTML/CSS and routed to the local servers. Seeing how a web application can be made with certain logic and other various programs really opened my eyes to the Front-end and Back-end aspects of being a Software Engineer.

Still very difficult and confusing, but as I was following the steps and actually taking my time to understand how they interact with each other, then it began to make more sense. I can’t wait for all that understanding to be thrown for a loop come the next week when we learn about databases!

--

--