TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Fear and Loathing in Programming La La Land (2012)

77 pointsby fogusalmost 12 years ago

9 comments

zwiebackalmost 12 years ago
I think the poster&#x27;s point 1 is really the key here. In addition, I think Intellisense-driven programming has a lot to do with it. I suspect a lot of .NET programming goes like this (I know I&#x27;ve been guilty of this)<p>1) Hmm, let&#x27;s see what classes are in this namespace... Ah, this one looks like it might do the job so I&#x27;ll type<p><pre><code> var foo = new ThingWithInterestingName(); </code></pre> 2) Dang, don&#x27;t want to scroll through tooltips for 23 different constructors with poorly named params, think I&#x27;ll just use the default constructor, they probably implemented that for casual users like me.<p>3) Now I can type foo. and let IntelliSense give me options. When I call a function I get an error for each call instead of some crazy exception for the whole thing. Maybe I can even test stuff out in the Immediate window in the debugger.<p>So, I think it&#x27;s not only miseducation or layzness, it&#x27;s that modern IDEs for static languages encourage discovery based development in favor of reading through API documents.
评论 #6049598 未加载
评论 #6049742 未加载
jerfalmost 12 years ago
It&#x27;s convenient that the poster initialized the relevant flame war this will degenerate into right in his post there. A discussion about the best way to structure APIs is surely not complete without flaming people about being elitist and that opportunistic programmers exist, and more flames about the fact that since they are producing lots of real world programs you should just shut up about them. I appreciate the guidance. I might have accidentally started flaming about event-based programming or the utility of NULL pointers instead, you know, and that would just be <i>gauche</i>.
评论 #6049554 未加载
oinksoftalmost 12 years ago
Richard O&#x27;Keefe has deep knowledge of computer science and software engineering, and his posts to erlang-questions, where you&#x27;ll often encounter Erlang, Prolog, LISP, Java, and C neatly woven into the same message, are almost always enlightening.
评论 #6047948 未加载
评论 #6049535 未加载
hergealmost 12 years ago
Reading this, I though to myself that one of the biggest features I like in python that is missing in java is named and optional parameters.<p>Also, any api&#x2F;library that lets you create an object that is unusable because specific methods to set up values haven&#x27;t been called yet is very error prone.
评论 #6047610 未加载
评论 #6048876 未加载
coldteaalmost 12 years ago
Needlessly condescending and not so bright himself for it.<p>For example he didn&#x27;t understand what the three categories of programmers were meant to be (tendencies between good programmers working at MS -- hence, even those deemed &quot;opportunistic&quot; are not some clueless idiots worthy for the Daily WTF).<p>Second, there are a few cases to be made for the second style (even over named parameters).<p>One is less clutter at the constructor level.<p>A second is easier reflection&#x2F;dependency injection.<p>A third is it forces saner defaults.<p>Also, better readability for some (which is not all about cramming as many lines in the same editor screen).<p>It also makes parameters independent of ordering -- which in the compiler they are, but in a constructor they are not (except with named parameters, and even those have to come AFTER non named ones).<p>The only real downsides are: a) the possibility of using a half-baked object. But I don&#x27;t see how that would be any different than omitting some of the named params. b) third parties mutating the objects. But then you have the same &quot;issue&quot; in most dynamic languages anyway.<p>(The off topic jab against &quot;climate change&quot; at the end was also pathetic -- apparently he&#x27;s one of the climate change deniers, despite overwhelming acceptance of the notion from the scientific community, putting them on par with Creationists).
drawkboxalmost 12 years ago
I like readable code, he didn&#x27;t mention readability. The only thing I really care about in code is that it is readable and doesn&#x27;t stretch all in one line and not broken up. Small chunks are better than a ninja one liner.<p>Constructor arguments&#x2F;params are fine as long as the code is readable and line breaks to keep it within a decent column size. I also think that constructor arguments can sometimes get into overload messes just as method calls can. A good api breaks up any overly parameterized constructor or methods.<p>I just want code to be readable, fit within a decent column area and make sense. Whether it is in constructor params or method params there shouldn&#x27;t be too much done in one line for complexity sake.<p>If programmers don&#x27;t get constructor params then they probably don&#x27;t get method params either. I think people just want stepped-readable code in most cases. Named and optional params help to clear up long initialization or method calls but in the end it is about balance and readability.<p>Smaller, iterative code bits are easier to put a breakpoint on as well say for instance one param was null and it broke on constructor, it might take some more inspection to find unless it was a specific set.
rdtscalmost 12 years ago
FYI this was posted in Erlang&#x27;s mailing list. There was a following discussion about it if anyone is interested.<p><a href="http://erlang.org/pipermail/erlang-questions/2012-March/thread.html#65519" rel="nofollow">http:&#x2F;&#x2F;erlang.org&#x2F;pipermail&#x2F;erlang-questions&#x2F;2012-March&#x2F;thre...</a>
aviraldgalmost 12 years ago
From a purely technical point of view, doing this is a terrible idea as it adds additional, unnecessary state to objects, and hence makes it possible for them to break in more ways.<p>Using the Builder pattern, or keyword arguments, achieves the intended goal of making API features discoverable without the added complexity.
tomealmost 12 years ago
I don&#x27;t know who Richard O&#x27;Keefe is but I do know he writes intelligent things on the haskell-cafe mailing list.