DEV Community

Cover image for Best Languages to Learn How to Code
Lorenzo Pasqualis
Lorenzo Pasqualis

Posted on • Updated on • Originally published at coderhood.com

Best Languages to Learn How to Code

This post was first published on CoderHood as Best Languages to Learn How to Code. CoderHood is a blog dedicated to the human dimension of software engineering.

English, Chianti, C and the old days

When I discovered the existence of computers, I lived in a place known worldwide for art, food, Chianti and hand gestures; not so much for technology. I loved growing up in Tuscany. Winters were sunny and crisp, summers hot and lazy, falls welcomed and refreshing, and spring the closest thing to paradise that I can think of. The resources I had to learn computer programming in 1984 were rare Italian translations of american books, a few monthly magazines, a healthy dose of curiosity and passion, and a thick skin to fend off middle school bullies. Now that I think about it, for those, martial arts training helped even more.

The only human language I knew was Italian. The only English word I knew was "yellow" -- don't ask, my brother thought me that word for reasons I can't remember -- and I was very proud of it. Little I knew that I would learn many more words like "if," "then" and "else" studying computer languages. Basic, C and Pascal were the ones readily available to me, and I knew that only because I spent a remarkable amount of time at the local library and bookstores.

Serious programmers coded in C. C is a no-frills language that gets immediately down to business. Wonderfully low-level, it is still the backbone for software such as operating systems and compilers. I used C and C++ (the object-oriented version of C) extensively throughout my career, and I still use it today for some personal projects. All serious professional developers, at some point early in their career, must at least learn to understand C and C++.

Basic, a very Simple interpreted language, was made famous by Bill Gates and Paul Allen and distributed as part of MS-DOS from the beginning of Microsoft. Basic was also included in low-cost home computers such as the Commodore product line. If you want to know more about this fascinating area of technology history, I urge you to read "The Innovators: How a Group of Hackers, Geniuses, and Geeks Created the Digital Revolution." Today Basic is mostly dead, with some arguable exceptions.

Pascal was designed in 1968-1969 and was later made popular by Borland, with a fantastic product called Turbo Pascal. It is a beautiful language, a joy to use and easy to read and learn. I wrote hundreds of thousands of lines of Pascal and Delphi (an object-oriented version of Pascal) in the 1980s, and early 90s. Like Basic, Pascal lost ground, and it is no longer a popular choice.

Today you have many choices

Today the computer language landscape is much more diverse. There are many useful languages and technologies to choose from. The decision can be difficult. Over the years, I have had numerous people ask me what is the right language to start with. The answer is nontrivial, and it depends on what your goals are. A specific recommendation for a particular project would have to start with a list of questions of what you have in mind. I will not do that because If you are thinking about learning to code well, you need to get strong fundamentals and not worry about one particular project. For this reason, I am going to give you a prescriptive direction to guide you toward a reliable path I know will serve you well in the long-term.

My recommendation is this: learn an object-oriented compiled language, a scripting language, and play with at least one microcontroller.

Start learning the fundamentals of Java

Java is an object-oriented, compiled language. Compiled means that a software program called a "compiler" reads the Java code you write (readable by humans) and transforms it into executable bytecode (readable by machines). In Java, the bytecode is not a specific CPU machine language (like in C), but a Java Virtual Machine (JVM) language. You can think of the JVM as a software emulation of a virtual CPU.

The bytecode generated by the compiler is executable on any computer with a JVM. JVMs are available on almost every computer, operating system and iOT device in the market; thus, if you have a computer, you likely have the hardware to run Java programs. You can download the Java development kit for free from the official java.com site.

Java is a mature technology, has an active community and is used successfully for large-scale systems. It's a good language that runs real software and performs surprisingly well. Many developers specialize in Java, and there are plenty of jobs for Java developers in the software industry. At DreamBox Learning, the amazing company where I worked for the past ten years, Java is one of the main languages we use.

Some examples of popular websites that are, at least partly, powered by Java are:

Java commonly powers software on consumer devices. For example, if you have a Blue Ray Player, much of the software is written in Java. Another example is the Android application framework, also written in Java (the OS itself is Linux, written mostly in C).

The Java VM can also be used to run code not written in Java; several modern languages compile to JVM bytecode. For developers, the advantage is that, once they are familiar with Java, they have access to many languages based on the same technology, easy to integrate with Java code. Examples of JVM-based languages are:

  • Clojure, a functional Lisp dialect
  • Groovy, a dynamic programming, and scripting language
  • Scala, a statically-typed object-oriented and functional programming language.
  • JRuby, an implementation of Ruby
  • Jython, an implementation of Python

Hello World in Java

Here is a simple example of Java program that just prints "Hello World" on the console:

public  class  HelloWorld  {
      public static void main(  String[]  args  )  {
            System.out.println("Hello World!!!");
      }
}
Enter fullscreen mode Exit fullscreen mode

And here is how you compile and execute it from a Linux command line:

$  cat HelloWorld.java
public  class  HelloWorld  {
    public static void main(  String[]  args  )  {
        System.out.println("Hello World!!!");
    }
}
$  javac helloworld.java
$  java HelloWorld
Hello World!!!
Enter fullscreen mode Exit fullscreen mode

Java development tools

To get started, head over to www.jetbrains.com and download IntelliJ Community Edition. It is one of the best Java development environments available, and it is free.

Learn a scripting language

A scripting language does not need a compiler: it is executed directly by an interpreter. In a basic incarnation, an interpreter is a software program that reads a human-readable script, line by line, running it as it goes. Just like a human interpret translates a live speech from one language to another, a language interpreter translates running code into machine-executable instructions, running them live.

Many scripting languages are gaining traction in the software development world. I recommend learning Python: a popular and powerful language used extensively in the software industry. A few examples of websites that are, at least partly, written in Python:

  • YouTube
  • DropBox
  • Survey Monkey
  • Parts of Google
  • Quora
  • Bitly
  • Reddit
  • Yahoo Maps

Hello world in Python

Here is an example of hello world in Python:

print("Hello, World!!")
Enter fullscreen mode Exit fullscreen mode

And here is how you execute it:

$  cat helloworld.py
print  "Hello World!!!"
$  python helloworld.py
Hello World!!!
Enter fullscreen mode Exit fullscreen mode

Python development tools

There are many ways to author Python, but the best tool I know is PyCharm. The free community edition is a great place to start. Go to www.jetbrains.com and download it for free.

Play with microcontrollers and the iOT

One of the most exciting innovations in the last few years has been the development of inexpensive microcontroller boards. A popular example of such board is Arduino.

This small marvel of technology costs about $18, and can run code written in C/C++. It does not come with a built-in display, nor a video connector. To program it, you connect it to a computer via a USB cable.

The development environment is free, and following some easy online tutorials, you'll be able to write code and run it on this incredible hardware.

Hello world with Arduino

Here is an example of hello world written for Arduino:

void  setup()
{
    Serial.begin(115200);
    Serial.print("Hello World!");
}

void  loop()
{
}
Enter fullscreen mode Exit fullscreen mode

For a complete example following this link.

The iOT is fun and at arm's reach

With some basic electronics skills, you can also create amazing Arduino powered devices. I am not a hardware guy, but I used Arduino to build a device that wirelessly turns-on any number of flameless candles when it senses the presence of a person and turns them off when the person leaves. I installed it in the entryway of my house, and I am greeted every day by the lively bouncy light of candles when I come home.

I recommend playing with Arduino because it gives you exposure to two important elements that will make you a stronger developer: iOT devices and C programming. It is inexpensive, fun and powerful.

Another popular option is the Raspberry Pi, which is an amazing little device. The Raspberry Pi is a full Linux machine and doesn't feel like a limited iOT device. You connect it to a keyboard and a monitor, you boot it up with Linux, and you can run anything that you'd be able to run on any Linux machine, including X. If you don't have access to a Linux machine, a Pi is a wonderful way to gain that access for only $35. To learn more low-level programming, I'd stick with Arduino. It will force you into a different paradigm that I believe is important to grow as a developer.


If you enjoyed this article, keep in touch!

Oldest comments (22)

Collapse
 
eljayadobe profile image
Eljay-Adobe

Another platform ecosystem is .NET, which uses C#, VB.NET and F# programming languages. .NET is comparable to JVM. C# is comparable to Java. VB.NET is... well, we don't talk about VB.NET. F# is "OCaml for .NET", which is a functional-first FP language that can do OO too.

F# style of functional programming -- the OCaml style -- is different from Clojure or Scala or Haskell style. Different isn't a bad thing. It's just different.

Collapse
 
kspeakman profile image
Kasey Speakman

F# is the main reason I keep using .NET. I find it is well-balanced among the other FP languages you mentioned. In a world where I could pick and choose languages separately from platforms, I'd probably run F# on the JVM.

Collapse
 
damcosset profile image
Damien Cosset

As a Javascript developer who doesn't know deeply any other language, I think Javascript is the best language in the history of the universe. It is, by extension of the previous argument, the best language to learn how to code.

Warning: I do not have any arguments to support this claim outside of my limited understanding of Javascript nor am I willing to change my opinion in any way, shape or form.

Best regards.

Collapse
 
lpasqualis profile image
Lorenzo Pasqualis

Ok. Thank you for your comment.

Collapse
 
amencarini profile image
Alessandro Mencarini

Sorry, but I feel compelled to invoke Poe's law here. Is your comment sarcastic?

Collapse
 
damcosset profile image
Damien Cosset

Haha, yes it is. Damn, I should have done a better job. I thought the 'history of the universe' would have been enough. :)

goes back to study sarcasm

Collapse
 
aghost7 profile image
Jonathan Boudreau

I think the main thing you need to worry about is the ecosystem and community when it comes to a good first language. Documentation will definitively play a major role if they actually want to build something out of their newly acquired skill eventually.

Collapse
 
podenno profile image
Peter Denno

Good point. I suggest Scratch first above. Tremendous IDE and community. For a second language I would look for a read-eval-print loop (clojure) or shell (python) and nice tools. See 4clojure.

Collapse
 
eddy_edward101 profile image
Sahil Edward Thapa

Clear and concise article. Nice.... Loved it!!

Collapse
 
lpasqualis profile image
Lorenzo Pasqualis

Thank you, Sahil!!

Collapse
 
bgadrian profile image
Adrian B.G.

Actually Scratch is the best language to learn programming. Being a visual programming language the student focus 100% on programming part, ignoring:

  • dev setup (IDE)
  • compilers/transpiler
  • syntax !! This is a huge breaker, they spend 15min because a missing semi colon
  • platform specifics (win vs mac vs linux), especially when you learn compilers
  • etc

I will write a blog post soon with more details.

Collapse
 
podenno profile image
Peter Denno • Edited

Yup. My kids started here. It is sort of agent-based & pub/sub, which makes for a nice transition to OO, I think. My 11 year old then moved to writing java plug-ins for minecraft with eclipse. No reason an adult could not start here.

Collapse
 
pinksynth profile image
Sammy Taylor

Wonderfully informative article!

Collapse
 
lpasqualis profile image
Lorenzo Pasqualis

Thank you, Sammy!!

Collapse
 
lpasqualis profile image
Lorenzo Pasqualis

CPython does transform the Python code into bytecode and runs it, but it is still an interpreted language. You do not explicitly compile a Python source file into bytecode. It happens transparently for you at runtime. Java is not involved in the process.

Collapse
 
subbramanil profile image
Subbu Lakshmanan

Thank you Lorenzo for sharing your knowledge & experience. Great post!!

I use Java (Android developer) at my work and javascript (Node.js & Angular.js for my personal projects). Occasionally I play with RaspberryPI & Sensors (mostly I use Node.js).

But I agree that using arduino will teach you the low level programming. Definitely would love to give it a try!!

Collapse
 
eljayadobe profile image
Eljay-Adobe

Pascal was designed by Niklaus Wirth. Object Pascal was design by Apple and Niklaus Wirth. Object Pascal was branded as "Delphi" by Borland. Which is still alive and well, and being sold by Embarcardo. Object Pascal is also still alive and well, being sold by RemObjects branded as Oxygene.

That being said...

I think Python 3 is the best language to learn to program these days.

Collapse
 
erebos-manannan profile image
Erebos Manannán

I would highly recommend getting started by trying a proper modern nice language instead of one of the ancient monsters that are super verbose and difficult to debug. Java and other JVM languages come with the extra baggage of the JVM, which is significant pain in the ass.

Python has excellent error handling and reporting, so when you make a mistake it will likely be easy to find out what it was by yourself, and google will definitely be very helpful. Python is overall the best option, language is easy, has a friendly community, very good options available to work on practically anything you can imagine from mobile apps, games, to websites and desktop applications.

Golang is similarly an easy language to work with, though has less options for integration. It's low level enough to teach you about some of the basics rather well, without being an absolute chore to work with like C/C++.

Rust also works for certain jobs really well, and while I've not had personal experience with it, I know several people whose opinion I believe - the programming model in it makes it easier to make better software with less headaches. From my understanding it also has a wide array of libraries available to do a lot of different things.

Sadly, if you want to focus on frontends, JavaScript is really the only option out there. It's an awful language and I hope it dies in a fire along with the design committee, but it still powers most of the web and many other frontends nowadays.

And lastly, C# is also a significantly improved language to the rest of the C-family. It also has a very wide array of options available for you on what you can do with it, games (e.g. Unity, and others), desktop applications, mobile apps (Xamarin), web applications, etc. .. just remember to stay with the "Mono" version of it and you will have relatively few big surprises (the version of Mono shipping with Unity I believe is still ancient, but an update is coming).

As a side-note, one should not discount the fun and practical value of learning to code using an existing game - many games support scripting via Lua, so Lua is a solid choice if you want to go for that. I remember having some of my most fun programming experiences as a kid when playing ZZT, and Quake because of how easy it was to modify them with their own programming languages.

Collapse
 
erebos-manannan profile image
Erebos Manannán

For the browser side there is starting to be some hope, Kotlin and Elm are starting to be somewhat useful on the frontend, however there are likely going to be almost no jobs at normal companies with those skills as the scene is dominated by JavaScript.

Collapse
 
richjdsmith profile image
Rich Smith

While I don't use it much any longer, I honestly believe Ruby is a fantastic language for beginners. It's clear, concise and because of Rails, there are thousands of tutorials and information online.

Is it fast? Nope. But it's still a great place to start.

Collapse
 
codemouse92 profile image
Jason C. McDonald • Edited

Seconding the statement that Python is excellent for early learning and advanced coding alike!

However, I would have to disagree about Java - I've had to help countless interns unlearn so many terrible habits from that language before they can write good, clean code in other languages. C++ is by far a much better language in that category to learn: it provides enough abstractions and tools to make it easy to get started, but allows you to take more control as you're ready. (C++17 is looking to be the best version yet, I might add.)

Collapse
 
lpasqualis profile image
Lorenzo Pasqualis