Submitted by twovests in programming
musou wrote
Reply to comment by Moonside in no, you see, it's what i call "self-obfuscating code" by twovests
that's exactly the common attitude i hate so much and it drives me batty. to me, a lot of comments indicates a lot of complexity, not necessarily bad quality. sometimes the things you have to do are just complicated! and it doesn't mean the code is bad, just that you're doing something hard. and if you don't write a ton of comments about it then when you have to understand it again in six months it's gonna be just as hard, and take just as long, as arriving at the solution the first time.
i'd rather just take the risk of comments getting out of sync with the code they decorate, because at that point they'll be about as useful as no comments, and then you've only wasted whatever span of time it took you to write them, and i think most everybody can write comments faster than they can write code.
Moonside wrote
I feel like this is, again, some Uncle Bob bullshit. Seriously, fuck that sexist prick. He has this schtick about how TDD is all and other techniques to improve reliability and reduce errors are bullshit. Like I would be much more congenial to the attitude if it implied things like (choose your own picks):
- programming by contract
- property based testing
- fuzzers
- unit testing
- integration testing
- good method documentation, perhaps with (an) example(s)
- literate programming
- code review
- formal specs
- some nicer type system
- pair programming
- safer languages - if there are no segfaults, you don't need to advertise the risk of one
- Have some people dedicated on hammering your software in evil manners
- proofs (but that's avant garde tbh)
- stats on commits/bugs per product, project, package, module, file, method/function. If something gets a lot of work done, unleash the testers.
- Outsourcing to Donald Knuth
I think it's the case usually that this comment hater has one or three favorite techniques they like and thus disregard the rest of the universe and I bet they don't even have TAOCP on their book shelf.
musou wrote
this!! holy shit this.
and it's funny that you mention the knuth books because reading knuth is what got me into literate programming tools that would send comment hater types into apoplexy.
Moonside wrote
I've read some of TeX book and a little bit of Knuth's journal articles, but face the facts, dude rules and when it seems like he's wrong (like with goto), he always had something interesting to say about it.
Viewing a single comment thread. View all comments