scratch/output/Scratch/en/blog/programming-language-experience/index.html
Yann Esposito (Yogsototh) 5239ac9b06 Merge remote-tracking branch 'origin/master' into next
Conflicts:
	output/Scratch/sitemap.xml
2011-10-04 14:16:58 +02:00

583 lines
No EOL
26 KiB
HTML

<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="fr" xml:lang="fr">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<link rel="shortcut icon" type="image/x-icon" href="/Scratch/img/favicon.ico" />
<link rel="stylesheet" type="text/css" href="/Scratch/assets/css/main.css" />
<link rel="stylesheet" type="text/css" href="/Scratch/css/twilight.css" />
<link rel="stylesheet" type="text/css" href="/Scratch/css/idc.css" />
<link rel="alternate" type="application/rss+xml" title="RSS" href="http://feeds.feedburner.com/yannespositocomen"/>
<link rel="alternate" lang="fr" xml:lang="fr" title="Mon expérience avec les languages de programmation" type="text/html" hreflang="fr" href="/Scratch/fr/blog/programming-language-experience/" />
<link rel="alternate" lang="en" xml:lang="en" title="Programming Language Experience" type="text/html" hreflang="en" href="/Scratch/en/blog/programming-language-experience/" />
<script type="text/javascript" src="/Scratch/js/jquery-1.3.1.min.js"></script>
<script type="text/javascript" src="/Scratch/js/jquery.cookie.js"></script>
<script type="text/javascript" src="/Scratch/js/index.js"></script>
<!--[if lt IE 9]>
<script src="http://ie7-js.googlecode.com/svn/version/2.1(beta4)/IE9.js"></script>
<![endif]-->
<!-- < % if containMaths %>
<script type="text/javascript" src="/Scratch/js/MathJax/MathJax.js"></script>
< % end %>
-->
<title>Programming Language Experience</title>
</head>
<body lang="en">
<script type="text/javascript">// <![CDATA[
document.write('<div id="blackpage"><img src="/Scratch/img/loading.gif" alt="loading..."/></div>');
// ]]>
</script>
<div id="content">
<div id="choix">
<div class="return"><a href="#entete">&darr; Menu &darr;</a></div>
<div id="choixlang">
<a href="/Scratch/fr/blog/programming-language-experience/" onclick="setLanguage('fr')">en Français</a>
</div>
<div class="flush"></div>
</div>
<div id="titre">
<h1>
Programming Language Experience
</h1>
</div>
<div class="flush"></div>
<div class="flush"></div>
<div id="afterheader">
<div class="corps">
<p><img alt="Title image" src="/Scratch/img/blog/programming-language-experience/dragon.jpg" /></p>
<div class="intro">
<span class="sc"><abbr title="Too long; didn't read">tl;dr</abbr>: </span> My short and higly subjective feelings about programming languages I used.
</div>
<h3 id="basic"><code>BASIC</code></h3>
<p><img alt="Title image" src="/Scratch/img/blog/programming-language-experience/basic.gif" class="left" />
The language of my firsts programs!
I was about 10, with an <code>MO5</code> and <code>Amstrad CPC 6128</code> and even with my <code>Atari STe</code>.
This is the language of <code>GOTO</code>s.
Ô nostalgia.
Unfortunately this might be the only interesting part of this language.</p>
<p>Today this language is obsolescent.
It is not even good to learn programming.
I know some compiler exists now.
But this is not enough to try to learn it.</p>
<pre class="twilight">
READY
10 PRINT <span class="String"><span class="String">&quot;</span>HELLO WORLD!<span class="String">&quot;</span></span>
20 GOTO 10
RUN
</pre>
<p>I also remember I copied some game source code from some magazine.
Most lines were like:</p>
<pre class="twilight">
3110 DATA FA,01,FF,FF,FF,FF,00,23,22,43,DA,DE,EE,FF,FF,FF,00,03,4A,F2
</pre>
<p>What a pleasure!</p>
<h3 id="logo">Logo</h3>
<p><img alt="Dragon fractal" src="/Scratch/img/blog/programming-language-experience/dragon.jpg" class="left" />
I was about 10 when I played with logo to draw on the computer.</p>
<p>I remember the Bach&rsquo;s music while the program loaded.</p>
<p>At that time we had to load the program into the memory using tapes.
This one was a rare one. It didn&rsquo;t made an awfull &lsquo;Krrrkrr cssssss krrr&rsquo; noise.</p>
<p>Some years after, I used it to learn programming to my college student.
It was really good as a first language.
Making fractals is like a game for children.</p>
<p>Here is an example of code. It draws the dragon fractal.</p>
<pre class="twilight">
HIDETURTLE
PENUP
SETXY -200 0
RIGHT 90
PENDOWN
to dragon&nbsp;:degree&nbsp;:size
setpensize 1
<span class="Keyword">if</span>&nbsp;:size<span class="Keyword">&gt;</span>5 [setpensize 2]
<span class="Keyword">if</span>&nbsp;:size<span class="Keyword">&gt;</span>10 [setpensize 3]
<span class="Keyword">if</span>&nbsp;:size<span class="Keyword">&gt;</span>20 [setpensize 4]
<span class="Keyword">if</span>&nbsp;:size<span class="Keyword">&gt;</span>40 [setpensize 5]
ifelse&nbsp;:degree=0 [
fd&nbsp;:size
][
left 45 dragon (:degree-1) (size/4)
right 90 dragon (:degree-1) (size/2)
left 90 dragon (:degree-1) (size/4)
right 45
]
end
dragon 6 3000
</pre>
<h3 id="pascal">Pascal</h3>
<p>The always second.</p>
<p>I made my firsts real serious program with Pascal.
I must confess I find it inferior to C.
I made graph algorithms, sort algorithms even some IA (genetic) algorithms.
In the end I prefer C.</p>
<h3 id="c">C</h3>
<p><img alt="Pointer representation from Dancing links" src="/Scratch/img/blog/programming-language-experience/C.jpg" class="left" /></p>
<p>The pointer&rsquo;s language.</p>
<p><em>Le</em> programming language.</p>
<p>Once you understand loops and recursivity.
It is time to make things serious.
If you want to have good quality code, knowing C is almost mandatory.</p>
<p>This language is close to machine language.
So much, there is (mostly) a linear relation between the size of your code and the size of the compiled one.</p>
<p>In short, each time you write a C instruction there won&rsquo;t be anything strange that will occurs, like starting a long algorithm behind the scene.</p>
<p>It is very close to the machine while keeping sufficient abstractions to be fun.</p>
<p>I made a lot of program with it.
From sort algorithms to AI ones (SAT3), system, network prgramming, etc&hellip;
It is a very useful language that will help you understand how things works on your computer.
Most modern computer language hide a lot of informations on what occurs.
This is not the case with C.</p>
<h3 id="ada">ADA</h3>
<p>The super-clean one.</p>
<p>I liked ADA. I must confess I didn&rsquo;t used it a lot.
May be one day I will try it again.
I was impressed by asynchronous programming with it.
What you need to know is this old language had certainly inspired most new object oriented languages.</p>
<h2 id="object-oriented-languages">Object Oriented Languages</h2>
<p>Until here I just described imperative languages without any object notion.</p>
<p>More clearly, the language didn&rsquo;t helped you to structure your program.</p>
<p>In order to limit the number of bugs, particularly for huge programs, we started to think about how to organize computer programs.
In the end, from the imperatives language culture, it produced the Object Oriented programming (OOP).
Beware, the Object Oriented programming isn&rsquo;t a miracle. Proof? How many bug-free software do you use?
Furthermore, OOP doesn&rsquo;t fit all problems.
But to make a bank application, an application which help to manage stock, clients or text archives.
I mean an information system, the OOP is not so bad.</p>
<p>Then Object Oriented Languages appeared everywhere.</p>
<h3 id="c-1">C++</h3>
<p><img alt="Messy router" src="/Scratch/img/blog/programming-language-experience/cplusplus.jpg" class="left" /></p>
<p>The ugly</p>
<p>Industry wanted an Object Oriented Language without losing all their old C code.
Solution, keep C and add an Object layer on it.
My main concern about C++ is: it do too many things.
I appreciated multiple inheritance and templates.
In reality I liked a lot C++ while I was working alone.
I used it to write <code>DEES</code> my main thesis software.
My only concern was about a lack in the <abbr title="Standard Tempate Library">STL</abbr>.
In the doc, one could use <code>String&lt;T&gt;</code>.
But in reality, T have to be only <code>char</code> or <code>char16</code>.
Then I had to reduce my alphabet to 2<sup>16</sup> letters.
Except for some application, the alphabet must be far larger than that.</p>
<p>To conclude, I&rsquo;d say, C++ is very good if you work alone or with a fixed subset of its features.</p>
<h3 id="eiffel">Eiffel</h3>
<p><img alt="Eiffel tower construction" src="/Scratch/img/blog/programming-language-experience/eiffel.jpg" class="left" /></p>
<p>Yes, it is a really nice language.
Full object in mind. Far cleaner than C++.
But it isn&rsquo;t so popular.
Behind C++ there is a large community to help new users and to write libraries.
Furthermore, I preferred working with C++.
At that time I programmed a lot with C and like its syntax.</p>
<h3 id="java">Java</h3>
<p><img alt="Holy Grail from the Monty Python" src="/Scratch/img/blog/programming-language-experience/grail.jpg" class="left" /></p>
<p>The first time I heard about Java it was <em>le Grail</em>!</p>
<p>Perfect portability, your program will work on all platform.
There was incrusted inside the language architecture concepts to help limit mistakes, and force you to use good programming habits. But&hellip;</p>
<p>But It is extremely verbose.
And limitations are quite boring if you know what you&rsquo;re doing.</p>
<p>For example, there is no multiple inheritance.
Generally it is a coherent choice when there are a way to compensate.
In Java, there are interfaces for this.
Except, interfaces can only add methods to a class.
You cannot add any attribute to a class except by subclassing.
I really lacked this feature.</p>
<p>I made a <abbr title="Graphic User Interface">GUI</abbr> using Java Swing and I created my own notification system between different element of the <abbr title="Graphic User Interface">GUI</abbr>.
Then, at the begining I only needed to send notification 1 to 1.
After some times, I needed to make 1 to many notifications.
And I add to make a bunch of copy/paste inside all my subclasses!
Copy/paste are exactly what should be avoided the most by object oriented languages.</p>
<p>Another thing: threads.
I was forced to make my own thread management system to avoid locks and notifications between threads (wait the end of this thread, &hellip;).
At that time I used Java 1.5.
This problem should have been solved with Java 1.6.
I wish it is the case, but lacking such an essential feature for a language was very bad.</p>
<p>In the same idea, it was very long to wait for the foreach loops.</p>
<p>After my experience, I don&rsquo;t recommend Java.
Portability does not worth this price.</p>
<p><abbr title="Graphic User Interface">GUI</abbr> protability means mediocre experience on all platforms.
Any system it might be (wxWidget, QT, etc&hellip;).</p>
<p>The Java ideology is &ldquo;closed&rdquo;. But it resolve a big problem.
It helps medium to low quality developper to work in team without the ability to make too much harm to the product.
A good programmer will be able to make very interresting things with it thought.
Please note I didn&rsquo;t say Java programmer are bad programmer.</p>
<h3 id="objective-c">Objective-C</h3>
<p><img alt="Xcode Logo" src="/Scratch/img/blog/programming-language-experience/xcode_logo.png" class="left" /></p>
<p>The language I learned and used only to make application on Apple<small>&copy;</small> platform.
I learned Objective-C just after Python.
It was hard to do it.
At first I didn&rsquo;t liked the syntax and many other details.
But it is this kind of language you like more and more you use it.
In fact, Objective-C is a simple language, but associated with the Cocoa framework it is a really good tool.
Cocoa is very different to other framework I used before.
I find many of its idea extermely good.
Both simple and efficient.
It might seems like small details on paper, but once you start using it, it make all the difference.</p>
<p>Even if Objective-C is a relatively low level language.
Its dynamic typing ability make it very good for <abbr title="Graphic User Interface">GUI</abbr> programming.
I recommand to continue working with this language.
In the end you&rsquo;ll certainely find it better than expected.</p>
<h2 id="modern-scripting-languages">Modern Scripting Languages</h2>
<h3 id="php">PHP</h3>
<p><img alt="A Jacky Touch Car" src="/Scratch/img/blog/programming-language-experience/php.jpg" class="left" /></p>
<p>This small script language that we used all to make our website in the time of animated gifs.</p>
<p>Nice but no more. Apparently there were a lot of progress since PHP5. Maybe one day I&rsquo;ll use it again. But behind it, this language has a &ldquo;script kiddies only&rdquo; reputation.
Also long history of easy to make security holes.</p>
<p>In reality PHP is just behind C for the abstraction level.
Therefore it has a lot of organisation problems and make it easier to create bugs.
For web applications it is a real problem.</p>
<p>PHP remains for me the SQL injection language.
I make a bit of PHP not so long ago, and it was a pain to protect my application to SQL injection. Yep, I didn&rsquo;t found any standard library to make this, but I didn&rsquo;t searched a lot.</p>
<h3 id="python">Python</h3>
<p><img alt="Python. Do you speak it?" src="/Scratch/img/blog/programming-language-experience/python.jpg" class="left" /></p>
<p>Revelation!</p>
<p>When you were used to work with compiled languages (C++, Java) and you start learning Python, it&rsquo;s like a punch in the face.
Programming like it always should have been.
Everything is natural, it&rsquo;s <em>magic</em>.
Yes, as good as this.
But something so good must have some drawback.</p>
<p>And yes, like all interpreted languages, Python is <em>slow</em>.
Beware, no just a bit slow like 2 or 3 times slower than C. (like Java for example).
No, really slow, about 10 to 20 times slower than C.
Argh&hellip; Note it is completely usable for many things.</p>
<h3 id="awk">Awk</h3>
<p>If you have to &ldquo;filter&rdquo; some files and the filter is not too complicated awk is the ideal language to do this.
For example, if you want to know which words in a text file are most used.
I used it to modify hundred of XML files in an easier manner than XSLT.</p>
<h3 id="perl">Perl</h3>
<p>Perl is magic, but the syntax is so hideous nobody can like to work in an environment with many different person in Perl.
Or at least, all other collaboratos must be excellent programmers.
But the very good feature is the integration of some perl syntax.</p>
<pre class="twilight">
<span class="Variable"><span class="Variable">$</span>var</span> =~ <span class="StringRegexp"><span class="StringRegexp"><span class="SupportFunction">s</span>/</span>toto</span><span class="StringRegexp"><span class="StringRegexp">/</span>titi<span class="StringRegexp">/</span></span><span class="StringRegexp"><span class="StringRegexp"><span class="Keyword">g</span></span></span>
</pre>
<p>This program will replace every toto by titi inside the <code>$var</code> variable.
The Perl code is often very compact and usally unreadable.
But it is a language good to know.
It is a kind of <code>awk</code> under steroids.</p>
<h3 id="ruby">Ruby</h3>
<p>Ruby is a very good language. It is often compared (opposed&nbsp;?) to Python.
There are the regular expression operators Perl inside the langage.
But the syntax is extremely clear, like in Python.
Many feature were inspired by functionnal programming (as in Python).
I used it a lot.
It is the worst language I know in term of efficiency.
This is the language that lose almost all benchmarks.
But it is the perfect tool for prototypes.
If you want to make a website prototype, RoR (Ruby on Rails) is certainly one of the best system known to mankind.
From idea to realisation, few time will occur. Make this site work for thousand of people, will, on the other hand, certainly require a lot of optimisations.</p>
<h3 id="javascript">Javascript</h3>
<p>It is the good surprise.
During years, javascript was considered as an annoying web experience language.
In reality, javascript has many really good qualities.
Particularly, it is easy to pass a function in parameter and to create anonymous functions (closures).
Recently, javascript became far faster than before and many frameworks and libraries appears:</p>
<ul>
<li>Cappuccino, Objective-J (as in objective-C but with javascript)</li>
<li>Sproutcore</li>
<li>Spine.js</li>
<li>Backbone.js</li>
<li>jQuery</li>
<li>prototype.js</li>
</ul>
<p>Particularly with jQuery we can chain functions.
It is very nice to use.
As I said, this is a good surprise.
Javascript was chosen by chance as the script inside your navigator.
Instead of the java inspired syntax, everything else is very good.
In order to compensate the syntax, you can use CoffeScript.</p>
<h2 id="functional-languages">Functional Languages</h2>
<h3 id="caml">CamL</h3>
<p>I learned CamL during the college.
It was really interresting.
Functional programming is very different to imperative programming (most of popular languages).
I had good mathematic intuitions to use this language.
But I must confess I never used it for something serious.</p>
<h3 id="haskell">Haskell</h3>
<p>I am still learning this language.
I must say it is a pleasure.
Generally it takes me no more than some hours to some days to learn a new programming language.
Concerning haskell, this is very different.
To master haskell you need to understand very hard concepts.
Monads and Arrows are some of them.
I didn&rsquo;t understand them before I read some scientific paper.
Many week will be necessary to master it perfectly (if someone does).
Also the community is very friendly and nice. There is no &ldquo;LOL! URAN00B! RTFM!&rdquo;
And no concession has been made to make this language more popular (I&rsquo;m looking at you C++, Java and Javascript).
This langage remain pure (I know there are two meaning).</p>
<h2 id="unpopular-languages">Unpopular Languages</h2>
<h3 id="metapost">Metapost</h3>
<p>Metapost is a language to program drawings.
What make metapost very good?
It contains a linear solver.
This is really useful to draw things.
For example if you write:</p>
<pre class="twilight">
<span class="Variable">AA</span><span class="Keyword">=</span><span class="Constant">1</span><span class="Keyword">/</span><span class="Constant">3</span>[<span class="Variable">A</span>,<span class="Variable">B</span>]
</pre>
<p>It will place the point <code>AA</code> between the point <code>A</code> and <code>B</code>.
More precisely at the barycenter <code>(2xA + B)/3</code>.</p>
<pre class="twilight">
<span class="Variable">X</span><span class="Keyword">=</span>whatever[<span class="Variable">A</span>,<span class="Variable">B</span>]
<span class="Variable">X</span><span class="Keyword">=</span>whatever[<span class="Variable">C</span>,<span class="Variable">D</span>]
</pre>
<p>This second example, will place the point X at the intersection of the two segments <code>AB</code> and <code>CD</code>.</p>
<p>This feature is very helpful, and not only to draw things.
Most programming language should think about adding it.</p>
<h3 id="zsh">zsh</h3>
<p>Yes, zsh is a shell.
But it is also a script language extremly well suited to file management.
For now, it is the best shell I used. I prefer zsh to bash.</p>
<h3 id="prolog">Prolog</h3>
<p>I never made something serious with Prolog, but I really loved to use and learn it.
I had the chance to learn Prolog with <a href="http://alain.colmerauer.free.fr/">Alain Colmerauer</a> himself.
This language try to resolve constraints as much as it can.
It has a magic feeling when you use it.
We only write constraints, we never put order.
A bit like functional programming but far more powerful.</p>
<h2 id="languages-to-discover">Languages to discover</h2>
<p>Many languages and framework remains to be learnt and tried.
Actually I believe I will stay a while with haskell.
Maybe tomorrow I will look at LISP, Scala or Erlang.
I also certainly look at clojure to make web application.</p>
<p>Tell me if you have any other experience with these programming languages.
Of course, my feelings are highly subjectives.
But I used all of these languages.</p>
</div>
<div id="choixrss">
<a id="rss" href="http://feeds.feedburner.com/yannespositocomen">
Subscribe
</a>
</div>
<script type="text/javascript">
$(document).ready(function(){
$('#comment').hide();
$('#clickcomment').click(showComments);
});
function showComments() {
$('#comment').show();
$('#clickcomment').fadeOut();
}
document.write('<div id="clickcomment">Comments</div>');
</script>
<div class="flush"></div>
<div class="corps" id="comment">
<h2 class="first">comments</h2>
<noscript>
You must enable javascript to comment.
</noscript>
<script type="text/javascript">
var idcomments_acct = 'a307f0044511ff1b5cfca573fc0a52e7';
var idcomments_post_id = '/Scratch/en/blog/programming-language-experience/';
var idcomments_post_url = 'http://yannesposito.com/Scratch/en/blog/programming-language-experience/';
</script>
<span id="IDCommentsPostTitle" style="display:none"></span>
<script type='text/javascript' src='/Scratch/js/genericCommentWrapperV2.js'></script>
</div>
<div id="entete" class="corps_spaced">
<div id="liens">
<ul><li><a href="/Scratch/en/">Home</a></li>
<li><a href="/Scratch/en/blog/">Blog</a></li>
<li><a href="/Scratch/en/softwares/">Softwares</a></li>
<li><a href="/Scratch/en/about/">About</a></li></ul>
</div>
<div class="flush"></div>
<hr/>
<div id="next_before_articles">
<div id="previous_articles">
previous entries
<div class="previous_article">
<a href="/Scratch/en/blog/Learn-Vim-Progressively/"><span class="nicer">«</span>&nbsp;Learn Vim Progressively</a>
</div>
<div class="previous_article">
<a href="/Scratch/en/blog/Password-Management/"><span class="nicer">«</span>&nbsp;40 character's passwords</a>
</div>
</div>
<div id="next_articles">
next entries
<div class="next_article">
<a href="/Scratch/en/blog/Yesod-excellent-ideas/">Yesod excellent ideas&nbsp;<span class="nicer">»</span></a>
</div>
</div>
<div class="flush"></div>
</div>
</div>
<div id="bottom">
<div>
<a rel="license" href="http://creativecommons.org/licenses/by-sa/3.0/">Copyright ©, Yann Esposito</a>
</div>
<div id="lastmod">
Created: 09/28/2011
Modified: 10/03/2011
</div>
<div>
Entirely done with
<a href="http://www.vim.org">Vim</a>
and
<a href="http://nanoc.stoneship.org">nanoc</a>
</div>
<div>
<a href="/Scratch/en/validation/">Validation</a>
<a href="http://validator.w3.org/check?uri=referer"> [xhtml] </a>
.
<a href="http://jigsaw.w3.org/css-validator/check/referer?profile=css3"> [css] </a>
.
<a href="http://validator.w3.org/feed/check.cgi?url=http%3A//yannesposito.com/Scratch/en/blog/feed/feed.xml">[rss]</a>
</div>
</div>
<div class="clear"></div>
</div>
<script type="text/javascript">
var clicky = { log: function(){ return; }, goal: function(){ return; }};
var clicky_site_id = 66374971;
(function() {
var s = document.createElement('script');
s.type = 'text/javascript';
s.async = true;
s.src = ( document.location.protocol == 'https:' ? 'https://static.getclicky.com/js' : 'http://static.getclicky.com/js' );
( document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0] ).appendChild( s );
})();
</script>
<noscript><p><img alt="Clicky" width="1" height="1" src="http://in.getclicky.com/66374971ns.gif" /></p></noscript>
</body>
</html>