Vous êtes sur la page 1sur 14

6/13/2016

8 Considerations on Choosing a Programming Language

Call Us: +1 347 705-7151

Scala Academy | Blog

8 Considerations on
Choosing a Programming
Language
A %100 Opinionated View on Choosing Your
Next/First Progamming Language
TL;DR: Scala :-)

Facebook

16

Twitter

http://www.scala-academy.com/blog/8-considerations-on-choosing-a-programming-language

Google+

1/14

6/13/2016

8 Considerations on Choosing a Programming Language

1. Choosing a language takes knowledge


So you want to learn a new programming language.
You may already know a language or you may be looking to learn your rst one in any case, choosing the next language to invest your time in is not an easy task.
Basically, to choose a language you should have the 10000 foot view which takes
some years to get. In this article I'll give you my 2 cents to help you make a good
choice (I've been programming for more than 10 years now).

2. Warning: The herd is not always right!

I don't know about other areas but, in IT:


If an idea looks terrible, but everyone says it's great, it probably IS really
terrible!
Please get convinced.
- "But - how can those many programmers be so wrong?!"
I don't know, I don't care, but they are. Times and times again.
This is a really really important thing to remember.
Now, let's move on to actual programming languages.

http://www.scala-academy.com/blog/8-considerations-on-choosing-a-programming-language

2/14

6/13/2016

8 Considerations on Choosing a Programming Language

3. Non-Sense (languages)
(lots of it! - maybe skip this one if you have already experience)

Proving my last point, there are lots of recruitment gurus, internet articles,
and such, telling you about supposed "programming languages" you should
learn which make no sense at all.
So, here we go:
HTML
Man. That's not even like, a "programming language"! (in the usual sense) You
write web pages with HTML - your don't create an accounting system with HTML.
You can't say "if the user is logged in do X otherwise do Y". HTML organizes the
position of elements in the page, etc. Of course you need to know HTML in the
beginning of the XXI century, but this is not your "language", whatever language
you choose you will need to know at least a little of HTML.
CSS
The same. This is used to style HTML. Like setting the font size, colors, and such.
Again, you will need to know some CSS. When you learn CSS, you'll want to use
SASS (#protip).
XML
Nonsense - again. This is used to do endless things in IT. Not "programming".
Not creating accounting systems and such. This is like a le format, often used
for con gurations. (You may nd references to "XSLT" also, google it if you want
but, again, you don't create accounting systems in XSLT.)
SQL
Again. This one is for you to interface with databases. If you're a XXI century
developer on planet earth, you should learn SQL whatever language you choose.
But it isn't a "language" for you to choose.
MATLAB, R
This is academic/engineering/mathematics stu . For equations, matrices, and
such. You don't build accounting systems with these things. (Of course someone
must have already done it!)
Assembly
This is what you programmed computers with in 1970. Not even your modern
dishwasher uses assembly anymore (probably it uses C). Normal programmers
http://www.scala-academy.com/blog/8-considerations-on-choosing-a-programming-language

3/14

6/13/2016

8 Considerations on Choosing a Programming Language

never use assembly. It's like 0's and 1's. Think: green Matrix movie raining letters.
Fortran
Fortran appeared in 1957. The name is derived from "Formula Translating
System". "Stone age" anyone?
Arduino
But whyyy?!.. So, ok, this is like for you to play with soldering hardware gadgets,
and turning LED lights on an o , and play with wires and breadboards on
weekends, not getting IT jobs.
Shell
The list goes on... You totally need to learn Shell. This is like the black screen with
the white letters you see people on movies doing complicated stu in (yes, like
Neo hacking stu on Matrix). Shell is like the "desktop/navigator" on your
windows. You can open programs, list les, open directories - but: all on that
funny command line interface. You should learn this, but you don't apply for a
"shell" job (it's like worst that saying you know how to type in "MS Word").
VHDL
You can use this to design new processors and compete with Intel and AMD.
Otherwise you may move on.
Processing
If you are an artist or a visual designer you may be interested. The rest of us can
move on.
SAS
This is for statistical analysis. Not something you'd build an accounting system
with.
Ok, so now we are left with:
Java | C | C++ | C# | Python | JavaScript | PHP | Ruby | Perl | Visual Basic |
Objective-C | Scala | Go | D | ASP.NET | Lua | Haskell | Lisp
Don't worry - we'll cut down on that list quite fast!

4. Fundamental di erence: Static vs Dynamic


Typing
http://www.scala-academy.com/blog/8-considerations-on-choosing-a-programming-language

4/14

6/13/2016

8 Considerations on Choosing a Programming Language

This is fundamental.
Consider this program (this is Scala):
case class Cat(name: String)
case class Dog(size: Double)
object Main {
def feedTheCat(cat: Cat) {
println("Feeding the cat " + cat.name)
}
def main(args: Array[String]) {
feedTheCat(new Dog(12.3))
}
}

Do you see a bug??


We have a Cat and a Dog.
We have a method "feedTheCat" which receives a Cat and we are passing a Dog!
This is a...: Bug!
Now, in a statically typed language, the "compiler" will tell you (in this case this
is from the Scala compiler):
<console>:17: error: type mismatch;
found : Dog
required: Cat
feedTheCat(new Dog(12.3))
http://www.scala-academy.com/blog/8-considerations-on-choosing-a-programming-language

5/14

6/13/2016

8 Considerations on Choosing a Programming Language

And in a dynamically typed language, the "interpreter" or "compiler" will tell


you:

<The Sound of Silence>

Nothing. Rien. Nada. Intet. Nichts. Niente!


So, will the program work?
Of course not! It will crash when the piece of code with the error runs, i.e.: when
the user clicks some button, accesses some menu, etc which has the bug.
- "So, you mean there may be countless errors like this laying around?, just waiting
for the right button/combination of options to be clicked/selected/etc??"
Yes!
- "Don't they have a solution for this??"
Yes: create more code ("tests"), which will use the existing code (kind of try to
simulate a user) and see if it crashes.
- "But doesn't a statically typed language nd these bugs without us having to create
these tests?"
Again - yeees! (but notice that it still may make sense to have tests for other
things other than type problems)
Now: This was a really simple program. Can you imagine a 20.000 lines of code
program? A 1.000.000 lines of code program? A program with 10 years of
development, created by some team which is not available to ask questions
anymore??
- "But that sounds terrible indeed! But surely this can't be so bad, otherwise, why
would people use dynamic languages? They must know what they're doing for sure!"
Err.. Please re-read point #2.
So, with this we rule out the following languages:
drums...
Python | JavaScript | PHP | Ruby | Perl | Fortran | Lua | Lisp
http://www.scala-academy.com/blog/8-considerations-on-choosing-a-programming-language

6/14

6/13/2016

8 Considerations on Choosing a Programming Language

(Yes, we rule JavaScript out! - But, hey, you'll surely need to know some Javascript
(it makes the web pages interactive), just like HTML, CSS, SQL, or Shell, but do try
to run from implementing thousands of lines of Javascript in your app!)

5. The Static Languages


Now we'll go through some static languages:
C Language
This one is really old and primitive. Like, you program washing machines with
this.
C++ Language
C++ is... "a giant mess of a language".
Go
Go is a relatively new language by Google (Warn: yes, Google is great, it is, but
that doesn't mean everything coming from them is great. Go in particular.). It is
kind of low-level - think "upgraded C, without the C++ mess". (Some say it
intends to... replace C)
D
Yet another C replacement. And this one has been around since 2001 and hasn't
"picked up".
Objective-C
Objective-C is to build apps for iOS, Macs, and so. If this is what you want to do,
learn Objective-C (or - much better - learn its replacement: Swift).
Haskell
Haskell is a long standing (since 1990), kind of academic, hard-core programming
language. If you want to be a really hard-code programmer, learn it. If you want
a job, learn other language. Here's a comparison of Scala and Haskell jobs:

http://www.scala-academy.com/blog/8-considerations-on-choosing-a-programming-language

7/14

6/13/2016

8 Considerations on Choosing a Programming Language

So, generally, you are advised to stay away from any of these aforementioned
languages.
Of course: if you want to create real-world, modern, e cient, maintainable code,
and/or get a good job as a developer. If you want to play around a bit in
weekends or get a job maintaining 20 years old enterprise code, be my guest.
You have been warned! :-)

6. Microsoft-Landia!
ASP.NET, C#, Visual Basic, F#, etc

In Microsoft-Landia, anywhere you go you are tied to Microsoft:


If you create a cloud server, you need to buy a license from MS;
If your team grows, you need to buy a Visual Studio license;
Visual Studio runs in Windows only, so you must have Windows;
If use SQL, you'll probably need to buy an SQL Server license;
http://www.scala-academy.com/blog/8-considerations-on-choosing-a-programming-language

8/14

6/13/2016

8 Considerations on Choosing a Programming Language

Etc, etc, etc.


If you're totally ne with this, go ahead and explore Microsoft-Landia!
The rest of us can move on...

7. Java
Java is a great language. It is an improvement on C and C++, but it is extremely
simple and concise (at least until Java 7). It used to be quite cumbersome, but it
improved a lot in Java 8 with lambda expressions, improved collections etc. It'd
risk to say that 1/3 of all the world's programmers know Java, it is also super fast,
super well supported, has tons of existing libraries (many of them open source),
is completely free (of cost, of licensing, etc), runs on all operative systems, and
has Oracle backing it (so shouldn't be dying anytime soon).
Java developers are widely available, it has countless development tools, books,
best practices, courses, widespread know-how, existing libraries for everything,
etc.
So, Java is generally a safe bet, mostly because of its ecosystem. The language
itself is generally ok - but Scala is a much better language (with a generally ok
ecosystem).

8. Scala
Ahh..., Scala! - the best thing ever! :-)
So, Scala runs on the same JVM as Java, so: same Oracle support, same Oracle
maintenance, same JVM performance, same multi-operative system support,
same free licensing, most of the Java development tools also support Scala, and
you can use all Java code/libraries from Scala.
Now: is the Scala language better than the Java language?
Yes! - In 1000 little (and great) things: implicits, underscore notation, exible
imports, multiple classes per le, multi-line strings, pattern matching, traits with
variables, etc. Try it for 6 months and you'll see the di erence, or see the blog
posts of who has tried it before (including me :-) ).
http://www.scala-academy.com/blog/8-considerations-on-choosing-a-programming-language

9/14

6/13/2016

8 Considerations on Choosing a Programming Language

- Does this mean that I should use Scala?


Can you get a job you like programming Scala? If so, then: yes!
(Otherwise, unless you're rich, you need to pay your bills...)
In any case, the chances of nding a job coding Scala look quite good - here are
the job trends for Scala:

The only point I'd like to notice against Scala is that it isn't developed and
maintained by a giant like Oracle, but by a rather small company called Typesafe
- so the chances of Typesafe disappearing are greater than the ones of Oracle
disappearing.
Even so, there is enough Scala code already around the world to guarantee the
language won't simply disappear overnight. Also, IMHO, programming in Scala
it's totally worth taking this small risk.

Facebook

16

Twitter

Google+

Appendix: Some companies using Scala


Here are some companies using Scala in production:

http://www.scala-academy.com/blog/8-considerations-on-choosing-a-programming-language

10/14

6/13/2016

8 Considerations on Choosing a Programming Language

Regarding comments: if possible, please do try to refrain from "Well,


Actuallying" this post.

9 Comments
Recommend

Scala Academy

Share

http://www.scala-academy.com/blog/8-considerations-on-choosing-a-programming-language

Login

Sort by Best
11/14

6/13/2016

8 Considerations on Choosing a Programming Language

Join the discussion


Fea Agar

a year ago

From a site called scala-academy no surprise that the conclusion is Scala.


Honestly, I still don't get why rule out all of the dynamic languages, and if it's about getting
jobs... Well: http://www.indeed.com/jobtrend...
2

Reply Share

David Antunes

Mod > Fea Agar a year ago

Well, if the more jobs the better, you should code Java : ) http://www.indeed.com/jobtrend...
I didn't say Scala has many jobs, I even said that if you can't get a job programming
Scala (because of your location, or other reason) either you're rich, or don't spend
your time learning Scala. But the chances of having a Scala job available near you
are increasing by the month indeed!

Reply Share

Fea Agar > David Antunes

a year ago

Yeah Java is the greater indeed no argues about that, but I still don't really
understand the argument for leaving out all dynamic languages in the
analysis.
The main reason proposed is because of debugging, because dynamic
languages don't provide errors pre-compiling time.
And when a somewhat "reasonable" question is asked: "Well this can't be so
bad..." the only reference given is "The herd isn't always right". Like dynamic
languages were invented "just because" and people that use them do it only
because "everybody does"... !!!
It's totally understandable to propose that compiled languages are better, I
just think you could've given a bit more logic on "why dynamic languages are
not so good", but again, coming from a site called scala-academy I think its
ok to come to that conclusion without any decent attempt.
I don't wanna start a holy war about dynamic vs compiled languages, I just
scratch my head about the arguments for ruling out dynamic ones.


Tim Locke

Reply Share

a year ago

I've been programming for over 30 years and I disagree with you.
Also, most of these arguments are obviously biased. Come back when you can be
unbiased.

Reply Share

David Antunes

Mod > Tim Locke a year ago

Yep, I don't think the community will ever reach an agreement, there will be always

http://www.scala-academy.com/blog/8-considerations-on-choosing-a-programming-language

12/14

6/13/2016

8 Considerations on Choosing a Programming Language

Yep, I don't think the community will ever reach an agreement, there will be always
diverging opinions, which is why this is "A %100 Opinionated View" as per the
subtitle : )


Vance Feld

Reply Share

a year ago

Languages come and go. I've got more on my resume than the initial list. I delete the ones
o the list that get me boring jobs.
Reply Share

Ondrej Nekola

a year ago

Start with language for learning, than go to language for working. Nobody starts piloting
with buying a brand new F-15.
Take some simple language, preferably with REPL and with some good tutorials. Python,
Haskell, Scheme (and probably Processing and many other languages) would work. All of
them are practical enough to solve some "real life" problems but have fast enough feedback
to keep learning fun.
For beginners optimize for fun and make sure, that they can quickly solve something, they
consider worth solving (if they have some lab result, just start iPython notebook and let
them analyze them).
Reply Share


Rusco

a year ago

"In 1000 little (and great) things" : That's the Problem, Scala is too powerful for "Joe the
programmer" and more suited to academics than industry, Golang is much better in this
regard. First crowds of PhD's at EPFL Lausanne work hard in putting several new things into

SUBSCRIBE
Subscribe to the Scala Academy's newsletter to receive tutorials, articles, news,
events, jobs of the Scala ecosystem!
Usually twice per month.
Your best email

Subscribe

You can unsubscribe at any time. Your address will never be shared with other companies.

CONTACT US
Skype: scalaacademy
Call: +1 347 705-7151
http://www.scala-academy.com/blog/8-considerations-on-choosing-a-programming-language

13/14

6/13/2016

8 Considerations on Choosing a Programming Language

Email: info@scala-academy.com
Privacy Policy

SAY HEY

Name

Email

Message

Send

http://www.scala-academy.com/blog/8-considerations-on-choosing-a-programming-language

14/14

Vous aimerez peut-être aussi