A little perspective

I just dove into a small project that I decided could best be done using a set of C++ classes, and I’m beginning to think that I’m an idiot for trusting the language again. After several years of vanilla C and C#, and not much else in between except the occasional Perl hack, I’d forgotten what it was like to tread water in Bjarne’s fits-all boots.

Writing in C++ again is like making biscuits. But the simple baking procedure is preceded by growing the wheat, which entails clearing the farmland, digging a well, defending it against the native hordes, establishing irrigation and a working agrarian economy, buying a bunch of fertilizer, plowing the field behind a great big smelly ox, planting the seeds, waiting all winter while the wolves howl outside your cabin, THEN (buried amongst all the templatified, exception-safe and const-driven madness) writing a kernel of meaningful code. Wait, what was I doing? Building a tectonically secure infrastructure for feeding billions of people, or just making biscuits for breakfast?  It’s hard to remember after all that epic bullshit.

God, it almost makes me want to write in Java again.

I looked at Erlang for a while. I think that Armstrong’s book on it is one of the best language tutorials since K-and-R, but unfortunately I had no real /need/ for Erlang.  As soon as I find a worthy project I’ll probably use it.

I’m having fun with Python. I wish I’d listened to my friend Munch, who years ago said it was all he could stand. It has a charm to it, the same charm I had while hacking on some Windows Phone apps, when it was 1979 again and I was banging away on some BASIC that drew games on the screen. There’s a lot to be said for instant turnaround. My rule of thumb is that a build time over about ten minutes means that you’re dying by inches. Three seconds is about right.

We shouldn’t forget that this stuff is supposed to be fun.

Author: landon

My mom thinks I'm in high tech.

17 thoughts on “A little perspective”

    1. You fell victim to one of the classic blunders. The most famous is: “The error message! Read the error message!!” But only slightly less well-known is: “Inside every small problem is a big problem trying to get out.”

      Seriously, though, the temptation to make C++ code more and more and more parameterized and generic and efficient in every corner case is an attractive nuisance. It’s like the History Eraser Button. They tell you not to push it, but of COURSE you do it….

  1. And to think that we manage to pay the folks who write GUI on top of Windows in C++ the same as he folks who write C# adsense logic.

  2. Another vote for Qt. As you so beautifully described, it’s not really a good plan to try to use C++ to do anything without a large framework to build upon. This is just the same, of course, as if you wanted to use C# without .NET.

  3. Lua: for when the only things you have are a C compiler and a need not to write in C.

    (Been using it recently and I think it’s the most sensibly-designed language I’ve encountered – it’s akin to Python but with simpler syntax and without the enormous library that makes building & embedding it a complete pain. Not good for every situation but great for embedding).

  4. Have you tried Go? I was all Python for ~2 years, but for the last 2 years I’ve used Python and Go quite extensively. Go is now my favorite programming language.

    Go borrows some of the best parts of Python, like its slice notation (items[:5]) and multiple assignment (a, b = b, a), but it also has _brilliantly_ simple concurrency primitives. For example, `go f()` runs function f asynchronously/non-blockingly — that’s it!

    I got my friend, whose background is in PHP and Python, excited about Go. He asked if it was possible to, say, do 3 things at the same time in the background, then have them pass their results to a 4th backgrounded functioned, which then combined the results and passed them back to main/the original calling function. I told him that what he described is TRIVIAL in Go, and I wrote this ~15-SLOC program demonstrating just how easy and elegant this is: https://gist.github.com/4442820#file-goroutines2-go

    Go is amazing, and compiles extremely quickly (by design). Static typing, but with type inference everywhere so it feels way more like Python than Java… It’s awesome, seriously.

  5. Thanks for the excellent reminder of Why I Almost Quit Programming.

    Fun, yeah. I’ve switched to Python; I wish I’d listened 15+ years ago when I’d been given exposure to it but didn’t “get” it (and the indentation stuff turned me off.)

    I’ve been back to banging on Python for a few years now and I don’t regret it at all. Yeah, there are annoyances. Overall, fewer than any other language I’ve used. (That said, I’ve never really learned Ruby or RoR.)

Leave a Reply

Your email address will not be published. Required fields are marked *