Overview of Programming Languages for Beginners
By Tyler Kolody
DISCLAIMER: Though I’ve tried to stick with the facts, I’m primarily a Python programmer interested in data science/AI, so opinions expressed come from that perspective.
C
Pros: Faster than pretty much anything else, OG modern language with most other languages inheriting syntax from it, will let you do anything you want even if you shouldn’t.
Cons: Lacks the versatility of the object-oriented paradigm, doesn’t do anything for you; everything must be explicitly built, will let you do anything you want even if you shouldn’t
Summary: The grandfather of modern programming languages, except this grandpa is Usain Bolt and none of its kids or grandkids can keep up with it in a straight race. Like most geriatrics, it’s not very flexible, but despite being over 40 years old, it is still in active use for many applications. It isn’t as popular as C++ or Java, but is useful when writing code that must be extremely fast and light weight, while still being executable on multiple system architectures. Different compilers can read and convert it into machine code for many different system architectures without changing the code itself. It epitomizes the old adage “Easy to learn, hard to master” as the codebase itself is extremely small, but true understanding is something that could take decades to reach.
Hello World!:
C++
Pros: Very fast, has modern language features, won’t let you access memory willy-nilly so is safer than C
Cons: Difficult to learn, suffers from readability issues as it is literally just C with a bunch of things added retroactively and some of it can get messy
Summary: Much of what has been said about C can be said about C++, and you can technically run C++ as C. However, they are not the same language and C++ adds many modern features; most notably the concept of classes and objects is central to C. It is still a low-level language and abstracts very little, but it will not allow you to do whatever you want the way C does. For example, it will prevent you from accessing memory memory you shouldn’t, making it safer. These attributes, in addition to its efficiency make it ideal for large applications that still need to run quickly, making it very popular for game engines and cryptocurrency protocols.
Hello World!:
Python
Pros: Easy to read, beginner friendly, very wide range of applications particularly in data science
Cons: Slower than other general-purpose languages, not as scalable for very large projects
Summary: Python is a high-level language that abstracts away much of what is going on in the code, allowing for very fast prototyping and leading to extremely easy to read syntax. This stems from the fact that it does not require explicit type declarations, nor does it require programmers to understand memory management. This is helpful when trying to introduce concepts to beginners, but by ignoring these concepts it can make it more difficult to move to other languages later on. Underneath it’s simple syntax, Python combines many different features and paradigms, making it extremely flexible. For example, it is an interpreted language meaning that each statement is read and translated into machine code at run time, but can also be compiled if desired. This, makes it a popular language at all levels of programming experience. Even it’s notable performance issues can be circumvented in some cases using libraries that allow other languages to run within its code (notably C, the fastest modern language). Python has commonly used versions, 2.7x and 3.x, commonly referred to simply as Python 2 and 3. Python 2.7x is the older version which traditionally has had better library support. However, Python 3 is the future, and has more or less caught up to it’s predecessor. While there are many differences under the hood, practically speaking the syntax differences are fairly minimal.
Hello World!:
Python 2
print “Hello World!”
Python 3
print(“Hello World!”)
Java
Pros: Very portable across different platforms without needing to be compiled multiple times, substantial community support, no need for memory management unlike C++
Cons: Some security issues, purely OOP (literally everything has to be an object) can be difficult to get used to for those coming from mixed paradigms
Summary: Java is the most ubiquitous of the Big Three general purpose languages, being extremely portable and having many features that make it very compatible with web development in addition to app development and general use. It has been the dominant language for two decades, and although it has lost ground to others, it is still enormously popular. It’s as versatile as Python, almost as fast as C++ and more portable than pretty much anything; essentially a jack of all trades. It’s also the main language used to write Android apps, making ‘Java developer’ a very high demand position. However, since everything must be an object, the syntax can get extremely long and unwieldy.
Hello World!
JavaScript
Pros: Hahahaha no…Fine, I’ve been informed that this is supposed to be informative and not a platform for my biases so I’ll try. It is fairly simple, if not very nice, syntactically speaking. It’s fast. Its popularity means there’s a lot of documentation and support for troubleshooting.
Cons: You don’t have a choice if you want to do web development; it’s the primary client-side language used. It is a security nightmare; most web exploits are rooted in JS. It’s not browser agnostic.
Summary: JavaScript is the most popular client-side web language in existence, and is responsible for much of the modern internet’s look and functionality. It handles everything on your computer when you browse, hence why it is ‘client-side’, as opposed to server-side languages such as PHP that handle the back end of web development. Most things that move on a website and anything you can interact with is the result of JavaScript. It is entirely web-focused, but can technically be used more generally. The wide array of frameworks such as jQuery, Angular and React allow for a diverse approach to web and application development. Its prevalence across the web ensure that it isn’t going anywhere, and the variety of frameworks and active community help cover up some of it’s numerous issues. On the topic of its name and relation to other languages: Java is to JavaScript as car is to carpet.
Hello World!:
To print to browser:
alert(“Hello World!”)
To print to console:
console.log(“Hello World!”)
Assembly
Pros: You can’t get any closer to the metal, very clearly (relatively speaking) corresponds with CPU instructions.
Cons: The metal is cold, hard and frequently shocks you. Made worse if your tears of frustration and despair short out the keyboard.
Summary: This is functionally machine code, where each line or instruction roughly corresponds to an instruction executed by the CPU. Assembly is not an actual language but an umbrella term; each CPU architecture has a different language specific to it. It is typically used for embedded systems, devices with little computing power and need to be absurdly lightweight. It is the interface between hardware and software that eventually, every other language is compiled to or interpreted as. Primarily the realm of hardcore engineering nerds who should get out more, but no judgement if this is your thing.
Hello World! (NASM x64 assembly):
Incoming student for the fall of 2018 here, how necessary is it to know programming languages in our field? Particularly in Library or Archives?