In both PHP and Ruby I’ve always had a hard time understanding the concepts surrounding the interaction between methods in my programs. When I began getting into programming, both in PHP and in Ruby, I focused mostly on frameworks in the language and not enough on the fundamentals of building things from scratch out of code. And while I feel like no time was wasted in either codeIgniter, and certainly not in rails, I’ve always felt less than confident when attempting to solve challenges programmatically.
Well, today was the first day of definitely working towards that fundamental understanding I’ve always wanted. John Davis started our session by explaining to me what congruency meant, and then demonstrated it over our first few minutes of the @airpair mentoring session. There was a small error in loading the program file I was working on and he step-by-step taught me how to isolate the problem space and incrementally add functionality until I could pinpoint where we should focus our attention.
This walk-thru alone was worth the $$$ for the session in my opinion, but John was just getting started! There are a lot of things in the programming world that can become very obvious very quickly to a new developer. One of the first things I realized at the very beginning was that everything takes time! It took me a week or two to even set up my Ruby environment back in April of 2012. So needless to say, saving time performing trivial tasks is akin to having scuba gear under water, I can actually stop and appreciate the view a little because I’m not focused on needing an air supply. During this particular airpair, I learned quite a few ‘shortcuts’ to things like arranging my screen real-estate, commenting/uncommenting out code, and I could go on.
Don’t worry, I’m going to share those two shortcuts with you in just a bit, in fact, I am going to start introducing picks of the week today. Whenever I come across these shortcuts or tips to improve efficiency, I’m going to give a short post on it with maybe a photo or a video embed.
During the upcoming weekend, probably Sunday, I’ll select the tip with the most likes, or comments as the official pick of the week! I got this idea from listening to a lot of ruby rogues podcasts, if you’re even slightly interested in programming or the culture in the Ruby community, check out an episode sometime. I’ll be honest, a lot of the time their discussions are a bit over my head, but I have yet to listen to an episode where I didn’t leave with something to think about, some neat service to try out, or book to read.
The first shortcut I learned today was how to comment/uncomment multiple lines of code in sublime text 2 in simple steps.
Here they are:
Here is a random method I clipped from a hangman game I am in the process of building.
Step1: Highlight all lines you wish to comment out.
Step2: Hit the buttons command (the apple on a mac, and probably called control on windows).
Step3: While the command/control button is selected, also press the ‘/’ (slash) button.
And disco! Here it is, all my highlighted lines of code, commented out.
The other tip I learned dealt with utilizing hot-keys. John explained that it actually takes more high-functioning concentration to physically move a mouse than it does to punch in a few keys on a keyboard. That makes sense to me, and so does the program name he shared with me, sizeUp. Theres an unlimited free trial, but if you get sick of their box popping up and reminding you that your copy isn’t licensed yet, pony up $13 bucks and its all yours!
Which one of these tips will you likely use first?