Saturday, July 26, 2014

The "ABL's" of Programming

For anybody familiar with Sales, you've probably heard of the "ABC's" of selling which stands for "Always Be Closing". For people not familiar with sales, its basically the concept that if I were trying to sell you a tennis ball, and you objected and said you really don't like green tennis balls, I would ask you a clarifying question to understand what colors you might like, and then I go right back to the close with something like "so which would you prefer, a tennis ball of color 'x' or color 'y'?" Basically, as you uncover information about your prospect, you're still pushing for the close every step of the way.

As I was driving home yesterday and thinking about a good topic to write about, the ABC's kind of popped into my head and it made me think of a good acronym that applies to anybody that codes, "Always Be Learning" or as I titled it, the "ABL's" of Programming. I thought of this both because of some of my recent struggles, but it's also been a consistent theme on a Ruby Rogues podcast I've been listening to recently.

So how does it apply to me recently? A few weeks back, I had this idea to try and program a basic Text based adventure game in JavaScript that would present you with various scenarios and options, and based on your choices you'd progress through the game. I knew it would test my knowledge of several concepts like For Loops, While Loops, Iterations, etc. Well the first weekend I dove head first into the game and felt like I made a ton of traction. It almost seemed like a relatively easy concept that I would be able to finish and release within maybe a week's time frame. Well here I am about 3 weeks later, and still no working version of the game!

While I made a lot of progress that first weekend, my code gradually became more complex, and it started getting harder to keep things straight or decide how to pull the information I needed. After getting some advice from a developer that sits by me, and studying further into the CodeAcademy JavaScript tutorial, I then realized I could re-structure my game to follow a more traditional "Object-oriented" fashion and take advantage of JavaScript's Prototypal/inheritance nature. That led to a whole weekend of diving in, getting really confused, and then slowly figuring out how to once again structure my game and make it work. However, I learned a ton and my code was far better off because of it!

Well now I've run into another issue where one of my iterators keeps looping and is not escaping, so I worked briefly with another of our Software Engineers yesterday, and he mentioned that an "alert" method I'm using does not work well with browsers, and that I should strongly use jQuery for what I was trying to do. So now after about two weeks, I'm diving into a completely different area and once again deciding to re-structure my game to make it work better and become easier to work with moving forward.

I spent yesterday researching how to implement the jQuery library, which then also led me to pull in HTML/CSS and changing my game to a more graphical nature in the browser rather than being completely text based from JavaScript functions. While it's not absolutely necessary that I do this, I do envision where this is going to make certain aspects of my game a lot easier and a lot more efficient to code. I even learned how to make my page somewhat "responsive"! That basically means that if you were to start with a full screen, and start to shrink the screen, the elements will shrink along with it so that the page remains readable and functional. Especially since a web page can be accessed by so many devices including tablets, phones, laptops, etc. all of which have different size screens, implementing responsive design is an absolute must.

So basically what started as a simple JavaScript program with basic "for loops" & "iterators" has now evolved to be so much more. At least I've learned concepts and a little bit about other languages & libraries that I've been able to apply to my code. I've faced some type of challenge on an almost daily basis, but I've learned something new every step of the way and feel so much more confident today than I did a few weeks back when I started the game!

Software Engineering is definitely a field and skill set that requires you must "Always be learning!".


No comments:

Post a Comment