Skip to content

Why I enjoy using C++

I would rather create a circuit that makes an LED turn on than understand the underlying physics enough to be able to design such a circuit and be convinced that, if I actually created it, it would work. Doing both would probably be better, but that’s a meaningless (and hopefully obvious) opinion.

In short, I like making things work. When something breaks, it is fun to fix it. If it breaks again in the exact same way, it is still fun to fix. Learning why the problem occurred is only useful because you can use the experience to solve it again. If you knew for certain that the problem or one releated to it would never occur again, it would not hurt to remove all knowledge of the solution from your memory. It’s useless. Such an isolated problem probably doesn’t exist, especially if you like to generalize problems, but the point stands.

The kind of problems I don’t like are the ones in which the pain of designing and implementing a mitigation overshadows the pleasure of implementing a solution. Even if you like fixing cars, if your car breaks down while you’re driving, you’re pissed. You have to get all those tools out and look at a bunch of stuff and who cares what else — you’re physically stuck somewhere with a heavy, expensive, immobile piece of whatever it is they use to make cars. Or, you have to call some random number and explain a bunch of stuff and spend money and you don’t even get to fix it.

When you’re programming, unless you’re editing live code like only rock star web developers do, you rarely have to work hard to mitigate problems. Sometimes the problem doesn’t even require mitigation and you can skip right to the solution. The narrower the scope of your problem, the less mitigation.

Incompatible iterators? No mitigation. Trying to dereference a null pointer? No mitigation (this code isn’t live, remember). Syntax error? How embarrassing, but there’s no mitigation. The more a language allows you to shoot yourself in the foot, the more opportunities you have to solve problems that don’t require mitigation, the more enjoyable it can be to use the language. C++ allows and encourages you to statically check your balls off, which narrows the scope of your problems, which makes it, for me, a very enjoyable language to use. Get yourself a good IDE to cut down on text editing and compilation time and you can’t ask for much more.

One Comment

  1. No Chris! Seriously C++ is painful. Python is real joy.

    Tuesday, October 7, 2008 at 4:26 pm | Permalink

Post a Comment

Your email is never published nor shared.