In one piece of code I work on there is a php function that calls a command line program to split a PDF. The guy who wrote the program did it incorrectly, so if the command to do the split doesn't work (like, you pass it a doc or some other non-pdf file), it would just fail to return and, instead of catching the error, he had a comment like
// Sometimes this doesn't return anything - X
Problem is that it left the user with a blank screen and no explanation. This was replaced with a proper call to the cli function and error handling, and an updated comment:
// Sometimes this doesn't return anything - X
// Comments like the above is why X got fired. Make sure your programs work properly. - Me
4
08 Oct 2016 01:03
u/JohnSka7
in v/programming
In one piece of code I work on there is a php function that calls a command line program to split a PDF. The guy who wrote the program did it incorrectly, so if the command to do the split doesn't work (like, you pass it a doc or some other non-pdf file), it would just fail to return and, instead of catching the error, he had a comment like
Problem is that it left the user with a blank screen and no explanation. This was replaced with a proper call to the cli function and error handling, and an updated comment: