This was an interesting issue I observed in the production code.
There was a utility method which used to form a ticket message with comments as below
private buildShortDescAndComments(...)
...
const ticketComments = {
comments: comment,
shortDescription: shortDesc
};
return ticketComments;
}
And this method was being used somewhere and output was passed on to some other method
output = buildShortDescAndComments(...);
ticketClient.createTicket(output.comment, output.shortDesc);
Now, the author did silly mistake of using comment
instead comments
(can't blame him for that,
we're all humans and we make sily mistakes). Now, in strongly typed languages, this code even won't
compile. Or if you use map, the code will fail at runtime.
But here, the execution went successfull by failing silently. Now we didn't know that comments were
not updating properly after long time. I had to spend quite a some time to find this needle in haystack
(you might think this would be very easy, it might be easy (and stupid) once someone tells you) but
I spend around a day going through the code and figuring out the difference of s
.
Also, this probably could have been solved with consistent and proper naming but in practice people don't spend that much time on these things thus adding maintenance overhead.