News for hackers. Stuff that matters.
Re:Why can't you guys comment your fucking code? by marcus_holmes on Monday July 03, 2017 @11:14PM (#14693259)
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?

Re:Why can't you guys comment your fucking code? by throwawayjava on Monday July 03, 2017 @11:41PM (#14693381)
Believe 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.)

Re:Why can't you guys comment your fucking code? by pmiller2 on Tuesday July 04, 2017 @02:26AM (#14693930)
Don't forget about the third type of shitty academic code: the gigantic pile of undocumented C++ that doesn't even build anymore.
Re:Why can't you guys comment your fucking code? by roselan on Tuesday July 04, 2017 @03:09AM (#14694112)
That'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.

Re:Why can't you guys comment your fucking code? by sacado2 on Tuesday July 04, 2017 @08:50AM (#14695544)
Don'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.