[erlang-questions] Modernizing code

zxq9 zxq9@REDACTED
Fri Jul 11 10:54:51 CEST 2014


After the (somewhat incessant) discussions about documentation and code 
examples over the last month, I've been checking over the examples that are 
available at erlang.org. I see hints (almost warnings) on the link pages that 
the code examples are "somewhat out of date, but...". I'm trying to figure out 
what about these small examples is in fact out of date -- mostly to educate 
myself, but incidentally if my inquiry could help modernize the examples that 
might be a good thing for us anyway.

Taking getty.erl (http://www.erlang.org/article/7) as an example, other than 
the deliberate decision to not use any OTP behaviors, what about it is so out 
of date? I'm blind to seeing how that should be written differently for R17.

Also, how would a gen_server or gen_fsm version of this need to look to be 
"best practices", "modern" R17 code? How would that differ from "best 
practices" R14 code? (Short of becoming a non-trivial example, I mean. If 
doing things "right" would mean destroying the code's utility as a learning 
example, then no; OTOH, what does that imply about writing OTP example code as 
opposed to writing just Erlang example code?)

-Craig



More information about the erlang-questions mailing list