Saturday, September 17, 2016

4 Things They Don't Teach You About Programming

1. Most of your time will be spent debugging someone else's code, not writing your own.

When you're learning how to program, you write everything from scratch (sometimes to ridiculous lengths). This is good - it's how you learn. But it can set you up for a unrealistic expectations about what real-world programming is like. Most programming involves digging into something someone else wrote years ago and figuring it out because no one really knows anything about it except that it works, but now they need you to change some part of it. It's why programming experts often advise you to code like the person who'll read your code next is a violent psychopath who knows where you live, because one day you will be that person, and you don't want to be driven quite that insane.

See also Orthogonality and the DRY Principle, featuring the Right Honorable Dave Thomas.

2. 90% of programming is converting data from one format to another.

When learning to program, you write Cool Things - binary tree balancers, XML parsers, chess games, even simple databases & operating systems. But when you get a job, most of that stuff is already done, and your job will be to convert one thing into another thing. You gotta convert your objects into database tables. You gotta convert the data coming back from the API into HTML. You gotta convert the values from that ancient file format into something usable. And the list goes on and on.

This doesn't mean that programming is all drudgery! There are lots of interesting, even exciting challenges in this area. It's just not something they cover much in training.

3. Polymorphism isn't that important.

Polymorphism is important: it's one of the most powerful tools you've got in your toolbelt to make software loosely coupled and maintainable. But when you take programming courses they make it seem like programming is the task of building the Unified Class Structure of Everything. In reality, abstract classes and complex inheritance have relatively few uses. Interfaces are the most important aspect of polymorphism, and any programmer worth their salt should know how to use them extremely well. But most stuff beyond that isn't that important.

4. Programming will never stop being a source of wonder.

I've been writing computer programs for 20 years now, and still there are those moments when it works and I go, "no way, I did it!" There's still a bit of magic in it, even after understanding all the math and electricity that's involved, and I've found that that's true for most programmers. It never stops just being cool.

No comments:

Post a Comment