Programming Languages… How Many!

Manuel Rubio
The Wild Garden
Published in
5 min readDec 8, 2016

Discuss about programming languages is hard sometimes, there are Java, Ruby, Python, … and Erlang fanboys everywhere, but when we are talking about new languages all of us listening with a bit of curiosity or even skepticism… why another new language appeared?

Seeing a list of programming languages like this with more than one thousand of languages could give you an idea about how the lack of specific features in the existent languages move to the people to create their own language.

Since I was a child my passion is learn new and curious programming languages. When I was 12 years old I started with Basic and not too much time later, and thanks to an encyclopedia my father bought about computer science, I can read and learn about Pascal, Modula-2 and C. At this moment I know around 20 programming languages and I use monthly between 5 and 10 of them.

Before to start learning a new language I always need to know to respond some questions about those languages. I think these questions are very important to keep in mind why are you learning this language and what are the benefits to continue learning it. These questions are:

  • What are the strengths of the language? Enumerate at least 2 or 3 of them and remember them when you ask yourself “why they to do this in this way?”
  • What are the weaknesses of the language? Even if the evangelists of that language is selling it as a panacea, all of them has weaknesses and you have to keep in mind all of them when you have to decide if develop something using that language (or platform).
  • What is the main paradigm used for write code for that language? It’s important to know if it’s intended the use of Object Oriented Programming, Functional Programming, Declarative, etc. Most of the languages have several of these paradigms and you are free to mix them or use only which is more suitable for your task.

Anyway, not all of the languages are very popular always. In the history of the programming languages you can see a lot of Fortran, Cobol and Basic and now the top of the programming languages is for Java, C/C++ and JavaScript, for example.

For me a good developer is a person who is been able to learn a new programming language when it’s needed and apply when fits well. A good understanding and knowledge of the language is a must, of course.

To illustrate some aspects I keep in mind to learn some languages I’m going to answer the questions for some languages not too frequent to learn for many people.

Erlang

Yes, well, I started with my favorite. The strengths of Erlang are:

  • Fault-tolerant: based on actor model and strong isolation with processes. Let you to develop better software for servers.
  • Distributed: let you create processes to distribute the tasks in those processes and even across different servers.
  • Concurrency: the processes has their own mailbox to accept and send to others messages. This way the concurrency is kept is a better way than using semaphores or monitors.

There are more strengths (and even the previous ones could be explained even better I did), but those are enough to keep in mind if you want to develop servers.

Now, we have to search weaknesses. The ones related to Erlang I found:

  • Different syntax: yes, Erlang is different to most of the other languages and most of the people hate it because of that. This actually is not a weakness but too many people consider this a handicap to start using it.
  • Speed in general: this is another issue because of the infrastructure. The I/O is made as a service and the processes are handled by the ErlangVM (BEAM) instead of the operating system.
  • Ecosystem: other languages (even younger languages like JavaScript, Elixir, …) has its own build tool, for example. There are more lacks in the Erlang/OTP ecosystem and the community is still working on that.

And as the last but not least, the paradigm is an hybrid. There are people who says Erlang is functional programming and others who complain about this using other terminology. I think Erlang has a bit of functional programming and much more of actor model if you use OTP.

Go Language

This is other language I was learning not so much time ago. I think the strengths of this language are:

  • Distributed: yes, the use of go-routines let you create cheaper threads/processes (actually coroutines) for parallel and concurrent programming easily.
  • Ecosystem: the compiler is famous for compile most major programs in seconds. And that’s completely true, the compiler is really fast. The build of the environment, dependencies and more is also well designed although a bit confusing at beginning.
  • Native compilation: there are no bytecodes and there are no virtual machine. The result is a binary that could be run in the system and there are no dependencies, it’s portable as an only one file.

The weaknesses of Go language are:

  • Mutability and shared memory: bad combination. Two go-routines could access at the same time to the same content for read/write. This could generate race conditions.
  • Garbage collection: looks like this was a problem mainly in the first version so, it makes not a good choice for soft-real-time developments.
  • Go-routine scheduler: is not enough mature. Looks like the processes spend more time talking between them that doing their work. That means when the number of go-routines and the number of operating system threads rise, the performance is decreased dramatically.

The last answer is a bit difficult because in this case is multi-paradigm as it’s defined in wikipedia. We can do some of object-oriented-programming, concurrency, imperative, logic and functional.

What’s next?

Well, the most important thing I want to say is use the right tool for the right work. Learn a new language shouldn’t be a problem if the learning curve is not too high and the solutions brought for the language are good enough to solve the problem now and in the future.

And about you? What’s the last language your learnt? What’s the language you want to learn in a near future? Did you think about the strengths, weaknesses and paradigm of the languages you are using daily? Leave a comment!

--

--

Manuel Rubio
The Wild Garden

Geek programmer, devops, dad, husband, bass-player, traveler, writer, speeker and human, or I think so.