“It’s my programming language!” Please, learn another more
Maybe I’m a bit recurrent with this kind of topics, but I think using the right tool in the right place is a must that any programmer should use. Anyway, the most of the programmers are very comfortable with only one (or two at most) of language(s) and they won’t going to learn/using a new one. Why not? Are you not interested in the advantages?
Learning a new programming language is a hard task. I know. You think that it should be only related to the syntax, but later, you realize you have to understand the paradigm, the ecosystem and the way all of the community is doing things there with that language. Sometimes is hard. But when you are doing your first steps and you see that everything is working, at last, it’s amazing!
But the most important thing is…
Why should you learn a new programming language?
Well, in the counterpart, why not? … really, learn a new language provide you another way to think about the problems to be solved using different tools. Not all of the languages can solve the same problems in the same way. Depends on the paradigm, the idioms and the strengths and weaknesses they have. And if you are too accustomed to your programming language, maybe you are doing something inefficiently without realize about that.
For example. If you are using LAMP, your are using actually three programming languages. Well, depends on if they relay more or less in JavaScript but, essentially they use PHP, SQL and JavaScript.
If you think about things you can solve using PHP and things you can solve using SQL, you realize those languages are completely different, and sometimes you are more comfortable solving the problem in the SQL part, and sometimes the problem is better to solve it in the PHP part.
In the same way, ActiveRecord, SQLAlchemy and Hibernate try to port SQL to be more linked to the language you are using but, internally, you’re still using SQL thru the ActiveRecord nomenclature.
What languages could be interesting to learn?
Good question. At this moment depends on your business and motivation. Of course. Sometimes the most used languages to use are some related to the environment or the business you are in. For example, use R language for improve the statistics functions or mathematical improvements in an easy way. I’ll comment some curious and useful languages for learning.
Elm: functional approach in the browser
Yes, if you are bored about the use of plain JavaScript and some other solutions are not good enough for you (like CoffeScript, for example), you can try Elm. This language let you to use the functional approach for the front-end development. And as always, the advantages (or strengths) are:
- Faster than other frameworks, yes, unlike the use of Ember, React, Angular, … Elm is faster.
- Secure, it’s designed to fail in compilation phase instead of runtime. Great feature for avoid production issues in our websites.
- Functional approach, well, this is arguable whether it could be an advantage, but the design, performance and security is achieved thanks to this.
Well, and now the trade-offs:
- It’s a completely new language to learn. And I’m afraid that’s not a curly braced one.
- The integration with existent JavaScript libraries you’ll need in your project is not easy.
- Debugging is sometimes hard if you need to do it.
So, if you are starting a new project from scratch and you have a clear idea to use only what you want to create (don’t worry because elm has a package manager and everyday there are new packages to check and try), this is a good election.
However, if you want to continue an old project and change suddenly all of that code, with a lot of JS libraries, to Elm… maybe that’s not a good idea at all.
Rust: low level in a secure way
A lot of people currently is still working at low level. Maybe with code that should be using C or C++, or other languages because that code should handle the kernel, or it’s a driver, or an extension for other language that should be developed in C.
Well, that’s not a problem now. There are some languages based on C, but keeping all of their head-aches out. One of them is Rust. Their advantages are:
- Secure for your code, this language was designed to avoid the uncomfortable SIGSEG (or segementation fault) error that’s very frequent when you are handling pointers.
- Secure for your memory, in the same way, the language has its own implementation for memory handle. It’s a good way to avoid memory leaks.
- Expressiveness, yes, Rust has 7 control flow structures (Erlang has only 2, C has 5, PHP has 6).
The disadvantages, maybe we could say some of them are:
- This is a language for seniors. Too complicated to be your first language and you have to spend enough time to understand it and do the things in the right way.
- The language is too explicit. This gives you more to write than in other explicit languages.
I didn’t find other trade-offs, but I think those are good enough to considerate if you want to follow that path. I think the advantages are good enough to try it at least.
Julia: performance at maximum
This language was designed to have optimized algorithms than ever. For scientists that is very important because, do the things in languages with not good performance drove them to do the same, again, in a low-level language to improve the performance level.
Julia came into scene to avoid this double work for them. And we can take advantage of that to use it for other tasks as well. Think about it. You have a lot of calculations to be performed, the most of them a bit complex using a set of data. Maybe you achieve to sorted out this using a lot of external libraries, but not with a good performance, even you’ll need to be days or even months refactoring the code to try to speed up your solution.
If you want a very good calculator or embed in your code a really good system to perform calculations, Julia is a very good option to keep in mind. But, we can see its strengths:
- Fast and optimized algorithms to use. The creators implemented the most common algorithms in the optimized way, you shouldn’t worry about the performance.
- A good set of math library. It’s full of mathematical functions ideal for physics, maths, statistics, and more related topics.
- Easy and short language, fast to learn. The syntax is pretty simple, of course is not similar to C, but it’s confortable for scientists.
And related to trade-offs, well, they are some of them to keep in mind. For example:
- Not a general purpose language. This means this language shouldn’t be used to develop a general purpose application and that limits the adopters and the size of the community.
- Hard to avoid bugs (similar to C language). Some other languages have compiler checks or another kind of tools to detect some error types… Julia hasn’t them at this moment. It’s easy to get an wrong implementation and sometimes difficult to trace it.
I found this language very useful and elegant to solve some problems. Mainly those related to data processing. It’s worth to learn it.
Concluding…
I think there are a lot of languages (and more coming soon) which are good for some specific tools. If we think about our business problems, divide them and isolate them, we can find some of them could be solved using Julia (if they are related to maths/stats, even data mining), or maybe Rust (if they are related to a low-level implementation and we want to avoid the C normal issues), or maybe Elm (if we want to develop in the browser or on top of JavaScript in a different paradigm).
And they are other languages to help us in other ways:
- Go (or Golang) with the approach of fast compiling,
- Pony aiming to a high performance actor model system,
- Lua for a very fast, simple and embeddable language for your system,
- Idris for a pure functional and dependant types language,
- …
Which languages are you using daily? Which ones could you consider rare? Are you thinking on use a new one? Maybe listed above? Leave us a comment!