Why NOT to make programming into a religion

I find it amusing, as a programmer of computer code, are these arguments I read about how language A sucks when language B is far better. Assume I mean language A to be something like Java and B to mean something like C++ or strait ansi C.

I hear all the time about why C++ sucks, when compared to C. Or how Java sucks so bad because it is slow and doesn’y really teach you about a how to program.

I concider myself to be an athiest programmer. Meaning, I don’t worship one language over another. This is not entirely true. I think PHP is far better than Perl. Maybe, I’m just not left brained enough to want to put up with all of Perl’s, let’s try to be as tricky as we can with ONE line of code, instead of making it even close to human readable.

The comment I made above, is probably the most reasonable argument to make, if you want to start a rant about why languages suck compared to others. In that, PHP and Perl are trying to operate on mostly level ground. Both are interpreted languages and both abstract coding ideas away, to make life easier for the programmer. Such as, not having to worry about data typing and memory allocation.

To compare Perl to PHP, is not nessasarily a technical argument, more so than a timing one. If I started to learn Perl before PHP, because PHP did not exist, than I would have been raised on Perl. Instead, I was blessed, to not have to deal with Perl and use a cleaner language, PHP, which operates more or less on the same level.

But, when the argument comparing C to Java comes up. Or even C to C++, I see their point of views. But, I also see how they unintentionally corner themselves into a ‘Language Religion’, so to speak. Meaning, since I ONLY like to program in ASM or as close to the hardware as possible, hence rooting for C or ASM, and completely dogging more abstracted languages like C++ or Java.

There is no question that C is exactly what you need, if you want to program device drivers or make programs that are as efficient as humanly possible, in terms of memory and CPU cycles, while still being as portable as possible. ASM *Assembly is NOT portable therefore belongs in a category of it’s own.

But, what about when you want to program in C++? Just about every hardcore C programmer will tell you that C++ is a big fat pig. It’s usages of Classes and Templates as well as trying to make pointers ‘easier to use and understand’, completely fails.

The argument than becomes a heated debate, when you compare C to C++. Everything you can do in C++ you can do in C, and visa versa! C++ just abstracts things away, to the point, that when you compile and look at C++ code, and compare it to C code, the resulting Assembly code is much less bloated with duplicate instructions, or instructions that can be optimize, had the programmer use strait C instead. This is absolutely true when one wants to reverse engineer compiled code, or try to debug it. C ASM compiled from C is going to be cleaner than ASM compiled from C++.

However, if you want to program a video game, in some cases C++ is more manageable than C, because using the templates and Classes, built into C++ keeps you from having to reinvent those parts. You can make C do everything C++ can using structs with function points and generic function parameters using VOID *. However, why? When you can use these powerful abstractions in C++ and avoiding potential bugs as a result of having to manage every minute detail?

Granted, your resulting C++ will be a bit more bloated in terms of extra ASM instructions, but with Dual CPU Cores and Gigabytes of RAM to make up for this overhead, why bother?

At the same time, you can say C now has many good libraries now, that you CAN program a game in C using graphics libraries like GTK. However, for your own data structures, for instance, if you need to manage the data items that make up a space ship in a 2d/3d shooter game, you will be left with structs in C, while C++ having the advantage of Class creation with easy to add methods, constructors and destructors.

Maybe you want to invent the Class concept all over again using C or maybe you don’t, therefore have the option to take advantage of all that CPu, GPU and RAM and just accept the extra overhead that comes with C++.

While at the same time, strait C is absolutely perfect for such things are Kernel development and device drivers, because in those cases you do NOT want any extra overhead, to make your program run as fast and portable as possible.

Do not lock yourself into a corner, by discounting one language for another. Especially when it comes to the debate of C verse C++. Both have their advantages and disadvantages.

The same can be said of Java in comparison to Python.

Where I personally draw the distinction between languages are languages that try to compete at the same abstraction level. Again, an ease no brainer for me is that PHP rocks compared to Perl. Both are at the same abstraction point, yet one lacks needless complexity, for complexities sake. In other words, how much of a nerd to I really want to be? And, what language was I raised on, at the time. Again for me, PHP was available, so Perl was out the door.

However, even at that point in the argument, it is unfair to discount one for the other, if only for the desire to be free to choice your level of nerdness. Want to be needlessly nerdy AND have the option to choose between PHP and/or Perl (simply because both exist and are highly developed), you have the choice.

Now why do I care to even bring up the argument of why people bring up computer language comparison debates? Because, if you see the language for what it is good at and not good at, will open the doors for being able to pick the right language for the job and amount of time and will and perhaps money that is involved.

2 Responses to “Why NOT to make programming into a religion”

  1. Links 24/10/2009: Fedora 12 Beta and Linux Mint 7 KDE Reviewed | Boycott Novell Says:

    […] Why NOT to make programming into a religion I find it amusing, as a programmer of computer code, are these arguments I read about how language A sucks when language B is far better. Assume I mean language A to be something like Java and B to mean something like C++ or strait ansi C. […]

  2. Kylie Batt Says:

    Весьма ценная штука…

    I find it amusing, as a programmer of computer code, are these arguments I read about how language A sucks when language B is far better…..

Leave a Reply

You must be logged in to post a comment.