FAQ terminology harmonisation

martin j logan martin@REDACTED
Wed Apr 2 22:47:40 CEST 2003



On Wed, 2003-04-02 at 11:50, Rick Pettit wrote:
> On Tue, Apr 01, 2003 at 12:38:31PM -0600, martin j logan wrote:
> > 
> > Here is how the other ninety nine and one half sees it:
> > 
> > 1. Crashing is a great way to handle errors ==C++== seg faults on
> > purpose.
> 
> Don't say it that way. Segfaults are NOT done on purpose (i.e. no C/C++
> programmer that I know of _wants_ his code to segfault, whereas in Erlang you
> may intend for your process to die and be reborn.  Not a clear analogy.

Perhaps I can clarify my little ==<other types of people>== bit here. 

When explaining how things are done in Erlang is is often said that "you
should not explicitly handle errors just let the process crash". When a
person used to programming in C or C++ hears that they often think
crash/segfault that can't ever be good. Stating that "letting a process
crash in lieu of handling an error explicitly" is a good thing is not
the best way to present the supervision feature of OTP/Erlang to
non-erlangers. 

> 
> > 2. 20000 processes ==average UNIX guy== real slow
> 
> Don't say it that one.  Entire node is *1* UNIX process running a thread per
> OTP process. That doesn't sound nearly as slow.
> 
We talk about spawning processes very casually when explaining Erlang. I
know the look that I get when I say "This app is comprised of thousands
of processes". To most people familiar with concurrency at the UNIX OS
level or any number of threading schemes this sounds preposterous. Even
after explanation most don't believe it until they have worked with it.
Most will not get that opportunity as they will right you off after
hearing about your 20000 processes:)   

> > 3. don't be defensive ==Most other languages== sloppy incomplete error
> > checking 
> 
> Most languages would argue that you _should_ be defensive (ex. checking for
> NULL, catching exceptions, etc.)  Not sure this one is clear.

It is common in Erlang code to explicitly handle errors only on
untrusted interfaces. This is not the case in most other languages and
sounds rather radical/unrealistic to the uninitiated. 


> > 4. Dynamic typing combined with "don't be defensive" ==Most static
> > typing theory junkies== just can't work.

After saying that you should not be defensive your labeled a radical if
you then follow it with "...and its all dynamically typed" you will be
walked to the door and asked never to come back. We know after
programming Erlang that judicious coding practice and all of Erlangs
pluses allow very correct fault tolerant code to be written. Most people
do not believe this until they see it.  

I hope this is more clear now.

Cheers,
Martin




More information about the erlang-questions mailing list