Krista's Coding Corner

06.05.2012

Use the right tool

It seems that we have "fashion languages". What I mean with this is: some languages are more popular and wanted than others without justification. Okay, new languages may be (and hopefully are) better than the old ones, why else develop the new ones?

But in some cases people seem to be too trendy as they want to use a language not suited to their case. And I haven't yet figured why they then want to use the specific languages as there is no reasonable and logical basis on the choice. Except fashion.

Although I do think that if you start learning programming, there is no right answer on choosing your language as the most important thing is to learn the logic behind the code. But I would still advice to always choose the right tool (==language) if doing real programs. Or would you use a saw to hammer nails?

Now, we have these low level languages and more high level languages. Low level languages are harder to write but they are always faster as you have more control on what you actually do. Bit same as with cars: there are manual and automatic gears. Manual gear cars mostly consume less gas than automatic gear cars and with manual gear you have more control on your driving (unless you are a sucky driver ;) ). Of course automatic gears are getting better all the time but if you know what you are doing manual is still the way to go.

Like with code: if you know at all what you are doing, low level languages are far better if we want speed and power. But if you don't need those features, higher level languages are of course always easier to write :)

For example:

I like using Python if I want to do something fast but it doesn't have to be too efficient. And Ruby is really similar to Python :)

C/C++ are normally used when we need really good efficiency and high speed or we need to get in touch with computer's hardware directly.

Assembler, the lowest level, this could be the Holy Grail of programming something fast if it wasn't so damn difficult. So, no-one really writes this (mostly someone can check what the code does by looking at these files) and compilers do nowadays this code better than humans.

ADA is the language when something has to be bullet proof. Satellites and nuclear weapons use this. (By the way, worlds first programmer was a woman: Ada Lovelace <3 ).

Erlang is used when we need to do massively parallel programs. Phone centers are full of Erlang and the language was originally developed at Ericsson.

Java is used..hmm.. on everything (especially on enterprise applications) but it uses a lot of memory. On the positive side: it works on every platform (except some smaller microcontrollers).

COBOL is used in banking, finance and administrative systems. Why? Because it has always existed and banking world is really conservative. This is one of the first programming languages. And this language is really close to written English -> even the bank-people could read it and check that the programmers don't do anything funny ;)

JavaScript, has nothing to do with Java, and the name is for marketing purposes only. It is used mainly for web applications because browsers support it. And browsers support it because it was the first language to be embedded to a webpage. This is invented by Netscape to make webpages more dynamic.

PHP is used with websites, it is designed to get normal programming into webpages. (Not sure if the design works that perfectly though).

And then there are those languages that are no good in any situation: Visual Basic (unfortunately, sometimes you have no other choice than using them as some programs don't support anything else them...).

Commit log

- 07.05.2011 Fixed some typos

blog comments powered by Disqus