[erlang-questions] Practical Erlang Programming

fess <>
Fri Feb 22 19:56:37 CET 2008



From: http://dukesoferl.blogspot.com/    [ http:// 
dukesoferl.blogspot.com/2008/02/so-guys-erlang-consulting-and- 
training.html ]

> I applaud Francesco, and Jan-Henry in getting another book out there.
> Obviously they have learned from their history areas where new  
> comers to
> erlang have troubles, and they're making a book to plug that hole.
> They are of course asking you to look back on your experience
> coming into erlang, think about what concepts you had troubles with
> and let them know


Here are some dumb hicups I encountered on my way into erlang:

How to debug.

Somehow I glossed over in joes book the bit pointing out
that [ $m,$a,$t,$c,$h | Tail ] is the same as [ "match" | Tail ]
which is so much nicer.

Why are people always reversing lists, and why don't they just  append
with,  List ++ [Item]

Why io:lists are cool,   why deep lists are cool,  flatten later.

Uh, ways of handling strings, since the one "way" is so debatable.

how to debug the oh so clear error messages that come back from things.
the earlier you get what "bad match" vs  function clause is, the better,
as well as the other standard tuples that once you learn to read
you forget how horribly frustrating they were to begin with so you
forget to teach the newbs about it.

the concepts of failing and relying on those oh so clear error messages,
how best to clear those error messages up.

the concepts of failing early and restarting, [ which you don't want
to do until you get used to knowing where something broke reading
those error tuples. ]

How incredibly useful guards are, [ and use dialyzer ]

handy guard tricks to make your guards better.

-define(is_string(String),  begin is_list(String), is_integer(hd 
(String)) end )
-define(is_deeplist(List), begin is_list(List),  is_list(hd(List)) end )

what's the deal with andalso  orelse  vs  commas and semicolons.

I hope those help,  those are at least some newbie topics which I can
remember having little moments of realization about.

And of course shortly after all that newbie stuff, I want more in  
depth info on OTP,
we did a lot of digging into code to figure out what was going on  
with code_change,
and even then who knows if our concepts are correct,   So I agree  
with the angst
that anyone doing a next book, please do that.   even a next wiki page,
more more more.   thanks.

--fess




More information about the erlang-questions mailing list