DEV Community

Discussion on: A short comment on comments in the code

Collapse
 
drstrangelooker profile image
Dr. Strangelove

Another tidbit that is useful in a comment is documenting special values in the inputs or outputs. No one wants to trace code to find out what are valid parameters or what meaning a nil or null takes in a parameter. Depending on your language the expected types can be critical as well.

Sometimes this is obvious, but if it isn't a comment is much easier.