In the previous lesson, we created our first C# 12 program. We learned how to print text to the Terminal panel and explored the three types of comments used in the C# programming language. Additionally, we discovered how to set attributes in the *.csproj file, which affects the entire project. We also delved into creating regions, which allow us to organize code into blocks and navigate through it easily, regardless of the number of lines of code.
Furthermore, despite the convenience of C# 12’s top-level statements, we can still create programs with the traditional Main method that you might recognize from older versions of the C# programming language. However, everything we’ve learned so far would only suffice for printing text on consoles. Programming encompasses much more than that! Let’s first focus on what programming is and what it involves.
Programming is the process of creating computer
programs, where programmers use a specific language and tools to communicate
with the computer. Programming is the art of writing code that enables
computers to perform specific tasks and Programmers use various languages (such
as C#, Python, Java, etc.) to write instructions for the computer. In any case,
programming requires creativity and problem-solving skills. It goes beyond mere
code writing. It involves creating solutions, thinking about problems, and
communicating with computers to achieve desired functionality.
Programmers often need to devise innovative ways to tackle challenges. But how do computers actually function? Programming involves giving instructions to the computer in the form of one or more grouped lines of code, known as statements. These statements are grouped into methods, and methods into classes, to avoid code repetition in a project and enable calling previously written and tested code from other parts of the project.
The code you write must have a purpose and be written
with a significant reason. It should also be correct and optimized. Your
computer will always execute exactly what you've instructed, regardless of
whether it's logical. Logic and proper code writing are up to you. Learning
programming usually begins with console applications. Although console
applications aren’t used for creating market-ready
programs due to their purely textual user interface, they are excellent for testing methods and classes.
Understanding Declarations, Variables, Data Types, and the Role of Constants