[erlang-questions] Fwd: Fear and Loathing in Programming La La Land
Michael Richter
ttmrichter@REDACTED
Fri Mar 30 10:44:02 CEST 2012
I need to learn to read the headers before sending.
---------- Forwarded message ----------
From: Michael Richter <ttmrichter@REDACTED>
Date: 30 March 2012 16:42
Subject: Re: [erlang-questions] Fear and Loathing in Programming La La Land
To: Steve Strong <steve@REDACTED>
On 29 March 2012 15:49, Steve Strong <steve@REDACTED> wrote:
> 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?
>
This. This right here. Yes, this.
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).
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.
--
"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."
--Sergey Brin, demonstrating the emptiness of the "don't be evil" mantra.
--
"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."
--Sergey Brin, demonstrating the emptiness of the "don't be evil" mantra.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20120330/b036edc4/attachment.htm>
More information about the erlang-questions
mailing list