I need to learn to read the headers before sending.<br><br><div class="gmail_quote">---------- Forwarded message ----------<br>From: <b class="gmail_sendername">Michael Richter</b> <span dir="ltr"><<a href="mailto:ttmrichter@gmail.com">ttmrichter@gmail.com</a>></span><br>
Date: 30 March 2012 16:42<br>Subject: Re: [erlang-questions] Fear and Loathing in Programming La La Land<br>To: Steve Strong <<a href="mailto:steve@srstrong.com">steve@srstrong.com</a>><br><br><br><div class="gmail_quote">
<div class="im">On 29 March 2012 15:49, Steve Strong <span dir="ltr"><<a href="mailto:steve@srstrong.com" target="_blank">steve@srstrong.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div>The idea of create-set-call is, imho, madness. It means that you never really know if an object is in a sane state to be used - what properties need to be set to make the object "usable"? What happens if some properties are set more than once? What if I set some properties, start using the object, and then change some properties? </div>
</blockquote><div><br></div></div><div>This. This right here. Yes, this.</div><div><br></div><div>I have not much to add here beyond this being why I simply cannot abide most OOP APIs. I positively loathe anything that allows me to have software items in a Schrödinger State where it is neither uninstantiated nor fully-instantiated. To me instantiation should be atomic or, if absolutely necessary, should be built up via builder objects (which can still enforce sanity within their build() methods).</div>
<div><br></div><div>This doesn't mean that I like having to remember a dozen different positional parameters to an initialization method, of course. That's just as much madness as is the create-set-call cycle. If you're using a language that's so lame it can't do named parameters and/or provide sane defaults, the builder pattern is the way around the lameness.</div>
<span class="HOEnZb"><font color="#888888">
<div><br></div></font></span></div><span class="HOEnZb"><font color="#888888">-- <br>"Perhaps people don't believe this, but throughout all of the discussions of entering China our focus has really been what's best for the Chinese people. It's not been about our revenue or profit or whatnot."<br>
--Sergey Brin, demonstrating the emptiness of the "don't be evil" mantra.<br>
</font></span></div><br><br clear="all"><div><br></div>-- <br>"Perhaps people don't believe this, but throughout all of the discussions of entering China our focus has really been what's best for the Chinese people. It's not been about our revenue or profit or whatnot."<br>
--Sergey Brin, demonstrating the emptiness of the "don't be evil" mantra.<br>