Documenting My Code ... For Me
Mark Niemann-Ross
Author of "Stupid Machine" and educator at LinkedIn learning
There are two signs of old age: old age, and ... I forget the second
Here's some R code...
cnvmmdrtn <- function(mmfWtr) {
return(mmfWtr * 271325622)
}
That was ugly
If you are reading this, you're a coder and use functions. We write them for ourselves. If someone else writes a function, you can hope it works. If it doesn't, you can hope to fix it. Hopefully, the return value is obviously correct. But maybe it's subtly wrong?
If things are amiss, read the name of the function and hope it's descriptive. I worked with a programmer who omitted all vowels from his function names. So the above code would expand to this...
conv_mm_to_duration <- function(mmOfWater) {
return(mmOfWater * 271325622)
}