Which Programming Language is the best one?

Post on 04-Aug-2015

148 views 2 download

Transcript of Which Programming Language is the best one?

Which PL is the best one?

Ricardo Terra

rterrabh [at] gmail.com

Ricardo Terra (rterrabh [at] gmail.com) Which PL is the best one? Outubro, 2014 1 / 29

CV

Nome: Ricardo Terra

Email: rterrabh [at] gmail.com

www: ricardoterra.com.br

Twitter: rterrabh

Lattes: lattes.cnpq.br/ 0162081093970868

Ph.D. (UFMG/UWaterloo),Post-Ph.D. (INRIA/Université Lille 1)

BackgroundEducation: UFLA (since 2014), UFSJ (1 year), FUMEC (3 years), UNIPAC (1 year), FAMINAS (3 years)

Work Experience: DBA Eng. (1 year), Synos (2 years), Stefanini (1 year)

Ricardo Terra (rterrabh [at] gmail.com) Which PL is the best one? Outubro, 2014 2 / 29

Metaphor

Which car is the best one?

Ricardo Terra (rterrabh [at] gmail.com) Which PL is the best one? Outubro, 2014 3 / 29

Metaphor

Which car is the best one?

Ricardo Terra (rterrabh [at] gmail.com) Which PL is the best one? Outubro, 2014 3 / 29

Metaphor

Which car is the best one?

Ricardo Terra (rterrabh [at] gmail.com) Which PL is the best one? Outubro, 2014 3 / 29

Metaphor

Which religion is the best one?

Ricardo Terra (rterrabh [at] gmail.com) Which PL is the best one? Outubro, 2014 4 / 29

Metaphor

Which religion is the best one?

Ricardo Terra (rterrabh [at] gmail.com) Which PL is the best one? Outubro, 2014 4 / 29

Metaphor

Which religion is the best one?

Ricardo Terra (rterrabh [at] gmail.com) Which PL is the best one? Outubro, 2014 4 / 29

Now

Which PL is the best one?

It’s a very trick question!

It’s a very dangerous question!

It’s a very complicated question!

It’s a f###### trick, dangerous, and complicated question!

However, I have the answer! And the question now is:

Are you all ready for the answer?

Ricardo Terra (rterrabh [at] gmail.com) Which PL is the best one? Outubro, 2014 5 / 29

Now

Which PL is the best one?

It’s a very trick question!

It’s a very dangerous question!

It’s a very complicated question!

It’s a f###### trick, dangerous, and complicated question!

However, I have the answer! And the question now is:

Are you all ready for the answer?

Ricardo Terra (rterrabh [at] gmail.com) Which PL is the best one? Outubro, 2014 5 / 29

Now

Which PL is the best one?

It’s a very trick question!

It’s a very dangerous question!

It’s a very complicated question!

It’s a f###### trick, dangerous, and complicated question!

However, I have the answer! And the question now is:

Are you all ready for the answer?

Ricardo Terra (rterrabh [at] gmail.com) Which PL is the best one? Outubro, 2014 5 / 29

Now

Which PL is the best one?

It’s a very trick question!

It’s a very dangerous question!

It’s a very complicated question!

It’s a f###### trick, dangerous, and complicated question!

However, I have the answer! And the question now is:

Are you all ready for the answer?

Ricardo Terra (rterrabh [at] gmail.com) Which PL is the best one? Outubro, 2014 5 / 29

Now

Which PL is the best one?

It’s a very trick question!

It’s a very dangerous question!

It’s a very complicated question!

It’s a f###### trick, dangerous, and complicated question!

However, I have the answer! And the question now is:

Are you all ready for the answer?

Ricardo Terra (rterrabh [at] gmail.com) Which PL is the best one? Outubro, 2014 5 / 29

Now

Which PL is the best one?

It’s a very trick question!

It’s a very dangerous question!

It’s a very complicated question!

It’s a f###### trick, dangerous, and complicated question!

However, I have the answer! And the question now is:

Are you all ready for the answer?

Ricardo Terra (rterrabh [at] gmail.com) Which PL is the best one? Outubro, 2014 5 / 29

Answer

Raul Seixas (Hokari, Raquel, and Ben Hur)

Play

Ricardo Terra (rterrabh [at] gmail.com) Which PL is the best one? Outubro, 2014 6 / 29

Answer

Beatles

Play

Ricardo Terra (rterrabh [at] gmail.com) Which PL is the best one? Outubro, 2014 7 / 29

Unfortunately, C is not the answer!

Unfortunately, C is not the answer!

I have the right answer! And, again, the right question is:

Are you all—indeed—ready for the answer?

Ricardo Terra (rterrabh [at] gmail.com) Which PL is the best one? Outubro, 2014 8 / 29

Unfortunately, C is not the answer!

Unfortunately, C is not the answer!

I have the right answer! And, again, the right question is:

Are you all—indeed—ready for the answer?

Ricardo Terra (rterrabh [at] gmail.com) Which PL is the best one? Outubro, 2014 8 / 29

Answer

I’m just kidding!!! lolololololo...

Definitely, it’s not!

“The compiler won’t let you shoot yourself in the foot!”

Ricardo Terra (rterrabh [at] gmail.com) Which PL is the best one? Outubro, 2014 9 / 29

Answer

I’m just kidding!!! lolololololo...

Definitely, it’s not!

“The compiler won’t let you shoot yourself in the foot!”

Ricardo Terra (rterrabh [at] gmail.com) Which PL is the best one? Outubro, 2014 9 / 29

Answer

I’m just kidding!!! lolololololo...

Definitely, it’s not!

“The compiler won’t let you shoot yourself in the foot!”

Ricardo Terra (rterrabh [at] gmail.com) Which PL is the best one? Outubro, 2014 9 / 29

Now serious

Now serious, which PL is the best one?There isn’t!!!

orIt depends!!!

orThe question is wrong.

(João Vitor Lacerda Guimaraes)

And you think: What the hell are we doing here?

We all are looking for the most appropriate PL!

Ricardo Terra (rterrabh [at] gmail.com) Which PL is the best one? Outubro, 2014 10 / 29

Now serious

Now serious, which PL is the best one?There isn’t!!!

orIt depends!!!

orThe question is wrong.

(João Vitor Lacerda Guimaraes)

And you think: What the hell are we doing here?

We all are looking for the most appropriate PL!

Ricardo Terra (rterrabh [at] gmail.com) Which PL is the best one? Outubro, 2014 10 / 29

Now serious

Now serious, which PL is the best one?There isn’t!!!

orIt depends!!!

orThe question is wrong.

(João Vitor Lacerda Guimaraes)

And you think: What the hell are we doing here?

We all are looking for the most appropriate PL!

Ricardo Terra (rterrabh [at] gmail.com) Which PL is the best one? Outubro, 2014 10 / 29

Top 20 PL

Source: TIOBE, 2014.

Ricardo Terra (rterrabh [at] gmail.com) Which PL is the best one? Outubro, 2014 11 / 29

Top 20 PL

Source: TIOBE, 2014.

Ricardo Terra (rterrabh [at] gmail.com) Which PL is the best one? Outubro, 2014 11 / 29

IHMO

IHMOThe choice of the PL is not everything

Sometimes the problem may be on the developers as well:

Performance (e.g., algorithm)

Scalability (e.g., queries)

Readability (e.g., can’t we write understandable JS code?)

However, characteristics don’t lie:

Costs (e.g., IDEs)

Paradigm (e.g., procedural, OO, etc.)

Portability (e.g., win apps)

Ricardo Terra (rterrabh [at] gmail.com) Which PL is the best one? Outubro, 2014 12 / 29

POG

POG

1st POG: Leap year by Pope (1,582 A.D.)

1,582: Oct/4 (Thursday) → Oct/15 (Friday)

Principles:

“It works, then it’s correct!”

“My Way!”

“Only beginners comment code!”

“Faith in God!”

There are people proud of it! (source: desciclopedia.ws/wiki/POG)

Ricardo Terra (rterrabh [at] gmail.com) Which PL is the best one? Outubro, 2014 13 / 29

POG

POG

1st POG: Leap year by Pope (1,582 A.D.)

1,582: Oct/4 (Thursday) → Oct/15 (Friday)

Principles:

“It works, then it’s correct!”

“My Way!”

“Only beginners comment code!”

“Faith in God!”

There are people proud of it! (source: desciclopedia.ws/wiki/POG)

Ricardo Terra (rterrabh [at] gmail.com) Which PL is the best one? Outubro, 2014 13 / 29

POG

POG

1st POG: Leap year by Pope (1,582 A.D.)

1,582: Oct/4 (Thursday) → Oct/15 (Friday)

Principles:

“It works, then it’s correct!”

“My Way!”

“Only beginners comment code!”

“Faith in God!”

There are people proud of it! (source: desciclopedia.ws/wiki/POG)

Ricardo Terra (rterrabh [at] gmail.com) Which PL is the best one? Outubro, 2014 13 / 29

POG

POG

1st POG: Leap year by Pope (1,582 A.D.)

1,582: Oct/4 (Thursday) → Oct/15 (Friday)

Principles:

“It works, then it’s correct!”

“My Way!”

“Only beginners comment code!”

“Faith in God!”

There are people proud of it! (source: desciclopedia.ws/wiki/POG)

Ricardo Terra (rterrabh [at] gmail.com) Which PL is the best one? Outubro, 2014 13 / 29

POG

POG

1st POG: Leap year by Pope (1,582 A.D.)

1,582: Oct/4 (Thursday) → Oct/15 (Friday)

Principles:

“It works, then it’s correct!”

“My Way!”

“Only beginners comment code!”

“Faith in God!”

There are people proud of it! (source: desciclopedia.ws/wiki/POG)

Ricardo Terra (rterrabh [at] gmail.com) Which PL is the best one? Outubro, 2014 13 / 29

POG

POG

1st POG: Leap year by Pope (1,582 A.D.)

1,582: Oct/4 (Thursday) → Oct/15 (Friday)

Principles:

“It works, then it’s correct!”

“My Way!”

“Only beginners comment code!”

“Faith in God!”

There are people proud of it! (source: desciclopedia.ws/wiki/POG)

Ricardo Terra (rterrabh [at] gmail.com) Which PL is the best one? Outubro, 2014 13 / 29

POG

POG

1st POG: Leap year by Pope (1,582 A.D.)

1,582: Oct/4 (Thursday) → Oct/15 (Friday)

Principles:

“It works, then it’s correct!”

“My Way!”

“Only beginners comment code!”

“Faith in God!”

There are people proud of it! (source: desciclopedia.ws/wiki/POG)

Ricardo Terra (rterrabh [at] gmail.com) Which PL is the best one? Outubro, 2014 13 / 29

Refactoring

Refactoring (Martin Fowler and Joshua Kerievsky)

Extremely used in Agile Methodologies (e.g., XP)

What is Refactoring?Process of changing the code without modifying its externalbehavior

Why?To improve the design and understanding of the code

But why?By continuously improving the design of code, we make iteasier and easier to work with

Ricardo Terra (rterrabh [at] gmail.com) Which PL is the best one? Outubro, 2014 14 / 29

Developers: Style

Ricardo Terra (rterrabh [at] gmail.com) Which PL is the best one? Outubro, 2014 15 / 29

Developers: Indentation

Ricardo Terra (rterrabh [at] gmail.com) Which PL is the best one? Outubro, 2014 16 / 29

Developers: Suffering

Hug a Developer Today!

Play

Ricardo Terra (rterrabh [at] gmail.com) Which PL is the best one? Outubro, 2014 17 / 29

PLs

Let’s take into consideration some popular PLs:

C / C++ (1st /4th)

Java (2nd )

C# and (Visual) Basic (5th/6th)

Objective-C (3rd )

PHP (7th)

Ruby (16th)

Ricardo Terra (rterrabh [at] gmail.com) Which PL is the best one? Outubro, 2014 18 / 29

C

CAlmost half-century of existence (1969)

Used by virtually all Operating Systems (and Windows)

UNIX (Recoded to C in 1973)

“You shoot yourself in the foot.” (programmers to programmers)

Why? Low-level

Pointers, DMA, etc.

It’s not portable! It’s true, but not 100% true

F###### fast! (this is why games are developed on it!)

“If you do something easily in C, probably it’s wrong.” (me)

PS: C++ is a superset of C (OO joke: Why don’t C++ talk to C?)

Ricardo Terra (rterrabh [at] gmail.com) Which PL is the best one? Outubro, 2014 19 / 29

Java

JavaVery popular (huge community, several frameworks...)

Free (on the other hand...)

IDEs and compilers

Massively used

All Android Apps

Corporate systems

Problems solved? (do you consider it good?)

Automatic memory management and no pointers anymore

It’s portable!

Fast! (Improved a lot in the last 5 years, e.g., JIT)

Ricardo Terra (rterrabh [at] gmail.com) Which PL is the best one? Outubro, 2014 20 / 29

C# and (Visual) Basic

C# and (Visual) Basic – .Net PlatformGreat IDE

Definitely not cheap! (point to others)

High productivity (~8h/fp, in contrast to 11h/fp in Java)

Only runs in Windows [bad bad thing, but it might not be a problem (e.g., mono, wine)]

Good performance, scalability!

How to double the productivity of a .Net programmer? (joke)

Ricardo Terra (rterrabh [at] gmail.com) Which PL is the best one? Outubro, 2014 21 / 29

Objective-C

Objective-CSmalltalk-style messaging added to C

Main language used by Apple (OS X and iOS)

And about Swift? (“Objective-C without the C”)

All iPhone Apps (C or C++, as well)

Relevant features:

Weak and dynamic typing (people usually like, why?)

GC (the use is up to you!)

Generic Objective-C (no cocoa) → supported by GCC

Ricardo Terra (rterrabh [at] gmail.com) Which PL is the best one? Outubro, 2014 22 / 29

PHP

PHPEverything free!!! (IDE, Compiler, Server, perhaps even developers...)

Popular (huge community, default for web hosting...)

Wiki, Joomla, WordPress, Facebook...

High productivity (such an easy language)

Weak and dynamic typing

People criticize performance and scalability

Facebook (the most accessed website ever)

How to double the number of PHP programmers? (joke)

Ricardo Terra (rterrabh [at] gmail.com) Which PL is the best one? Outubro, 2014 23 / 29

JS

“==” ou “===”?

Ricardo Terra (rterrabh [at] gmail.com) Which PL is the best one? Outubro, 2014 24 / 29

Ruby

RubyRuby versus Rails! (do u know the difference?)

Popular after Rails (why?)

Inspired by Perl and Python (scripting languages)

“I wanted a scripting language that was more powerful thanPerl, and more object-oriented than Python.” (Matz)

Very complete and up-to-date!

OO, functional, imperative...

GC, closures, lambda, dynamic typing (but strong)...

Major frustration: Twitter (Ruby on Rails → Scala)

Ricardo Terra (rterrabh [at] gmail.com) Which PL is the best one? Outubro, 2014 25 / 29

Some of my insights

Some of my insights1 I don’t want to pay for resources → get out .Net platform

2 I want to develop mobile apps → Java, Objective-C

3 I’m agile → Ruby, PHP, Python...

4 I want to develop games → C

5 I love OO → .Net platform, Java, C++

6 I’m in doubt about PHP or Ruby →

7 I’m going to develop a huge system → Java, .Net platform

8 I want to be rich → forget about PHP

Ricardo Terra (rterrabh [at] gmail.com) Which PL is the best one? Outubro, 2014 26 / 29

Some of my insights

Some of my insights1 I don’t want to pay for resources → get out .Net platform

2 I want to develop mobile apps → Java, Objective-C

3 I’m agile → Ruby, PHP, Python...

4 I want to develop games → C

5 I love OO → .Net platform, Java, C++

6 I’m in doubt about PHP or Ruby →

7 I’m going to develop a huge system → Java, .Net platform

8 I want to be rich → forget about PHP

Ricardo Terra (rterrabh [at] gmail.com) Which PL is the best one? Outubro, 2014 26 / 29

Some of my insights

Some of my insights1 I don’t want to pay for resources → get out .Net platform

2 I want to develop mobile apps → Java, Objective-C

3 I’m agile → Ruby, PHP, Python...

4 I want to develop games → C

5 I love OO → .Net platform, Java, C++

6 I’m in doubt about PHP or Ruby →

7 I’m going to develop a huge system → Java, .Net platform

8 I want to be rich → forget about PHP

Ricardo Terra (rterrabh [at] gmail.com) Which PL is the best one? Outubro, 2014 26 / 29

Some of my insights

Some of my insights1 I don’t want to pay for resources → get out .Net platform

2 I want to develop mobile apps → Java, Objective-C

3 I’m agile → Ruby, PHP, Python...

4 I want to develop games → C

5 I love OO → .Net platform, Java, C++

6 I’m in doubt about PHP or Ruby →

7 I’m going to develop a huge system → Java, .Net platform

8 I want to be rich → forget about PHP

Ricardo Terra (rterrabh [at] gmail.com) Which PL is the best one? Outubro, 2014 26 / 29

Some of my insights

Some of my insights1 I don’t want to pay for resources → get out .Net platform

2 I want to develop mobile apps → Java, Objective-C

3 I’m agile → Ruby, PHP, Python...

4 I want to develop games → C

5 I love OO → .Net platform, Java, C++

6 I’m in doubt about PHP or Ruby →

7 I’m going to develop a huge system → Java, .Net platform

8 I want to be rich → forget about PHP

Ricardo Terra (rterrabh [at] gmail.com) Which PL is the best one? Outubro, 2014 26 / 29

Some of my insights

Some of my insights1 I don’t want to pay for resources → get out .Net platform

2 I want to develop mobile apps → Java, Objective-C

3 I’m agile → Ruby, PHP, Python...

4 I want to develop games → C

5 I love OO → .Net platform, Java, C++

6 I’m in doubt about PHP or Ruby →

7 I’m going to develop a huge system → Java, .Net platform

8 I want to be rich → forget about PHP

Ricardo Terra (rterrabh [at] gmail.com) Which PL is the best one? Outubro, 2014 26 / 29

Some of my insights

Some of my insights1 I don’t want to pay for resources → get out .Net platform

2 I want to develop mobile apps → Java, Objective-C

3 I’m agile → Ruby, PHP, Python...

4 I want to develop games → C

5 I love OO → .Net platform, Java, C++

6 I’m in doubt about PHP or Ruby → fear right now....

7 I’m going to develop a huge system → Java, .Net platform

8 I want to be rich → forget about PHP

Ricardo Terra (rterrabh [at] gmail.com) Which PL is the best one? Outubro, 2014 26 / 29

Some of my insights

Some of my insights1 I don’t want to pay for resources → get out .Net platform

2 I want to develop mobile apps → Java, Objective-C

3 I’m agile → Ruby, PHP, Python...

4 I want to develop games → C

5 I love OO → .Net platform, Java, C++

6 I’m in doubt about PHP or Ruby → fear right now.... Ruby (IMHO)

7 I’m going to develop a huge system → Java, .Net platform

8 I want to be rich → forget about PHP

Ricardo Terra (rterrabh [at] gmail.com) Which PL is the best one? Outubro, 2014 26 / 29

Some of my insights

Some of my insights1 I don’t want to pay for resources → get out .Net platform

2 I want to develop mobile apps → Java, Objective-C

3 I’m agile → Ruby, PHP, Python...

4 I want to develop games → C

5 I love OO → .Net platform, Java, C++

6 I’m in doubt about PHP or Ruby → fear right now.... Ruby (IMHO)

7 I’m going to develop a huge system → Java, .Net platform

8 I want to be rich → forget about PHP

Ricardo Terra (rterrabh [at] gmail.com) Which PL is the best one? Outubro, 2014 26 / 29

Some of my insights

Some of my insights1 I don’t want to pay for resources → get out .Net platform

2 I want to develop mobile apps → Java, Objective-C

3 I’m agile → Ruby, PHP, Python...

4 I want to develop games → C

5 I love OO → .Net platform, Java, C++

6 I’m in doubt about PHP or Ruby → fear right now.... Ruby (IMHO)

7 I’m going to develop a huge system → Java, .Net platform

8 I want to be rich → forget about PHP

Ricardo Terra (rterrabh [at] gmail.com) Which PL is the best one? Outubro, 2014 26 / 29

Wrap-up

“If there wasn’t C, we’d be programming in Obol, Pasal...”(did u get it?)

“Any fool can write code that a computer can understand.Good programmers write code that humans can understand.”

(Martin Fowler)

“Good programmers write good code,no matter the PL they use.”

(me)

Please don’t hate (or kill) me.(me)

Ricardo Terra (rterrabh [at] gmail.com) Which PL is the best one? Outubro, 2014 27 / 29

Wrap-up

“If there wasn’t C, we’d be programming in Obol, Pasal...”(did u get it?)

“Any fool can write code that a computer can understand.Good programmers write code that humans can understand.”

(Martin Fowler)

“Good programmers write good code,no matter the PL they use.”

(me)

Please don’t hate (or kill) me.(me)

Ricardo Terra (rterrabh [at] gmail.com) Which PL is the best one? Outubro, 2014 27 / 29

Wrap-up

“If there wasn’t C, we’d be programming in Obol, Pasal...”(did u get it?)

“Any fool can write code that a computer can understand.Good programmers write code that humans can understand.”

(Martin Fowler)

“Good programmers write good code,no matter the PL they use.”

(me)

Please don’t hate (or kill) me.(me)

Ricardo Terra (rterrabh [at] gmail.com) Which PL is the best one? Outubro, 2014 27 / 29

Wrap-up

“If there wasn’t C, we’d be programming in Obol, Pasal...”(did u get it?)

“Any fool can write code that a computer can understand.Good programmers write code that humans can understand.”

(Martin Fowler)

“Good programmers write good code,no matter the PL they use.”

(me)

Please don’t hate (or kill) me.(me)

Ricardo Terra (rterrabh [at] gmail.com) Which PL is the best one? Outubro, 2014 27 / 29

Additional Material

Ricardo Terra (rterrabh [at] gmail.com) Which PL is the best one? Outubro, 2014 28 / 29

Source: ISBSG, 2012.

Thanks!!!

Ricardo Terra (rterrabh [at] gmail.com) Which PL is the best one? Outubro, 2014 29 / 29