So you want to make the Next Big Thing in the computer software industry? You have been haunted by this idea for months and now it is starting to affect your sleep, so you decide to take up programming. The first question you need to ask yourself is: ‘what programming language should I learn’. There are dozens of languages to choose from, each with their own unique pros and cons, this article will present three of those languages.
C was created in 1972 by Dennis Ritchie of Bell while ‘C++’ was being developed by Bjarne Stroustrup in 1979. By looking at the dates these languages have been around for a long time and are well tested. Linux, Windows, Mac OS and many other operating systems were constructed in C/C++ as well as most of the games you have played on your computer or console.
Java, another common programming language, was developed by James Gosling from Sun Microsystems in 1995. Assuming this isn’t the first time you have been on the internet, you have used many programs and applets developed using Java. This language was made absolutely famous by the internet because of the ‘Write Once, Run Anywhere’ philosophy James Gosling had from the start. This means the program will work on any OS that supports Java without changing a single line of code.
The last language to introduce in this article is C# (C-Sharp), supposedly Microsoft’s answer to Java. This language was introduced with Microsoft’s .NET Framework. Over the past couple years the popularity of the language has grown considerably, especially with the newer releases of the .NET Framework.
Those three languages were picked because of their popularity in the software world, the vast amount of help a person can find about topics and issues on the net, and the shared syntax between them. C# and Java both share very similar syntax which was originally taken from C/C++.
The main difference between C/C++ compared to Java and C# is how the code is executed when a user runs the program. C/C++ is a compiled language meaning that the executable contains ‘machine-code’ and is directly executed by the OS. Java and C# are bytecode languages that are converted into ‘machine-code’ on the fly when the user runs the program.
The issue of speed is something you must consider when choosing a language. A compiled language will run faster than an interpreted (or bytecode) language. When executing an interpreted language a Virtual Machine is started and converts each bytecode into the corresponding machine code before sending it to the processor(s) via the OS. A compiled program does not have that step, the code is sent directly to the processor (via the OS) for execution. For normal applications the difference is negligible and unnoticeable. For example, you would not notice the difference between a compiled language and a bytecode language with programs like word processors, web browsers, most business applications, email clients and even instant messengers.
There is a large debate about a bytecode language and the viability of making a complex commercial video game for the PC or the Xbox. Many people say that it can be done with just as many people arguing that it cannot. Creating and MMO like Warcraft or Star Trek Online seems viable, but on the flip side making a game as visually complex as Gears of War does seem a little out of reach at this time.
Another downside to using a bytecode language is the extra system resources needed. Today’s machines have one to four gigabytes of RAM making the extra resources Java and C# needs almost irrelevant and unnoticeable.
The next issue in choosing a language is the choice of operating systems your program is designed to run on. C/C++ is pretty much on every platform currently in existence and porting is incredibly easy. A bit of source code may need to be changed or just recompiled. Java can be run on any OS that has support for the language without any modification. C# is primarily for Windows. There are a few ports of the .NET framework for Macintosh and Linux, but your program is not guaranteed to work as expected, if at all.
Pointers. They are the bane of the new programmer, and probably one of the main reasons many people quit their dream of developing the Next Big Application. They are a massive part of C and C++ and they take a long time to learn how to use them correctly. In Java you will never touch a pointer. In C# you should never have to touch a pointer but there is a way if you need to. Pointers still exist in both languages but they are tucked away in the closet like a dirty secret.
Every program needs memory to run. The amount depends on many different factors, mainly how much data the program is working with. This is called memory allocation, something that must be done manually in C/C++ but is automatically done in Java and C# when a variable is created. Eventually the data contained in a variable is no longer required and needs to be freed up. In C# and Java this is done automatically by the garbage collector, a feature C/C++ does not have. The programmer must free up the resources manually or cause a memory leak.
The single and most important issue between Java and C# is the underlying .NET platform and the different technologies given to us by Microsoft. C# can natively access these technologies whereas Java cannot, though there may be 3rd party tools that can help or have the same functionality. Example: the new ADO.NET Entity Framework can be accessed by C# without a problem but Java would need a 3rd party ‘library’. There is also technology that Java cannot access at all, such as Silverlight.
Finally there are tasks Java and C# cannot do that will force a new programmer to default to C/C++. This is mainly low-level tasks like OS creation and device drivers. While you can make an operating system out of C# and Java (check out Cosmos and JNode), it is not currently feasible to create a practical OS. Device drivers for Windows and Linux are also not possible due to a host of technical issues.
In closing, this article has given you a bit of an insight into the workings of three different languages—a few good things and a few bad. This is by no means a comprehensive list of features. The intention is simply to give you a little information about three popular programming languages to get you started.
blog comments powered by