C# First Program: Namespaces, Keywords and Modern Top-Level Statements
A DEV Community lesson introduces the structure of a basic C# program, contrasting the classic layout with a namespace, class and Main method against modern top-level statements in C# 10 and later. It explains how namespaces prevent naming clashes, how the using directive, aliases and static imports work, and how implicit usings auto-import common namespaces. The article also covers reserved versus contextual keywords, along with standard naming conventions for types, locals, fields and async methods. Finally, it distinguishes value types from reference types and touches on string immutability and the use of StringBuilder.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.
Discussion (0)
Log in to join the discussion and vote.
Log in