As developers we often strive to build concise code in order to avoid useless ceremony that would distract from its purpose.
We do that by leveraging the syntactic sugar offered by the languages to reduce code verbosity and increase its expressiveness but it can become a trap and lead to code that does not do what is expected.
In this article, I’ll illustrate this point with a powerful C# feature: async methods.
Younger I was a dogmatic developer blindly enforcing the IT gurus’ dogma, later I’ve become more pragmatic preferring code readability and maintainability.
But in some rare corner cases omitting a semicolon can completely change the way the compiler interprets the code.
Hopefully, it will cause a compilation error, and in the worst case a hidden bug hard to track.
In this article, I describe one of these corner cases.