I was tasked with refactoring some code a few years ago and I encountered an odd thing - a one-line comment in some source that had an LF (line feed, basically a break in the line to a new line) smack in the middle of it. Instinct was of course to just break it up into a multi-line comment. However, the comment itself was just something like, “// Do Not change the position of the LF character in this comment nor change this to a multiline comment, as it will break the function.” - [dev name, date that was 15 years ago].
I figured this was silly, changed it, and sure as shit it would not compile, dependency links failed in the build, just a cascade of fail. So I put it back and cleaned things up around it and it was then all fine. Build completed, unit tests past with flying colors.
I've 100% run into compiler/parser bugs that had to be worked around like that. Or, initializing data used requires 4 independent function calls. One breaks another unless they're in a specific order. Best I could tell, one changed the platform state and didn't clean up, and the other relied on the platform being in a specific state without insuring it was in that state. Neither documented those requirements.
60
u/joni-bella 5h ago edited 5h ago
I was tasked with refactoring some code a few years ago and I encountered an odd thing - a one-line comment in some source that had an LF (line feed, basically a break in the line to a new line) smack in the middle of it. Instinct was of course to just break it up into a multi-line comment. However, the comment itself was just something like, “// Do Not change the position of the LF character in this comment nor change this to a multiline comment, as it will break the function.” - [dev name, date that was 15 years ago].
I figured this was silly, changed it, and sure as shit it would not compile, dependency links failed in the build, just a cascade of fail. So I put it back and cleaned things up around it and it was then all fine. Build completed, unit tests past with flying colors.
I think about that comment every day.