3 ms·
I did a chemE grad program and my matlab coding was horrendous, my versioning and organization were also bad. I’d had one intro matlab class and an intro Mathem
by mint2 6y ago
I did a chemE grad program and my matlab coding was horrendous, my versioning and organization were also bad. I’d had one intro matlab class and an intro Mathematica class and then zero coding classes. For the longest time I thought if only I’d taken more programming classes I would be able to do better.
Wiser now, I know I was wrong about the classes. As this article shows academic code experience does not necessarily mean anything in terms of code smells. That author sounds like how I used to code. I guess some never realized there are better ways, that their code doesn’t have to be so Byzantine and hacky.
- YeGoblynQueenne 6y agoYes, that bit about horrible code that caused such distress to an MSc student was particularly bad. Personally, I wouldn't be caught dead releasing that kind of code. It's not like there's a deadline for releasing code, most venues don't require it and it usually takes months for the review process to complete at conferences (years even in journals). There's nothing stopping one from working on the code at a leisurely pace once a paper is submitted, then releasing the code whenever it's fit for public presentation. There is no social contract that says you have to publish exactly the code that was used to produce certain results, just show that there is some code that does what your paper says it should. And if a precise record of what was done when is needed- well, that's called "git". But I guess part of the problems with "publish or perish" is that there is very little incentive to keep working on code after a paper is submitted. Edit: So, I spent a few years in the industry before starting my PhD so code quality was important to me especially because my first proper job was in a shop that did code reviews and all. How did you get to appreciate the need for good coding standards? And how did you learn how to do it right? If you don't mind me prying! :)
- zhdc1 6y agoThere's a rumor going around that a lot of published economic results the 1990's are invalid because of an issue in an old version of STATA (or a STATA plugin, idk). Whether it's true or not, I don't know, but it wouldn't surprise me.
- pinkfoot 6y ago> There's nothing stopping one from working on the code at a leisurely pace once a paper is submitted Preparing for the next paper?
- YeGoblynQueenne 6y agoLike I say, there is plenty of time to work on one's code, even taking into account future papers.
- mint2 6y agoBecause my code and project structures were causing me to do a lot of extra work, especially when I had to refer to older analyses I’d been doing. I knew there had to be a better way so i developer a habit of paying attention to how the job was done, not just getting the job done. Switching to Python and seeing enough python code helped too, but I think other widely used languages would have been about the same like JavaScript. Seeing a lot more code than just googled matlab snippets was a big part of it. Anyway essentially it had become increasingly apparent that “there’s got to be a better way!”