Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Programming Language to Replace C++

Name: Anonymous 2010-08-11 21:49

I think we can all agree that C++ is a terrible language. So why is it still around?

When talking to most C++ users (game developers, systems programmers), I've found that most seem to recognize C++'s faults, but they don't really care. They aren't even the slightest bit interested in a new language that might solve its problems, even one that gives them all the power of C++ with none of the downsides. You can't even get them to look at something new.

Why is that? Why does everyone just 'live with it' without wanting to improve the situation?

Name: Anonymous 2010-08-17 5:00

>>63
You're pretty much correct. As >>66 says, Obj-C is a true superset of C which adds object-orientation using Smalltalk-like syntax. Other than that it's a lot like Java, but it is more dynamic and does not have a JIT, and it's susceptible to memory corruption. Wikipedia has a long writeup if you want to see what it looks like.

It has a lot of bad warts, and while it is used everywhere on Macs, it is used absolutely nowhere outside of Macs.  I wouldn't use it if I didn't have to.

>>65
Except Java is designed to be code for a virtual machine and C# is a full fledged language that happens to be written primarily for a virtual machine.
Nah, Java was designed for enterprise coders. It is almost featureless for this reason: it is so that you can hire a bunch of bad coders, and they can actually get something working without doing too much damage. It is extremely unproductive for anyone who actually knows what they're doing.

>>66
Yes, they are completely interoperable
To elaborate a bit, they are very interoperable (you can mix them freely in the same source file), but their features do not correspond to each other. They have separate class hierarchies: a C++ object is not an Objective-C object, you cannot subclass one from the other, you cannot template Objective-C classes or methods, etc. They have separate exception handling stacks: the try/catch from one cannot catch exceptions from the other, Objective-C exceptions don't unwind the stack, etc. That last one is particularly dangerous; definitely do not throw exceptions across language boundaries.

And lastly, if you thought C++ error messages were confusing, try Objective-C++; since even C++ is undecideable, Objective-C++ is downright hilarious. One of my favorite compiler errors is "Confused by earlier errors; bailing out." That one is especially fun when it's the only compiler error you get.

For OpenGL games (on iPhone or Mac OS X), virtually all developers just wrap the Objective-C they are forced to use and write everything in C/C++.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List