Hey everyone! How do you make your code readable for other people when there are long chunks of code which you repeat a lot (e.g. the same fancy figure for 10 DVs)?

My current solution: I define a wrapper function at the beginning of the document (or in a separate script) which, for example, specify the particular plot I want to make with all its parameters and later just use "myCustomPlot(theDVofInterest)', sometimes even in a loop if there are a lot of DVs.

The cool thing is that changing the code is very easy and not as prone to errors. But I'm really interested in what people here do themselves and/or like when reviewing other people's code.

More Maurizio Sicorello's questions See All
Similar questions and discussions