Suggested Example/ emacs questions
Ulf Wiger
etxuwig@REDACTED
Tue Oct 10 13:08:12 CEST 2000
On Tue, 10 Oct 2000, Joe Armstrong wrote:
> The reason behind the gen_servers FSM's, worker-supervisor trees
>etc. was twofold
>
> 1) Get everybody programming the same way
This is a Good Thing.
> 2) Give novice programmers access to expert code
<snip>
> The idea was "If you're an expert and know what you're doing then
>feel free to 'roll-your-own' otherwise use the appropriate generic code" -
>Of course you loose the feeling of "seat of pants" control if you use the
>generic methods but you gain convenience plus the fact that other people
>can understand your code.
>
> For small hacks I always "roll-my-own" - but for big systems
>programming I'd either use the generic-methods OR write a new generic
>method first and then use that.
My contention is that it's too hard to roll your own using today's
support. The behaviours are great, for the above reasons, but you
really have to know what you're doing to try to make your own
behaviour or bare-bones implementation in a production system.
We have a few processes in our system called "classic servers", in
places where it made sense to optimize away the gen_server overhead.
After a while, we ended up going back to gen_server and paying the
extra overhead, because rolling your own was simply too error prone.
There was too much code that needed to be written by hand -- not
necessarily because it did anything unusual, but because it fell just
a fraction short of being possible to generalize. At least 90% of it
is copy and paste. The remaining 10% causes the headaches.
I'm certain the situation could be improved, and that we should
continue to try and find better solutions.
/Uffe
--
Ulf Wiger tfn: +46 8 719 81 95
Network Architecture & Product Strategies mob: +46 70 519 81 95
Ericsson Telecom AB, Datacom Networks and IP Services
Varuvägen 9, Älvsjö, S-126 25 Stockholm, Sweden
More information about the erlang-questions
mailing list