A Beginner’s Guide to Programming Languages
C? C plus plus? Java? Javascript? Ruby? Ruby on rails?
There are tons of programming languages out there and for a beginner it’s sometimes hard to keep track or know where to start. In this guide, we will explore 6 different languages, their uses, and pros and cons of using them. Under each language, there is an example of what a “Hello World” program would look like, to give you a feel for the language. Before that, let's talk about your thought process for choosing a specific language.
First, identify your goals
Computer programming is the art of programming a computer. There are a lot of different kinds of computers and a lot of different kinds of programs you could build. Consider this sampling of career paths that you could take as a computer programmer:
Web Developer (Front-end or Back-end)
App Developer (iOS or Android)
PC Game Developer
Data Management
Financial Services
Software Developer
One of the great questions a lot of kids ask is what language they should choose next, especially as they finish programming in Scratch. Keep in mind that which language you pick first should probably have an application in a field that interests you. Most programmers are at least familiar with a few programming languages, so don't get discouraged if you find one language isn't for you. Keep testing out lots of languages and see which one you like and will help you complete tasks that you're interested in.
Hello world projects
Python
print “Hello World”
Python is my personal go-to language, because I find the simple syntax intuitive, and it’s the first language I learned. If you want to know more about Python I’d recommend the Why Python? post on the Coder Kids blog.
Python is a very common first language, partially because of the easy-to-learn syntax but also because it is widely accepted as a teaching language, meaning there are tons of tutorials, projects, and communities out there for first time python coders. The language itself is administered by the non-profit Python Software Foundation which insures that the language remains open source and free to use.
Java
public class HelloWorld {
public static void main(String[] args) {
System.out.println("Hello World");
}
}
Java is one of the most common and influential programming languages. Java boasts that it is a “Write once, run anywhere” (WORA) language, meaning that Java code only needs to be compiled (1) once and can be run on any platform that can support Java. It’s class-based and object-oriented (2), meaning it’s less flexible than Python, but this style makes it more portable. This portability makes it one of the most ubiquitous and popular languages. However, Java can be hard to grasp, especially for a beginner programmer.
However, although Java seems ill-suited for a beginner, there are many advantages to starting in Java. The learning curve might be steeper for a first-time Java user than for someone learning Python or Ruby, but Java teaches you how to think like a programmer. While Python is closer to English, Java is closer to the ways computers actually “think.” Meaning that Java is a better platform for learning control flow, loops, variable typing, and logic. Additionally, Java is more similar to languages like C and C++, making it easier to learn a second language. Learning a syntax-heavy language (like Java) and switching to a syntax-light one (like Python) is a lot easier than vice-versa. In my experience, I switched from Python to Java and was frustrated with my code not compiling due to syntactical errors. I had to practice translating my programs I had written in Python to Java to get used to the new language.
Also, Minecraft is written in Java, which means most minecraft mods also must be written in Java.
Ruby
puts “Hello World”
Ruby, like Python, is also open-source and object-oriented like Java (although it supports other types of programming). Created in 1995, it’s one of the younger languages that is commonly used.
It’s relatively fast and easy to learn (it was actually made with the intention of being fun for programmers), with a 20 minute quick start guide offered on it’s website. It’s easy to read, which makes it easier to focus on the logic rather than semantics. It has a large and friendly developer community, and really easy to use documentation.
Ruby on Rails is the web framework for Ruby, which is now becoming increasingly popular.
C/C++
main()
{
printf("Hello World");
}
C was created in the 1970s and C++ began as a series of improvements on C. C is an imperative programming language and C++ added object-oriented elements. C++, like Java, is one of the most popular programming languages.
Because of it’s extra features, usually C++ is a little harder to learn than C.
The aspects that make these languages a bit harder to learn (for example, variable typing) are due to how foundational they are. You will learn a lot about computers by learning C/C++. Also if you have an interest in microcontrollers (like arduinos) or robotics you should choose C/C++. C will give you a good starting point to learn ANSI C and Robot C. Also Objective C is used to develop iPhone apps. Plus, once you learn C, it shouldn’t be hard to switch to another language, since most of them are based on C.
Javascript
<script>
alert( 'Hello, world!' );
</script>
JavaScript is one of the fundamental languages for the web. It’s easy to get started with JavaScript right in your browser! It’s really in demand right now – any web developer needs JavaScript. It’s derived syntactically from C, which makes it easier to learn C and Java (although it’s not as similar to Java as you may think) after JavaScript. Also, by learning JavaScript, it’s easier to make in browser games or anything that you want to interact with visually, without having to worry about a complicated GUI(3).
Footnotes
Compiled: Computers “understand” code in something called machine language, basically a bunch of 0s and 1s. When code is compiled, a compiler converts whatever language the code was written in into machine language so the code can be executed. When Java is compiled by the developer, it becomes bytecode. Bytecode is not quite machine language, so it still needs to be interpreted. A Java Virtual Machine executes this bytecode without needing a compiler. Put simply, Java can be run on most devices that have a JVM, which is most devices, hence their “write once run anywhere” slogan.
Class-based and object-oriented: Class-based programming is a type of object-oriented programming (OOP) that uses classes (for example, my HelloWorld class in my Java example). OOP is a little more difficult to explain, but it’s a way to define “object” or pieces of code that can be used multiple times. For example, if you created an object “Dog” you could code it to bark and run. Every time you make an instance of this object, you can make it a different breed or color, but it would still bark and run. Likely, if you choose to learn Java, making a Dog class will be the first thing you do.
GUI: GUI is a graphical user interface, or the way the user actually interacts with the code.
As an Amazon Associate, Coder Kids earns from qualifying purchases.