Step 1 (Tracking Counts to a Webpage)

Drew Pilgrim
Off by One
Published in
4 min readJan 22, 2018

The first step and hopefully not the last, after graduating college and realizing my Computer Science Minor was not the most useful degree in landing an entry level software developer job I realized I need to gather more skills to offset not having a CS Major. This publication will be a list of articles detailing my progress as I learn various skills for becoming a software developer and issues that I had while learning them. Hopefully writing out the issues I had and why I had them will help me notice and fix problems with my approach and problem solving thought process as well as keeping my writing skills active and fresh while out of college as having those skills will never be wasted.

Most of my posts will be detailing Ruby on Rails and Web Development and a few might be on learning Android or another program simply because those are the two main skills I am learning right now (Through Actualize’s Coding Bootcamp for Web Development and Udacity’s Nano Degree program for Android). Now lets get started.

Errors very rarely come alone

For the first post I will analyze a particular problem and approach I had during Actualize’s intro into the rails framework with routes and controllers. During a particular exercise I finished all the tasks early and was looking for further ways to hone my skills. One of the earlier problems in that problem set was “Every time a user visits/refreshes the page, the page should tell the user the number of visits made to that page so far. NOTE: This is impossible for you right now, but you should try your hand at this for a few minutes to discover why it’s impossible”. Not particularly liking when told that I couldn’t do anything and knowing it is possible to do in concept I scrambled to try and figure out how to approach the problem.

On my first run through of the exercise. I attempted to simply create a variable inside of a method in the controller class to make sure I understood why that approach didn’t work. This variable would increment when the route method was called. Quite quickly I realized that the instance variable in the method swiftly became out of scope when used for this purpose. The next obvious solution failed as I found that controllers couldn’t hold local variables outside of the methods. I changed tactics and assumed it was impossible with the tools I currently knew in Rails. Currently being the key word.

Once I declared I would try to learn the necessary tools needed to accomplish this immediately I went to the best resource to any budding developer, Google. In particular I had found other programmers trying to accomplish a fairly similar task with particular articles on a website. I figured I would be able to adapt that and tried to dissect what the solution was and why it worked. Unfortunately as I hadn’t learned really anything about Rails except but routes and controllers at that point most of the answers weren’t really usable to me. In particular, I didn’t know where in my Rails project to actually post the code they were describing. There was a Gem that someone else had written which I could of required and gotten to work but that seemed to defeat the purpose of what I was trying to do. Just importing a Gem and calling “Count_visits” would be the equivalent of an interviewer asking me to write the fastest sorting algorithm I knew and responding with Java.sort. Technically correct but missing the point…

Unfortunately you need to know what question to ask for stackover flow to solve all your problems.

After going through and failing to truly parse the stack overflow answers I attempted to go to the myriad of tutorial sites for basic ruby and Rails framework and learn the basics to better help me better understand the stack overflow answers. Working through this I quickly figured out the parts I needed to understand, Models for storing data as well as Views and Embedded Ruby for communicating that data with other parts of the website. Unfortunately I ran out of time for that exercise and wasn’t able to finish that project.

In review of this problem I think I could gleam some pretty useful info on my thought process. I am usually used to knowing enough basics about a particular problem or technology that stack overflow and google answers can if not outright solve the answer point me in the general direction. But that isn’t always going to be the case going forward. I think if I had approached this problem by first analyzing the basic tools available and how they interacted I would of been better prepared for analyzing the stack overflow and deciding where to progress from there. I will try to use that approach for similar problems and see how that helps.

Hopefully this approach will save me tons of headaches and errors in the future when learning new technologies and working with unfamiliar api’s. It will certainly be more reliable than trying to hit the Ballmer Peak

--

--