Hacker News new | ask | show | jobs
by mtrycz2 2317 days ago
Everytime I read posts like this is like if people are arguing about the tiny details of the small picture, and it makes me sad.

Expecially because the big picture is easily stated: Write the least amount of clean code while providing value.

(PS: code is liability)

1 comments

Code is both asset and liability; the asset is the feature set, while the liability has an interest payment in the form of maintenance.

The way you put it, you're optimizing for only one side of the books. The fact is that the value in a company is not in minimal clean code; it's in a recurring revenue stream, and ideally profits. Provide the most value with code which has low interest payments. Everything else being equal, smaller code has lower interest payments, but everything else isn't always equal. And depending on cash flow and market opportunity, maximizing value and to hell with minimal clean code - throwing money & devs at the problem - can make sense.

The distinction here is between code thats clear and concise or code that hacky and confusingly compact. Few people would recommend try and pack a 4-5 line function into a super complex and confusing one liner, but it is reasonable to put a 10k line class into a 20 line function. It's on us, as the developers, to make that tradeoff.

I think the spirit of the comment you replied to was closer to the "clear and concise" methodology rather than the "as short as is humanly possible" methodology.

Only the few people that don’t know anything about the map function or generator expressions and prefer messy imperative code where off by one errors are a given, if you want my opinion..