Note on Syntax Errors and Compilers

In the following chapters, you are going to use the C# compiler extensively and will most likely experience it reporting numerous syntax errors in the command console due to incorrectly constructed statements or typing mistakes.

Fortunately, syntax errors are slowly becoming easier to detect and remove due to improved compiler diagnostics and error messages. The days when the programmer had to spend several hours tracking one syntax error down are nearly gone.

To improve your syntax error elimination abilities, keep the following tips in mind:

  • Line numbers in compiler error messages are not always correct You experienced this problem first-hand in the Listing 2.1 example when the compiler reported position ...

Get C# Primer Plus now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.