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.

Code icebergs

136 pointsby bjplinkover 14 years ago

16 comments

sdrinfover 14 years ago
Code iceberg is in the eye of the beholder. Recently started bizdev-people consistently underestimate the time requirements for certain well-exercised tasks.<p>Some of the most common icebergs are:<p>-form validation (seriously -one of the most highly exercised user-interaction paths; it's all over the place, and scales semi-exponentially with the number of fields)<p>-search ("how hard could it be? you just put an input form there, then figure out what the user thought, then display it" -exact quote)<p>-anything that has to process natural language. I mean <i>everything</i>. Wanna split up a text into sentences? How do you differentiate between dr. mr., 2004. jun. , and valid sentence-enders? Generating a definite article ("a", "an") before a noun? Keep in mind that 1,2,@,$,=, and other characters might also be valid noun first-letters :) etc.<p>In my experience, the best anti-iceberg pattern is to follow a portfolio approach, and for each requirements which smells like iceberg, have a fallback plan in place -ie. after N hours of sunken investment, execution shifts to plan B. Usually works out much better, than banging away on the same problem for days.
评论 #1879024 未加载
评论 #1877783 未加载
Hexstreamover 14 years ago
Try to beat this one:<p>I spent <i>4 months</i>, <i>full-time</i> (I think I was a bit depressive and unproductive, though (that might have to do with the difficulty of the problem a bit)) to make a goddamn "error message merging" system where you specify some merge rules for error messages, and then said messages are "merged" efficiently at runtime (with another of my adaptations of the awesome Rete algorithm).<p>For instance, as a trivial example merging "Please enter your Username." and "Please enter your Password." could yield "Please enter your Username and Password."<p>Merging error messages efficiently with a great concise syntax looked SO EASY =/ I was wondering why the hell no websites (that I know of) do that because it's a pretty obvious feature to me... Well, now I know. People don't really mind that much about these things (maybe they just have low expectations) AND it's really hard to implement.<p>I finally made it, right now the implementation is utter crap, with some missing features and some bugs but the general architecture is there and works. I'll clean it up and document it within a few months, probably.<p>It's one of the hardest things I ever made so far in programming.
评论 #1891479 未加载
edanmover 14 years ago
Steve Yegge once wrote a post on this sort of thing. It's called "Have you ever legalized marijuana?", but it doesn't focus on marijuana all that much.<p>Well worth the read: <a href="http://steve-yegge.blogspot.com/2009/04/have-you-ever-legalized-marijuana.html" rel="nofollow">http://steve-yegge.blogspot.com/2009/04/have-you-ever-legali...</a>.
评论 #1879069 未加载
pmjordanover 14 years ago
I've probably fallen for these more often than I'd like to admit. Yet sometimes a naïve "how hard could it be" is exactly the right approach that leads to unexpectedly simple solutions.
marcusboosterover 14 years ago
Every now and again I'll remember that guy who said he was going to build a Stack Overflow clone in a weekend. I still chuckle.
评论 #1877641 未加载
评论 #1877861 未加载
评论 #1877945 未加载
derefrover 14 years ago
I think a code iceberg is actually a symptom of either working at too low a level, or relying on a library with missing/broken features. You see libfoo, and you think "great! I'll use that to implement foobar-ization functionality!" but then, after playing with it for a bit, you realize that foobar-ization actually requires you to do all sorts of crazy things with the output of libfoo before you can use it in XYZApp.<p>Now, you can put all those crazy foobar-izing things <i>into</i> XYZApp, and that'll work—but they should really either go into libfoo itself, or into a new library (libfoobarize) that uses libfoo.<p>This is the case with the example in the article: DuckDuckGo shouldn't be parsing Wikipedia to make its own abstracts. MediaWiki already creates abstracts—they're just <i>bad</i> abstracts. The correct thing to do, since MediaWiki is just a regular ol' FOSS project, is to write a patch that makes MediaWiki spit out <i>good</i> abstracts, that <i>are</i> actually trivial to use in DuckDuckGo. Or, even better, if you know MediaWiki cares about having good abstracts, just submit it as an issue to their tracker and let them do it for you. In other words, repeat the programmer's litany to stave off NIH: "It's not my job. I shall buy, not build. 80% of the features at 20% of the cost. Don't ask a question, send a message. No god-objects. Encapsulate, encapsulate, encapsulate."<p>Note that, of course, there are cases where there really <i>is</i> no libfoo—but then you're doing something totally new, and you can tell the client right up-front "no one's ever done this before, so we have to schedule time for R&#38;D before we can even tell you how much time this feature will take."<p>There is also the case where the only libfoo/libfoobarize is a proprietary one used by the people you're trying to steal market-share from by implementing this feature, in which case you can tell your client "we know it's possible, but we don't know how long it took them to build it. What we <i>do</i> know is that no one else has yet copied them, which means that foobar-ization <i>isn't</i> trivial. It'll probably take a while."
gfodorover 14 years ago
Another class of code icebergs are numerical algorithms. Often a few dozen lines of Matlab or R can be the result of months of effort. Failed approaches, tolerance thresholds, manual data cleansing, and more can all end up living as a few lines of math.
评论 #1878791 未加载
dhruvbirdover 14 years ago
Hey it's great you got a name for them now!<p>You won't believe how many times I've been in a discussion about something and the other person has said "oh that's easy to do" or "it can be done in a few hours" when in fact if they were to go into the details, they would see the hiding devil...
评论 #1877808 未加载
patio11over 14 years ago
I always annotate these on development plans with HBG: Here Be Dragons.
评论 #1878840 未加载
amixover 14 years ago
I think great products tend to have a lot of complexity, but most of the complexity is hidden away from the user. This picture sums up this thought (and it mimics Gabriel's iceberg metaphor quite well): <a href="http://amix.dk/blog/post/19555#The-essence-of-minimal-product-design" rel="nofollow">http://amix.dk/blog/post/19555#The-essence-of-minimal-produc...</a>
bedigerover 14 years ago
I think this is one way that J.P. Lewis' "Large Limits to Software Estimation" (<a href="http://scribblethink.org/Work/Softestim/softestim.html" rel="nofollow">http://scribblethink.org/Work/Softestim/softestim.html</a>) comes out in reality.<p>Naturally, there's an uncountable infinity of ways that comes out in reality, but Code Icebergs are a common way.
moondistanceover 14 years ago
On the topic of mining Wikipedia, DBpedia (<a href="http://dbpedia.org" rel="nofollow">http://dbpedia.org</a>) is a fantastic source for structured Wikipedia content. Extracting data is pretty easy with SPARQL.<p>Freebase (<a href="http://freebase.com" rel="nofollow">http://freebase.com</a>) isn't bad, either.
评论 #1877911 未加载
bialeckiover 14 years ago
Twitter is one of my favorite examples of this. Lots of people look at it and say, "it's so easy implement to build." I'd like to see them scale it to millions of users.
评论 #1878034 未加载
评论 #1880306 未加载
callmevladover 14 years ago
A great example comes from 37signals - <a href="http://answers.37signals.com/basecamp/52-how-can-i-move-or-copy-to-do-lists-between-projects" rel="nofollow">http://answers.37signals.com/basecamp/52-how-can-i-move-or-c...</a> - look for Sam Stephenson's reply (from Sept 8th) in which he explains all the edge cases below the surface.
staktraceover 14 years ago
There's the classic rule of thumb from Brooks' Mythical Man Month: turning a project into a product takes 9x the effort.
ramsover 14 years ago
Icebergs are a good analogy for technical debt as well. The hackish stuff below the surface, often done against better advice invariably causes serious damage.