Live data from Hacker News

Hang your code out to DRY

johan.hal.se

81–82 of 82 posts

Re: Hang your code out to DRY

#81
post #79

Earlier quoted context omitted.

Nah. I meant that it is a library, that needs to be included as a dependency. That's a nonstarter, for me. I'm pretty picky about dependencies. If I use external ones, I like them to be something that can be encapsulated/injected, as opposed to being totally interwoven. But I'm not trying to make money, I just want to write really good apps.

I share your sentiment, and try to avoid dependencies like the pest. But, I wouldn't write my own crypto library, and TCA falls into a similar category - it's a really good solution for a hard problem. Those guys invest a big part of their time into just those few hundred lines of code. There's word that even Apple uses their stuff internally.

I understand, but I have been burned -badly- by relying on critical path dependencies that failed to stay up to date.

Even if only by a week or two, it can be enough to wreak havoc (but my experience is that they are often many months behind).

Like I said, though. I am not competing with anyone, or trying to make money. I write software for free, for those that can’t afford it. I pursue the vocation as a craft, and deliver Quality that would be totally unacceptable in a commercial endeavor (by which, I mean, high quality. Most commercial efforts go for “good enough” quality).

Most folks here would not find working the way I do, to be very satisfactory.

Re: Hang your code out to DRY

#82

I once read a comment I wish I'd saved. It goes along the lines of: W beats X, X beats Y, Y beats Z; in terms of what principle you'd like to apply to your code. One of these letters was essentially representing DRY. I summed things up pretty nicely. Does someone happens to remember?

I'm willing to bet it was this, because I was so struck by it I saved it: >I try to optimize my code around reducing state, coupling, complexity and code, in that order. I'm willing to add increased coupling if it makes my code more stateless. I'm willing to make it more complex if it reduces coupling. And I'm willing to duplicate code if it makes the code less complex. Only if it doesn't increase state, coupling or…

> I'm willing to bet it was this, because I was so struck by it I saved it:

This is indeed what I was looking for. I too was struck by it. Thank you SO much.

Post reply on HN