Enjoy Every Sandwich

Thoughts on SQL, XML, .NET and sometimes beer.

<December 2008>
SuMoTuWeThFrSa
30123456
78910111213
14151617181920
21222324252627
28293031123
45678910


Navigation

Tools

List O'Links

Kent's Other Stuff

Subscriptions

News

Please read these
Notices and Disclamiers

Post Categories

Article Categories



C++ is evil, depending on how you define "is evil."

Fred -- the mystery poster to my “Omaha loves Whidbey” thread -- has impeached (in good humor, I believe) me for saying that C++ is evil. Worse, he charges me with being a VB Guy from way back.

I can't defend myself against this charge, as yes, I've been using VB for a relatively long time. Not as long as I've been using C, C++ or C# though.

But C++ is evil.

Let's get some semantics out of the way. I've picked those words carefully, so hear me out. I'm saying is because I'm referencing the here and now. I'm saying evil using the definition “characterized by or indicating future misfortune.“ I am not saying that C++ is, or ever was, wicked, infamous or malicious.

C++ was not evil in my book from 1986 (when I got my first taste of it) until 1995. In fact to the this day, I'd admit it was one of the best hacks ever. Rather than forcing us to learn a new language like Simula or SmallTalk to use OOP, Bjarne Stroustrup simply extended good old “C“ with classes, exceptions and templates. That was a very good thing indeed. But, that was a two-edged sword: because it was still based on C -- and in fact in early times was just pre-processed down to just “C“ before getting compiled, we got all the problems that “C“ has. For me, the biggest problem with C/C++ was that it was too dramatic to program in. Sure, I did a lot of programming in both languages. Hundreds of thousands of lines of code. I knew the gory details of function pointers, the complexity of managing __far heaps and could chanted the command line switches for MS C/C++ in my sleep. What little of it I got. I even got so familiar with PCLint that I could recite virtually every warning it could throw at you word for word. Even the most trivial of programming projects required huge amounts of mental and physical effort to produce.

In 1995, Java changed that for the better. Unfortunately for me, that's when I detoured into Marketing and started working on stuff called “The Internet.“ Sure, I had Visual Basic 1.0 around. It was novel enough, but I still liked QuickBasic better. When Visual Basic 3.0 rolled out gave me a meaningful way to do forms, I though, “well, that's nice, but I've got this stuff called HTML, and this other stuff called Perl...“ That was a better combination for me because it meant I could have forms (HTML) and business logic (In Perl) without having to mix the two.

The world changed again in 1998 with the introduction of ASP 2,0 and the NT4 Option Pak. By this point, was pretty much back to being a developer full-time. Basically felt forced to learn VBScript because our other programmers already knew VB, and they didn't need to ramp over to Perl or Java. At the same time, I knew that eventually, they'd have to take care of my programs and I would have to take care of theirs. New job with a new company, but the same result: another VB shop. Fast forward to 2001 and Microsoft hits us not only with C# but also ASP.NET. We decided intentionally not to make the jump to C# because we knew could sustain ourselves best with VB.NET.

So, all that said, C++ is (currently) an evil (indicating future misfortune) choice for me and others like me to make for three reasons:

  • For the programmers that I work with today, the transition from VB to VB.NET has been arduous. Going from VB straight to C++ would be a Herculean -- if not Sisyphean -- task.
  • Since they have to be able to support my code, and I have to be able to support theirs, we need to agree on a common denominator. Since I was about the only non-VB programmer in the group, guess who got to adapt.
  • With .Net, 90% of the benefit one gets from C++ compared to VB (classic) are eliminated.

I don't think HDR is alone in this line of thinking either. In fact, I'd suspect this same line of reasoning has been adopted by thousands of business world-wide.

If I ignore these real world economics today; the decision to use C++ would portent if not flat out provoke -- misfortune for me.

When programming for myself, I rarely write VB.NET. I've seen the light that is C# and that's happy place for me. I can get so much more work done so much more easily with that can I anything else other than Perl. Comparing my productivity in either to what I could do today with C++ makes me feel good about that decision.

It won't last, though: X#/Xen/CΩ is going to be a much better fit for me, I guessing, than any other language that I've used so far.

For the sake of completeness, this is a listing of the programming languages I've learned in more or less sequential order since writing my first bits of code while I was in Junior High:

  • 650x Assembler
  • Basic (ProDOS, Commodore embedded)
  • Z80 Assembler
  • First programming class (high school): FORTRAN
  • First college programming class: APL
  • COBOL
  • First programming job: C, C++, QuickBasic and SQL
  • VB3
  • Perl
  • JavaScript
  • SQL, T-SQL
  • Java
  • Forte/Tool
  • VBScript, VB and VBA
  • XSLT
  • C#
  • VB.NET
  • PeopleCode
  • XQuery
  • Most recent: Python

Within the next two years, I suspect I'll be relearning Perl, starting with MDX and XAML and gazing lustfully at CΩ.

posted on Friday, February 20, 2004 11:55 PM by ktegels





Powered by Dot Net Junkies, by Telligent Systems