Sigh. It is indeed a bitter sweet feeling. But before getting to that, I guess I’ll recap my experiences the past 2 and a half weeks.
In week 4, we we’re given an array of arrays to be the input for the program. We were then given empty classes and methods as hints for the following steps. This would be the first part of a 3 part coding challenge. It was fairly simple, but I found myself writing code that was far more extensive than it had to be. My mentor, whom goes by mroth, really helped open my eyes to better organizing my thoughts and thoroughly going step by step to solve my problems. The main thing I took from this lesson was that everything can be re-factored further and further.
I also finished my BarHopper app. I haven’t gone back to really polish it but it’s main functions and the basic design is pretty much down.
In preparation for Week 5, I was assigned to do the 2nd part of the coding challenge. This was the core part of the challenge, which requires us to take an input, and transform it so it looks like the output.
[0, 0, 0, 0]
[0, 1, 0, 0]
[0, 0, 0, 0]
[0, 1, 0, 0]
[1, 1, 1, 0]
[0, 1, 0, 0]
As you can see, the transformation pretty much takes a single point and transforms the values to its left, right, above, and below it. But the challenge also involves being able to take in multiple points. This was probably as deep of a problem I’ve had to face, and simultaneously, it was probably the most time-hindering week for me at home. The kitchen flooded, I had to take my grandma to the ER, the check-up. Already, that was half of my time taken up. But not all of it was idle time and I found my time at the ER an opportunity to practice what me and my instructor had talked about; the process of how to problem solve.
So while I was waiting in the ER for my grandma (who turned out okay), I found myself writing down the steps in simple and plain English. What do I want to accomplish first? What are the prerequisites for my program to move to the next step? What things will I need to call on or which methods will I need to complete those prerequisites? I was writing what I wanted the computer to do step by step, and then if I can break those steps down even further, I would do that too.
When I had these steps infront of me, I then took out my cell phone and looked at the Ruby documentation and which things would come in handy for which steps. If I need to loop something, how would I go about writing it down? I pretty much made a list of things I could use in Ruby to do what I wanted to do in English. Now, although I had to wait until I got home to actually put it into action, the transition between writing it down thoroughly on paper, to entering the code in Sublime Text and running it was surprisingly smooth. I had to work on a few conditions, but nonetheless, I was happy to have what I thought at the time was a working solution.
Unfortunately, although I had a working solution for that step, they were procedural instructions that I was giving to the program, more than actually letting the computer do the work. I had set an input where I was practically giving the location of the “1” to the computer, rather than having the computer search for it. And although I had conditions in place, I didn’t have an algorithm make the computer do the work. So I felt like this guy for awhile:
So he told me what was wrong with my program and that I should take Week 6 to really nail it on the head and complete the 3rd part of the challenge as well. So I took a break after my mentor meeting on Friday and started grinding away from midnight to 10am. But I was extremely drained because I didn’t feel like I made much progress. I was getting to the point where I didn’t know if my approach or my code was correct, and doubt started to plague my mind.
So I wrote my mentor, and I’m sure mroth was probably shocked as well, since I’ve never really e-mailed him anything before. But I needed to know where I was making a mistake on, so I can have a starting point to work upward from. Almost at an instant, he wrote up a short summary saying my approach is sound, and gave me hints as to what type of syntax may be useful. And he also shared this interesting talk about “background processing” of information, that of which our brains conduct. The video is below, and it’s pretty interesting:
In short, it’s about taking time away from your work to allow your brain to stop actively processing it, and let our brains process things in the background. As someone who likes to grind away at things for hours on end, this video helped me “let go” a bit, and give my brain a chance to breathe.
So I spent the rest of that Saturday, just hanging out with my friends and such, watching a UFC fight. There were times where the thought about the code came up in my head, perhaps an approach I hadn’t tried, so I kept it as a mental note to try it out later. When I got home, I figured that I had spent about 20 hours away from the problem, let me take a look and see how my mind see’s this code now. Granted that I was sleepy, things slowly started to come together. I know right, it’s like magic! The clear eyes method of reevaluating my code was something I learned in Web Design, but that video took that concept into another level in that I had a clear mind.
So Sunday went by and I was on a roll. I was knocking certain parts of my code out, and come Monday 2am, I had a solid working solution which did everything from randomly generating “1” cells, to searching for them, applying them to a transformation construct that would allow those “1” cells to expand, and then applying the 3rd portion of the challenge,distance, which indicated how large you’d like the “1” cells to expand. I have some screenshots of a demo run:
1. I generated the matrix to desired proportions, in this case 20 x 60.
2. I randomly generated 25 “1” cells, something which I wouldn’t have been able to do with my first code.
3. The program then expands the “1” cells. For simplicity, I picked a distance of 1.
4. But here’s a sample of one with a larger distance.
Getting high by myself
So back to the title of this blog; obviously, I wasn’t talking about lighting up, but more-so the high that one gets when solving a problem. The rush is so amazing, but it’s also irritating how chances are, there won’t be many, if any, whom you can actually share the moment with. Perhaps in a team environment, because you have the same goals, the experience may be different, but I have friends who are somewhat computer savvy, but I know when I express the feeling of nailing this challenge down, there was a feeling of irrelevancy more than connection.
Of course, I understand why this is. No one can really fully know your experiences of solving something. For someone else, the solution for the same problem could have just came so naturally that it wasn’t even a big deal, and the problem was written in no time. For others, what I thought was a hard experience may have been easy in contrast to their approach. And for others who don’t code at all, the whole thing looks like hieroglyphics. So the logic is there as to why for the most part, it’s just bitter sweet because I just feel like I beat a hard mode raid boss, but without the guild/party to share it with.
So for the rest of week 6, I’m just looking to see if my code can be further re-factored, as well looking ahead to the next coding challenge which involves linked lists. Oh how fast it is to feel really smart, and back to really dumb yet again. We’re also working on the concept of Test Driven Development. I’m still not that great at writing tests, so I need to reinforce that for the rest of the week in preparation for the future. There’s also the office hours on Wed., but I don’t really have any questions that stand out at the moment. I do have some technical questions about OS preferences for a web development environment so I guess I’ll throw that out there.
Anyway, I know it’s a bit of a rant-y post but I hope some of this info is useful for someone who was like me out there. Or if not useful, at the very least entertaining.