Object-Oriented Languages

Choices, Choices...

It is fair to say that OOP has become the dominant paradigm in commercial programming and there are a huge number of object-oriented languages, each with their own take on the required features. Java is probably the most popular. With its support for multiple platforms, its main advantage is the possibility of running the same code base on different systems. It is also the "native" language for Android development.

However, the languages C++, C# and JavaScript also have key positions within particular sectors.

If you are developing a web app, then the only real choice is JavaScript - interpreters for this language are embedded in all of the major browses. Although it is sometimes thought of as just a scripting language, this is not accurate. It is a full featured, dynamicaly typed, object-oriented language. In one way it actually implements a purer form of object-oriention than C# etc, which should perhaps be called class-oriented languages.

If raw performance is the primary concern, then C++ is almost certainly the best language. Like its most immediate predecessor C, this language lets you get a little closer to the actual hardware. With C++ compilers for all the major platforms, this is a wide spread language.

However, the performance of C++ comes at a cost. The main reason why C#, Java and JavaScript are (slightly) slower than C++ is that all of these languages are managed. That is, there is a run-time system that ensures memory allocations and deallocations are handled safely. In C++ you must manage your own memory, and this is an error prone task that takes experience. If you get it wrong, you have a buggy program that can crash in unexpected ways. C# and Java, for example, insulate you from those kinds of mistakes.

Comparing C# and Java

When I started putting these pages together I wasn't sure whether I would go with C# or Java as the main example language for object-oriented programming. Realistically, it doesn't make much difference. Although the original rationales behind the two frameworks are different, the resulting languages are very, very similar.

You can find a more detailed comparison of these two languages here...