[erlang-questions] Insight on OTP vs plain Erlang

7 views
Skip to first unread message

Torben Hoffmann

unread,
Jul 3, 2009, 4:23:19 AM7/3/09
to erlang-questions
Hi,

Quick insight: use OTP instead of plain Erlang whenever possible.

Elaboration:
I had a task before me where I had to experiment with a design of a
communication layer.
Prototyping is easy with Erlang and since I was looking for a quick way of
getting some feedback, so I thought that using plain Erlang without OTP
might be the fastest way to get the task done.

Boy, was I wrong...

1. You have to write a lot of boilerplate code that the OTP behaviours
just does for you for free.
2. Navigating your code is more difficult since everything is hidden
inside a big loop function. This is an issue with IDEs that gives you an
outline of the program - just painful.
3. Going to production quality, i.e., real OTP components is a tedious
task... basically a waste of time.

The exercise in using plain Erlang is good for tuning ones skills in doing
small sniplets of code that are too laborious to put into the OTP framework,
but apart from that I would not reccomend it.

OTP is flexible enough to be used for prototyping and it lends itself
extremely well to an iterative development process.

So the bottom line is that OTP has a learning curve, but once you are past
that you are cruising at a speed no one else can achieve.
I have just finished a function point analysis of a project done with OTP at
work and it showed a 7x improvement over doing the same project using C++
(comparing to C: 11x) so I have learned my lesson now!

Cheers,
Torben
--
http://www.linkedin.com/in/torbenhoffmann

Reply all
Reply to author
Forward
0 new messages