<br><br><div class="gmail_quote">On Wed, Apr 6, 2011 at 12:46 PM, Daniel Goertzen <span dir="ltr"><<a href="mailto:daniel.goertzen@gmail.com">daniel.goertzen@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
One thing that has bothered me about implementing gen_servers is that I have to create empty stubs for the callbacks that I don't need. Today I made a gen_server that only needs init/1, so instead of creating all those stubs I just commented out the behavior definition "-behavior(gen_server)."
<div><br></div></blockquote><div><br></div><div>Daniel,</div><div><br></div><div>The _Erlang Programming_ book actually says **not** to implement callbacks you don't need. (pp274) I think that makes sense and is the advice I have followed. However, most people tend to implement all the callbacks even if they don't use them for anything. In fact, I think that's the recommended way in _OTP in Action_. So it seems not even the veterans can agree on this topic.</div>
<div><br></div><div>-Ryan</div></div><br>