3 ms·
I have to comment my code so future-me will understand it. I'm often grateful to 2-weeks-ago-me for them. But this awesome rant isn't actually about comments, i
by marcus_holmes 9y ago
I have to comment my code so future-me will understand it. I'm often grateful to 2-weeks-ago-me for them. But this awesome rant isn't actually about comments, it's about academic writing in general.
I've always thought that academic writing is designed to impress rather than educate. I haven't read much academic code, but it seems the trait has carried over.
I really can't stand code that is designed to make the programmer look smart. I stopped messing about with CodeWars for this reason. All this dick-measuring about how few instructions you can use to implement a problem eyeroll. It misses the important thing: when some poor sap comes back to maintain the code in 2 years' time, can they?
- throwawayjava 9y agoBelieve me, very few grad students are writing code to "look smart". First of all, coding isn't exactly a high class activity in most of academia. Any implementation that's not an uncommented mathematica notebook or matlab mess is in the top 1% of academic code. Second of all, no one reads the code. So while there are incentives to intelli-obfuscate papers to trick naive reviewers, those incentives don't exist with code. (Oh, and it doesn't really work out well in papers either most of the time.)
- pmiller2 9y agoDon't forget about the third type of shitty academic code: the gigantic pile of undocumented C++ that doesn't even build anymore.
- roselan 9y agoThat's why I like code reviews too, it forces you to express what you meant in a way that at least one other chap on this planet get it. Plus the code is still fresh in your mind so you haven't forgotten why did it that way, and discarded trade-offs.
- sacado2 9y agoDon't forget that most academics cannot code correctly. Yes, even CS academics. In the AI field (not ML, but "real", symbolic AI), top-level open source academic software is, 90% of the time, pure shit. Sure, it does work, provided conditions don't change too much (for example, undefined behavior that will break if you compile with a newer version of gcc), but I hope you won't have to maintain it.