Archive for August, 2008

C# to C++ productivity #2

August 19, 2008

Case 2: “What’s in an error message?”

So you upgrade libraries.

With C#, odds are that you will receive a few dire warnings along the lines of “please don’t use this method anymore; we were smoking crack when we designed it and we’d prefer you not using it. Oh, sure. it’ll keep on working, just… please don’t, okay?”

Now try switching a project from the STLport library to the Microsoft/Dinkumware STL library. After changing all “std::hash_map” references to “stdext::hash_map”, all of a sudden you are faced with a new slew of errors. In “xhash”. What the hell? I didn’t write xhash, it’s a standard header for the standard template library. What’s it for? Why, for crying out loud, do I have to even care what the fark xhash even is? But sure, fine. C++ is the power language, so it must know something I do not. Let us examine what the problem in xhash is. Ah, no problem. “less() does not evaluate to a function, or a () dereference”. Or some such shit. And after that, have fun with ::rebind, and how comparers are different, and…

Wait.

Why the hell do I have to worry about this?

How is this helping me?

What short-bus committee designed this travesty?

This is why C++ productivity is a joke. It’s not a good one, and the joke is on you.

I love C++. Its power is without equal. Template meta-programming has not even the semblance of an equal in any other language. But really, if this was a car race:

  • FORTRAN is a Model T. Sure, it’ll work, but it’s about as efficient as a cheese grater is for whittling wood, and how much fun is hand-cranking the sucker for every menial trip?
  • C is a muscle car. Straightforward, powerful. Have fun spending the time fueling the sucker.
  • C++ is a rocket car. Which comes in parts. Without a manual.
  • C# is a Toyota Camry. It is not the fastest, not the most powerful, but it works, it works well, it works efficiently.

In this race (which as always is “Getting The Damned App Out The Door”), guess who wins. The rocket car, of course!

Well, as soon as you figure out how to put the damned thing together.

In the end, in a long-distance (i.e. large project) race between these, who would you bet on?

To put it another way: nobody cares how fast you can go, if you can never actually get around to going that fast.

C# to C++ productivity #1

August 18, 2008

Case 1: “What is in a string?”

You hit a break point in your code. You want to know what is in a string. You hover over the variable name in the IDE. What do you want to see?

“This is the string you wanted to see”

vs.

“std::stlp_string <std::w_char, std::char_traits>”

I have seen both today. Guess whence productivity?