Things I Wish I’d Known When I Started Programming

codeI’ve been programming for more than a few years now, but sometimes I like to look back at things I wrote when I was much younger, and reflect on how much I’ve learned since then. Of course, no one expects you to start out knowing everything, but there are a few things I wish I’d known when I started, or that I’d learned a bit sooner than I did. So, just for fun I thought I’d come up with a list of a few of the things I wish I’d known when I started programming.

Use Source Code/Revision Control

Like a lot of young developers, when I first started writing code I didn’t use any sort of source code/revision control system (just zipping up the project files every so often doesn’t count). But once I did, I realized how wrong I’d been – having a complete history of all changes is just sooooooooo helpful, even without any of the other features (branches, merging, etc.).

Now, there is a bit of a learning curve with any revision control system, and when you’re just starting out that learning curve can be a bit steep, especially in addition to all the other stuff you’re learning at the same time – but it is so worth the time and effort. Being able to undo changes, or make different changes to the same code (via branches), and just in general having a nice, detailed history of what you’ve done and what’s changed over time is simply invaluable. This is especially true if you’re part of a multiple programmer team, but it’s also just as true if you’re working by yourself.

For anything beyond 5-minute throw-away projects, use source code revision control!

Write Comments So That You’ll Understand Them Months or Years Later

Writing comments is like writing a log entry that you’ll inevitably need to review much, much, much later – so taking the time to write it clearly is well worth it. Countless times I’ve run across old comments of mine and wondered “what was I thinking?”

Same goes for commit messages – brevity may be the soul of wit, but not when it comes to commit messages! You shouldn’t need to do a diff on a particular commit just to figure out what you did; the commit message should at least give you a general idea.

On the flip side, though, you don’t want to be writing novels in your comments or commit messages, either – so write enough to be understood, but don’t be needlessly wordy, either.

Automate the Build & Deployment

It doesn’t matter how many times you’ve gone through the process of compiling or deploying a build, someday you will forget a step. And it’s also just so nice to be able to kick off a complete build & deploy with a single click and then go grab a cup of coffee or something, instead of having to sit there and go through all the steps manually. So take the time to write a script to automate the process – it doesn’t need to be super-complicated, just something to do the work for you. Believe me, it’s worth it.

No Fix or Change is Ever Too Small to Not Test

Also known as “TEST EVERYTHING,” this one’s a hard rule to stick too, especially for really small things like changing a typo in some text – but you still have to do it. It might seem like a tiny change that couldn’t possibly cause any problems anywhere else – but code is complicated, and complexity breeds bugs in the weirdest ways. Maybe that little text change you made causes a display issue at higher DPI settings, or when using a different font – you won’t know until you test it.

If You Find a Problem, no Matter How Small,  Put it in the Bug Tracker!

When making a fix – even for a small, seemingly insignificant problem – if it’s in production code (or in a released beta build), you’d better be writing up a bug report for it. Just making a comment in your SVN commit log isn’t enough – you need a proper report that can be searched and found and referenced, because someday, maybe years from now, you’ll need to know how or why you made this change.

(I will make an exception here to “fixing a typo” text-only changes, but only just.)

Always Write a Spec (But Don’t Write a Novel)

Just as fixing (seemingly) simple bugs can have unexpected consequences, designing and adding simple features or changes can turn out to be unexpected complicated. Writing a spec – even if it’s just a quick outline on paper or on a whiteboard – can help immensely in heading off these unexpected complexities. (Or, at the very least, you’ll know there are complexities and can design around them.) Good software should always be designed first, then coded – and writing a specification is part of the designing step (if not the entirety of it).

At the same time though you don’t need to write a novel’s worth of specifications, even for complicated changes or features. If the spec is too long (or goes into too much detail) then no one will read it – yourself included. If your spec just has to be that long, then maybe the feature or change you’re planning should be broken down into smaller parts first. Finding the right balance between length & specificity is a skill that takes practice to get right, but it’s one that’s worth learning.


These are just some of the things I wish I’d known when I started programming all those years ago – if you have things you wish you’d known, feel free to share them in the comments!

Behind the Wheel: 2013 Mini Cooper Convertible

Mini Cooper ConvertableLast year while on my way to visit family in Australia I found myself with a 1-day layover in Los Angeles (due to some flight delays). Rather than spend the day cooped up in an airport hotel, my wife and I decided to do a little exploring – so we rented a car for the day, and the car we ended up with (that my wife picked out, actually) was a Mini Cooper convertible.

We didn’t have a lot of time to really play with this car, but I did end up driving it both in city traffic and up into the hills around the city, and I have to say – I understand why people like this car.

One thing that I did notice was the harsh suspension – every bump made the car seem to rattle and was felt right up your spine. I suppose this isn’t that surprising, given how low the car is and how tight the suspension has to be, but it was still rather distracting at times.

But, the cornering, oh my goodness, the cornering! I’ve heard the expression “corners like it’s on rails,” but this car really drove home what that means.

Steering, however, although easy, was not particularly great, though I’m hard pressed to explain why. It might have been just a little bit too lose, requiring just a little bit too much steering input to make a turn than I personally felt was necessary. Or maybe it was that the steering wheel felt slightly too large for such a small car.

Like most rentals, this was an automatic – which is a shame – but overall the performance was spirited and fun, though not quite knock-your-socks-off amazing.

Though the Mini is certainly a small car, it’s not quite as small as you might think. I wouldn’t want to try and cram 4 people into one, but it’s not at all tight for just 2 people.

All in all, the Mini is a fun little car, good for having a bit of fun in the corners while still nimble enough to navigate tight city streets like a pro, and has a fair amount of space for stuff (considering its size). I certainly wouldn’t turn my nose up at it if I had the chance to drive one again!

On The Road: New York City

New York City (Broadway)Having lived a mere 35 miles from New York City for just over 7 years now, I figure it’s time to finally put down in words what driving in the City that Never Sleeps is like.

When I first moved here, I flat out refused to drive in the city – I took the train instead. However, eventually the transit authority (in its infinite wisdom) raised the prices on commuter rail tickets such that it just was plain cheaper to drive in, even allowing for the fairly hefty tolls at the tunnels and bridges into the city.

At first, New York City driving scared me. I’d lived in Massachusetts previously, and I’d driven as a courier in Boston, so I was no stranger to city driving, but New York City was city driving on a whole other level – a scale of traffic and speed and volume I’d never seen or experienced before.

But there was no avoiding it anymore – I needed to get used to driving in the city, and it wasn’t something I could learn except by doing it.

Thankfully, I’m a pretty fast learner, and I quickly picked up on the style of driving from paying attention to all the other cars on the road.

Basically, the key to driving in New York City can be summed up as: just go.

No, really – aside from stopping at traffic lights, driving in New York City is basically just going along with the flow of traffic, and when you need to turn or change lanes or do anything against that flow, you just need to have confidence in yourself – and in the fact that other people will get out of your way (within reason). Other drivers don’t want to hit you any more than you want to hit them. Once you accept this, everything else just falls into place.

This isn’t to say that driving in the city is easy – far from it. Driving in New York City is demanding; it requires a fair bit of concentration and constant awareness of your surroundings. You can’t be a lazy or inattentive driver in New York City.

This isn’t also to say that you have to be an aggressive driver in the city – but you do have to be an assertive driver. If you need to change lanes or make a turn, no one’s going to slow down & wave you out – you have to make room for yourself (to a certain extent). It’s not unlike getting on a crowded subway train – you just have to kind of push your way through if you want to get on.

The city does have its own unique challenges, of course, such as the frequent lack of lane markers, the masses of pedestrians, and let’s not forget the cab drivers – but  these are relatively minor issues compared to just getting the hang of the pace & feel & flow of driving in the city.

It did take me a little while to get fully comfortable with it, but though I was terrified of New York City driving at first, nowadays I don’t even give it a second thought.

That Time of Year Again

It’s almost that time of year again – autumn, my favorite season and time of year, and also my favorite time to take photos!

leaf & morning dew on the lawn in september

I snapped this one in the morning in my back lawn, as the sun was just coming up through the trees. It’d been a cool night, so there was a nice blanket of dew on the grass, which just adds that extra little sparkle.

There’s just something about autumn – maybe it’s the shorter days that make getting up at the “golden hour” easier, or the angle of the light, but even before the leaves start to change color, the world just seems more photogenic (to me, at least).

Behind the Wheel: 2014 Fiat 500L (Diesel)

Earlier this year while I was in Italy on vacation with some of the Australian side of the family, we rented a car to travel up to Lake Como in northern Italy. Unsurprisingly, the car we ended up with was a Fiat – but in this case, it was the new 4-door version, the 500L.

Fiat 500L

I’d driven a Fiat 500 before, but the 500L was something new. I was actually glad to see it – I knew from experience that fitting 4 adults into the 2-door 500 would not have been a pleasant experience, especially for the long drive we had ahead of us.

italy route map - milan to lake comoThis particular 500L was also a diesel, and a stick shift on top of that – unlike the Audi A4 I’d driven previously in this trip – so driving it out of the city of Milan and up the narrow, twisty, winding roads around Lake Como was… an interesting experience!

But truthfully, the 500L was quite easy to drive – the steering was nimble, the brakes were solid, and the overall handling was very surefooted. The diesel took a bit of getting used to, however. Unlike a small gasoline engine, the diesel in this Fiat didn’t need to be revved up – it had plenty of power down low in the rev range.  In fact, the diesel really didn’t like being at any sort of high RPMs at all – which meant I had to spent a lot of time shifting, especially up the twisty, hilly roads around Lake Como.

The 500L fit all four adults reasonably well, as well as our bags, so it is a quite practical little car. Visibility was good, the steering was nimble, and of course the diesel means it’s quite fuel efficient.

Up around the Lake Como region are some very, VERY twisty roads, which would have been quite fun to tackle – though with 4 people in the car and traffic coming in the opposite direction, I didn’t actually get much opportunity for fun. Still, the 500L was nimble and took the corners well, and at no point was I worried about the car’s capabilities. Although at times I did find myself wishing that it was a little bit smaller – although the 500L is by no means a big car, some of those roads were still a very tight fit.

All in all the Fiat 500L is a small, practical little car, that can be fun, but takes some getting used to if you’re not accustomed to how diesel engines develop their power. For myself, I’d have preferred a gas engine, but when you rent you kind of have to take what you get – and of course in Europe diesel is much more common than here in the US.

So, if you’ve always wanted to have fun in a little Fiat 500, but wanted to be able to carry more than 2 people, the 500L is certainly not a bad choice.