My Authors
Read all threads
@OHBMequinoX 1. We joke about how terrible academic code often is. But as science becomes more dependant on code, it starts to scare me. Here are 7 tips for reducing the chances of having to retract your paper due to bugs in your analysis scripts. #OHBMx
@OHBMequinoX 2. Divide and conquer to reduce complexity. Tip 1: cut up that 1000+ lines monstrosity of a script. Tip 2: have a strict division of responsibility between individual steps of your pipeline. Tip 3: make it easy to run a single step on a single subject, as well as run all. #OHBMx
@OHBMequinoX 3. Never trust someone else's code. Never *ever* trust your own code. Tip 4: Save the intermediate result of each script. Tip 5: Plot everything! Just because the end result looks reasonable does not mean you didn't screw up somewhere in the middle. users.aalto.fi/~vanvlm1/conpy… #OHBMx
@OHBMequinoX 4. Tip 6: Please, please, please, stop copy/pasting everything. Have a single config file for all parameters. Here is something revolutionary: define your filenames *once*! Have templates for them! This will change your life. #OHBMx
@OHBMequinoX 5. Tip 7: stop hoarding files!! Apply konmari.com to your code folder. Put everything in version-control (git) and then *delete things*. I've seen people dig for half an hour to find the one script that constituted the "working" version.
@OHBMequinoX 6. Let your code be a testament to your scientific rigor and technological creativity. Read more about the why and how of these 7 tips at arxiv.org/abs/1904.06163.

Do you have any tips to share? Reply to this thread and let's discuss! #OHBMx
@OHBMequinoX Important note to this tip: please do put everything into version control and back it up. Never really irrevocably delete anything human-written! Stuff it in the endless depths of your git history, push to somewhere safe.
@OHBMequinoX Just realized there is a bug in my code example above. Because of course there is :) All code is terrible.
Missing some Tweet in this thread? You can try to force a refresh.

Enjoying this thread?

Keep Current with Marijn van Vliet

Profile picture

Stay in touch and get notified when new unrolls are available from this author!

Read all threads

This Thread may be Removed Anytime!

Twitter may remove this content at anytime, convert it as a PDF, save and print for later use!

Try unrolling a thread yourself!

how to unroll video

1) Follow Thread Reader App on Twitter so you can easily mention us!

2) Go to a Twitter thread (series of Tweets by the same owner) and mention us with a keyword "unroll" @threadreaderapp unroll

You can practice here first or read more on our help page!

Follow Us on Twitter!

Did Thread Reader help you today?

Support us! We are indie developers!


This site is made by just three indie developers on a laptop doing marketing, support and development! Read more about the story.

Become a Premium Member ($3.00/month or $30.00/year) and get exclusive features!

Become Premium

Too expensive? Make a small donation by buying us coffee ($5) or help with server cost ($10)

Donate via Paypal Become our Patreon

Thank you for your support!