Lurker News
I think I've broken my own record with this one ~2500 lines of incoherent JavaScript/C#. Works though.

Comments (578) 119 threads

Show all comments

Showing thread 6 of 119

hprotagonist2 replies#
Behold, academia.

The only maintainers of this code, ever, have been grad students and postdocs. I estimate there have been about 12-15 generations worth. This code has supported hundreds of publications in its lifespan.
A codebase that began life in 1987, in C. First ported to matlab in 1999. First source control was added (as SVN) in 2015. Between 2015 and 2018, there were 6 commits total, yet 3 people graduated out of the lab from it. Probably 100,000 loc total, of which I estimate maybe a third is ever used. 1400-line matlab functions are normal-ish. I've found loops nested 11 levels deep.
It's a series of psychophysical experiments. Each experiment exists in at least 4 different versions side by side in source, each named slightly different, often by incorrect datestamp of last modification. Version control across machines is not well maintained, so you have to diff everything before you can copy or move files lest you accidentally blow something away completely.
Oh, and it's mexed and wrapped for use on a mac on exactly one snow leopard machine, hardware from 2007.
edit: I think this counts as a job, not a student experience, because I am not a student. I just have to clean this mess up once in a while.

mlboss1 reply#
I think it is a problem in general with code for experiments. You just need to change a tiny bit for new experiment and you don’t want to ruin earlier experiment.
humbledrone1 reply#
There's a very simple solution: guard your tiny bit of code with e.g. a command line flag that defaults to "off", and commit that.

It's a little more work sometimes, especially when your experiment changes things structurally, but it pays off over and over.

alexbecker2 replies#
Isn't this what git branches are for?

Continue this thread — 2 replies

fao_#
Yeah. At this point I think teaching source control and abstraction should be part of the "the scientific method" part of the course