Live data from Hacker News

The Duct Tape Programmer (2009)

joelonsoftware.com

21–30 of 52 posts

Re: The Duct Tape Programmer (2009)

#21
I really feel as if the author should put the most important information right at the beginning of his post, namely that his coding philosophy is "you’re not here to write code; you’re here to ship products."

Of course the way to properly tackle these two objectives is going to be vastly different, and Joel just has the second objective, rather than the first. The problem is that almost everyone who complains about what you might call 'bad code' thinks that "writing good code" is the end goal, whereas almost everyone who writes said 'bad code' has "shipping products" as their end goal.

From the outside that might look like a difference in design philosophy, but really it's more a difference between someone who codes well because they care about their product and someone who codes badly because they have to put food on the table.

Re: The Duct Tape Programmer (2009)

#22
post #20

I always liked this quote by Jamie Zawinski, from Coders at Work "I know it’s kind of a cliché but it comes back to worse is better. If you spend the time to build the perfect framework…release 1.0 is going to take you three years to ship and your competitor is going to ship their 1.0 in six months and now you’re out of the game. You never shipped your 1.0 because someone else ate your lunch. Your competitor’s six-mo…

Shouldn't that worry you, rather than excite you? He's just saying "worse is faster", not "worse is better". Especially that last sentence is kind of terrifying: "they can rewrite it because you don’t have a job anymore." Basically, everyone who takes the time to write good code will be outcompeted by bad code written quickly, until eventually everything is bad.

Re: The Duct Tape Programmer (2009)

#23

I have issues with the combining of what to me are entirely different categories of things in the sort of "critique" that "duct tape" programming supposedly represents. Fine, COM and COBRA are baroque and complex and one can make the case that they merely make "simpler" things that can be done in other, more duct-tape-y ways. I'm fine with dismissing this sort of overgrown, overcooked-before-anyone-even-ate-it API/fr…

> Also, real programmers don't say DWORD.

That's just silly. DWORD is a macro for an unsigned 32-bit integer. It has been around since the first version of Windows.h, along with BYTE and WORD for unsigned 8-bit and 16-bit integers.

Any old-time Win16 or Win32 programmer like Joel or me would know the term and be likely to use it in the context of Windows programming.

Keep in mind that Windows.h predated the modern definitions like uint32_t by many years. The original Windows developers had to come up with some names for these data types. It doesn't mean they weren't "real" programmers.

Although I suppose, given that floating point processors were far from being standard equipment at the time, you could argue that they were integer programmers...

Re: The Duct Tape Programmer (2009)

#24

Still going back to Joel on Software for a good read. My favorite technical blog even though Joel has more or less stopped writing except for the occasional update.

He has so many classic must-read articles that are just as relevant today as when they were written some 10+ years ago. The technologies may have changed but the sentiments sure haven’t.

I remember reading "The Joel Test" my Sophomore year of college. It really influenced the questions I asked when going through so many interviews my senior year. Not sure how I even found his blog in the first place. Whenever I found out he wrote the specifications for Excel my mind was blown. I think Excel is maybe the most influential/important piece of software ever written.

Re: The Duct Tape Programmer (2009)

#25
So one thing I think that gets lost is, to me, the most important quality in code is: how easy is it to debug. Like, I remember once having to maintain this guy's code where he just went crazy on C++ templates. And like, he proved that he's very smart and clever, but it made his code practically unusable since nobody could figure it out, and trying to debug a template masterpiece is like the hardest thing in c++ coding because the errors are impenetrable.

Coding isn't about proving your smartness it's about making something people can use and work with.

Re: The Duct Tape Programmer (2009)

#26

I have issues with the combining of what to me are entirely different categories of things in the sort of "critique" that "duct tape" programming supposedly represents. Fine, COM and COBRA are baroque and complex and one can make the case that they merely make "simpler" things that can be done in other, more duct-tape-y ways. I'm fine with dismissing this sort of overgrown, overcooked-before-anyone-even-ate-it API/fr…

> Also, real programmers don't say DWORD.

Wait what? If you've done any windows coding in C it's practically lingua franca. I think the int{size}_t stuff is way better, but a "word" is common slang, and a double word is like a dword because nobody wants to write that much

> Also, the "next and previous points xor'ed into a DWORD" hack mentioned at the end? This isn't duct tape programming. It's absurdly context-dependent premature optimization

Man I'm writing code for an arduino right now and that kinda optimization isn't rare for a machine with 2k of ram. It's not absurd it's useful to be able to do that. Sure don't do it on your 4ghz intel or whatever but techniques like that are useful.

Re: The Duct Tape Programmer (2009)

#27
post #2

Duck tape programmers also produce code only one or a few persons can patch. The result is technical debt that lead Netscape to do a full rewrite to produce Mozilla/Firefox. The truth is in the middle with better tooling to make it easier to design good code and get it working faster with fewer bugs even while at the bleeding edge.

I think the extremes are straw men. The choice isn't between "duct tape" or "oven-engineering." It's between poor and good design. A well designed solution doesn't feel like duct tape, nor should it be "too clever" with a crazy multiple-inheritance architecture that no one but the author can understand. In fact, it sounds like the extremes described in this article are both crap developers, with different flavors of…

I would say the extremes are between no design and some "perfect" design.

Re: The Duct Tape Programmer (2009)

#28

I have issues with the combining of what to me are entirely different categories of things in the sort of "critique" that "duct tape" programming supposedly represents. Fine, COM and COBRA are baroque and complex and one can make the case that they merely make "simpler" things that can be done in other, more duct-tape-y ways. I'm fine with dismissing this sort of overgrown, overcooked-before-anyone-even-ate-it API/fr…

>Also, real programmers don't say DWORD.

Laughs in Turbo Turtle.

Re: The Duct Tape Programmer (2009)

#29

> xor the “next” and “prev” pointers of their linked list into a single DWORD to save 32 bits I suppose that it's true that if you were coming from the item pointed to by 'prev' you could xor your previous address with the linked list pointer to get the value of 'next'. Is that from an actual implementation? Was anyone crazy enough to actually do that?

It can be done even better. I read an article about that recently.

Nowadays pointers are 64-bit. So the simple xoring already saves 64 bits.

But, in most cases allocated memory blocks are close together, so that xoring of those 64-bit values gives a 32-bit value. So if you ignore the upper half and store the result in 32-bit, you basically save 96 bits. For the cases where the upper half matters, you can store it in an additional hashmap.

But it goes even better, if you allocate blocks and store indices. Like if you allocate blocks of 512 objects each. Then it is likely that the next/prev index is also in that block. Then you can store those indices in 2*8 bits (or just 8 bits if xored again?). In case it is in another block, you use the hashmap again. Then you save up to 120 bits.

The question remains, how do you find that hashmap? The article had a really clever solution. You allocate the blocks as 4K-aligned pages, e.g. by using mmap rather than malloc. Then you put a pointer to the hashmap at the beginning of the page, and when you have a pointer inside the block, you can find the hashmap by rounding the pointer down to the previous aligned position.

Re: The Duct Tape Programmer (2009)

#30
jwz's response is worth reading as well: https://www.jwz.org/blog/2009/09/that-duct-tape-silliness/

"It's such a strange article, in that it's mostly favorable to my point of view but with such a breathless amazement to it, like he's just discovered an actual unicorn or something. "Look, everybody! Here's a hacker who actually accomplished things and yet he doesn't fetishize the latest fads that I and all of my friends make our living writing about!" There's this tone to the thing like he just can't imagine that someone like me can exist."

Post reply on HN