ImJake9's Blog

My blog to post absolutely whatever's on my mind.
Programming, Minecraft, or anything else.

Why I Hate C++

Okay, okay, please, don’t instantly think I’m simply anti-C++ and won’t see reason. In fact, quite the opposite. Please, if you’re going to respond, read the whole thing. Thanks you. Now, on to the rant itself.

I am a programmer. I have programmed in many languages: Java, Objective-C, HTML (okay, it’s not a programming language, but whatever), CSS, PHP, JavaScript, ActionScript 2, ActionScript 3, etc. The list goes on and on. But you may notice that something is missing from this list. A little language called C++. As someone who knows many languages, you would think I’d know something as useful as that, right? Oh well, guess not. I simply never learned it. In fact, I never learned C or C# either. So, one day, I decided to sit down and learn it.

I started learning the basics. It was fairly simple; the syntax was like Java and the code itself was like Objective-C. At first, I thought it’d be a snap. Honestly, it was fairly easy. But even after learning the language, I don’t like it. I dislike the language for a few main reasons. Here they are:

I. Readability Stinks

Yeah. It’s true. C++ is stuck in the past when it comes to code readability. Take any other language. Say you want to copy a string. In Java, you’d use the methods String.substring() or String.getChars(). Very easy to understand. In Objective-C, you’d use [NSString substringWithRange:(NSRange *)range]. Even more obvious. C++? It’s called strncpy(). Yeah, what? Who thought that was a good idea?

Basically, reading C++ code is a pain, especially since many user-made methods use the same odd name system. It’s silly and unnecessary. I understand that this is because C++ was programmed in an age where space was an issue, but then that means perhaps it’s outdated (what I’ve thought for a long time).

II. Lack of Guidelines

This is really kind of general, and I understand that it’s easily disputed, but I feel that C++ doesn’t have really obvious “best practice” or anything like that. Java is well documented, and Apple’s Human Interface Guidelines are even a little overkill (that’s Apple, the control freaks). But C++? Not much. Sure, there are various things scattered throughout the internet, but there isn’t one single “standard” that everyone strives to use.

III. Inconsistencies, Ahoy!

This is one of my biggest gripes with C++. Nothing is predictable. Oh sure, you might say it’s more predictable than most due to its low-level pointer manipulation. But that’s not what I’m talking about. The language itself is inconsistent. Coding styles, memory management methods, local storage, online connections, byte array manipulation… you name it. There’s only a million and a half ways to do it.

This actually ties in with my other gripes. Due to the lack of standardization, stuff is inconsistent. Due to its inconsistency, it’s unpredictable. Due to is unpredictability, it’s hard to read.

Now, I have many, many other small issues with the language, but many can be put under an umbrella category: It’s Getting Outdated. I’m sorry, it is. Maybe you can refute my claims, and if you can, please do (in a civilized manner), but from what I’ve seen, C++ is an annoyance more than much else.

For example, people praise C++ for it’s low-level memory management. I say they’re weird. Java is Garbage Collected, and let’s face it, memory is less of an issue now. Garbage Collection is advanced enough to be fine now. Objective-C supports Garbage Collection in Mac OS 10.5+ and iOS 5+. However, I rarely use it, since Objective-C’s reference counting system is easy to use and effective. Do need to dealloc things in reference counting. If the count reaches zero, then the system frees the space automatically.

In conclusion, I simply hate C++, and think that one of the main reasons it’s still so popular is that people of the industry don’t want to learn new languages. So they say “Java is terrible, it’s slow” and “C++ is a great language, Objective-C is just yuck”. I’m serious, I’ve heard people call Objective-C “yucky”. Sheesh, people! If you can refute my claims, please do, but no flame wars, please. Thank you.

The Beginning?

So, I’ve started a blog. I’m not sure where it will go, but let’s hope it goes somewhere.

I’m going to make it about programming, Minecraft, video games, life, and whatever else catches my mind. So, here’s to a new blog!