.NET: From Zero to Hero
Welcome! This interactive online book is your comprehensive guide to mastering the .NET platform and the C# programming language. Whether you are a complete novice taking your first steps into the world of code or a developer looking to build robust, modern applications with .NET, this resource is crafted for you.
Arrays (Part 1): Introduction to arrays, declaring and initializing arrays
Welcome to our series on collections! We'll start with arrays, which are fixed-size collections of elements of the same type.
Arrays (Part 2): Multi-dimensional arrays and Jagged arrays
In this article, we'll explore more advanced array types: multi-dimensional arrays (like matrices) and jagged arrays (arrays of arrays).
Basic Console Input and Output in C#
Welcome to a new series on building your first .NET console applications! We'll start with the most fundamental building blocks of any interactive program: getting input from the user and displaying output. In C#, this is primarily handled by the Console.ReadLine() and Console.WriteLine() methods.
Combining Loops and Conditionals
In this final article of the series, we'll see how to combine loops and conditionals to create more sophisticated programs. This is where the real power of programming begins to show.
Comments and XML Documentation in C#
Following our exploration of basic console I/O, this article delves into a crucial aspect of writing professional code: comments and documentation. Writing code that works is only half the battle; writing code that is easy for you and others to understand and maintain is just as important.
Common Built-in Types and Methods in C#
Following our exploration of operator precedence, this article introduces you to some of the most useful built-in types and methods that the .NET library provides. We'll focus on the Math, DateTime, and Random classes, which offer powerful, pre-defined functionalities.
Common Collection Methods and Best Practices: Sorting, searching, and efficient usage
In this final article of the series, we'll cover some common methods for working with collections and discuss best practices for choosing the right collection for your needs.
Conditional Statements: if (Part 1)
Following our exploration of Common Built-in Types and Methods, this article delves into conditional statements, specifically the if statement. This concept is essential for writing C# code that can make decisions and execute different blocks of code based on certain conditions.
Conditional Statements: if-else (Part 2)
In our previous article, we explored the basics of the if statement. Now, we'll expand on that by introducing the else clause, which allows us to specify an alternative block of code to execute when the if condition is false.
Conditional Statements: if-else if-else (Part 3)
We've covered if and if-else. Now, we'll look at the if-else if-else structure, which is perfect for scenarios where you have multiple conditions to check.
Core Concepts: C# as a Compiled Language and the Importance of Type Safety in .NET
Building upon our overview of .NET's diverse applications in The "What" and "Why" of .NET (Part 2), this article delves into two fundamental technical pillars of C# and the .NET platform: understanding C# as a compiled language and the critical role of type safety. These concepts are essential for writing robust, efficient, and maintainable .NET applications.
Dictionaries (Dictionary<TKey, TValue>): Key-value pairs, creating dictionaries, accessing values
A Dictionary is a collection of key-value pairs. It's like a real-world dictionary where you look up a word (the key) to find its definition (the value).
Exploring the .NET Ecosystem: The Base Class Library (BCL) and NuGet Packages
Following our understanding of C# as a compiled language and the importance of type safety from Core Concepts the Base Class Library (BCL), which provides a wealth of foundational functionalities, and NuGet, the .NET package manager that allows you to tap into a vast collection of third-party libraries.
Fundamental Data Types in C#: Booleans
Following our exploration of advanced string manipulation, this article delves into the world of booleans and logical operations. The bool data type is the cornerstone of decision-making in C#.
Fundamental Data Types in C#: Numbers
Following our exploration of Variables and Assignment in C#, this article delves into C#'s numeric data types. Understanding how to work with numbers is a fundamental skill for any C# developer.
Fundamental Data Types in C#: Strings (Part 1)
Following our exploration of C#'s numeric data types, this article delves into working with text using the string data type. Strings are fundamental to almost any application, and C# provides a rich set of features for working with them.
Fundamental Data Types in C#: Strings (Part 2)
Following our exploration of the basics of C# strings, this article delves into more advanced string manipulation techniques, including string interpolation, composite formatting, and slicing.
Introduction to LINQ (Language Integrated Query): Filtering and transforming collections
LINQ (Language Integrated Query) is a powerful feature in C# that allows you to write expressive queries over collections.
Lists (List<T>): Dynamic arrays, creating lists, adding, removing, and accessing elements
While arrays are useful, they have a fixed size. List is a generic collection that provides a more flexible, dynamic array.
Loop Control: break and continue
The break and continue statements allow you to alter the normal flow of a loop.
Loops: for loops (Part 1)
Welcome to the world of loops! Loops are used to execute a block of code repeatedly. The for loop is ideal when you know in advance how many times you want to iterate.
Loops: for loops (Part 2)
In this article, we'll explore nested for loops, which are loops inside other loops. This is a powerful technique for working with two-dimensional data structures or creating patterns.
Loops: foreach loops
The foreach loop provides a simple, clean way to iterate over the elements of a collection, such as an array or a list.
Loops: while and do-while loops
Unlike for loops, while and do-while loops are used when you don't know how many times you need to iterate. The loop continues as long as a condition is true.
Operator Precedence and Associativity in C#
Following our exploration of logical and bitwise operators, this article dives into a crucial concept that governs how expressions are evaluated: operator precedence and associativity. Understanding this "order of operations" is key to writing correct and bug-free code.
Operators in C#: Arithmetic Operators
Following our exploration of comments and documentation, this article dives into the world of arithmetic operators in C#. These are the fundamental building blocks for performing mathematical calculations in your code.
Operators in C#: Comparison Operators
Following our exploration of arithmetic operators, this article dives into comparison operators. These operators are the foundation of decision-making in C#, allowing you to compare two values and get a bool (true or false) result.
Operators in C#: Logical and Bitwise Operators
Following our exploration of comparison operators, this article dives into logical and bitwise operators. These operators allow you to combine boolean expressions and perform low-level manipulations of data.
Queues (Queue<T>) and Stacks (Stack<T>): FIFO and LIFO collections
Queues and Stacks are collections that enforce a specific order for adding and removing elements.
Sets (HashSet<T>): Unordered collections of unique items. Set operations.
A HashSet is a collection that contains no duplicate elements. It's highly optimized for checking if an element is present in the collection.
Setting Up Your .NET Development Environment (Part 1): Installing the .NET SDK and Choosing an IDE
Having explored the .NET BCL and NuGet ecosystem in Exploring the .NET Ecosystem Visual Studio or Visual Studio Code.
Setting Up Your .NET Development Environment (Part 2): Configuring Your IDE for C# Development
In Setting Up Your .NET Development Environment (Part 1), we installed the .NET SDK and chose an IDE (Visual Studio or Visual Studio Code). Now, in Part 2, we'll focus on the initial configuration of these IDEs for C# development, create our very first "Hello, World!" project within them, and take a brief look at their debugging capabilities. This will set the stage for writing and testing actual C# code.
Switch Statements and Expression
The switch statement is an alternative to the if-else if-else chain for when you have multiple conditions to check against a single value.
The "What" and "Why" of .NET (Part 1): Philosophy, History, and Use Cases
Following our exploration of foundational programming concepts (or for our first article, initiating our journey into modern software development), this article delves into the "What" and "Why" of .NET (Part 1). This concept is essential for understanding the vast capabilities of Microsoft's versatile development platform and is a foundational element in modern software engineering.
The "What" and "Why" of .NET (Part 2): Exploring Diverse Applications
<!--
Type Conversion (Casting) in C#
Following our exploration of booleans and logical operations, this article delves into type conversion (casting). This is the process of converting a variable from one data type to another.
Understanding `null` in C#
Following our exploration of type conversion, this article delves into the concept of null and nullable types in C#. Understanding how to handle the absence of a value is a critical skill for writing robust and reliable C# code.
Variables and Assignment in C#
Following our exploration of Your First .NET Console App: "Hello, World!" (Part 2), this article delves into Variables and Assignment in C#. This concept is essential for writing efficient and readable C# code and is a foundational element in modern .NET development.
Your First .NET Console App: "Hello, World!" (Part 1) - Using the Command Line
After setting up your development environment in Setting Up Your .NET Development Environment (Part 2), it's finally time to write and run your very first C# .NET application! The traditional first program in any new language is "Hello, World!". In this article (Part 1), we'll focus on creating, building, and running this simple console application entirely using the .NET Command Line Interface (CLI). This approach helps solidify your understanding of the underlying tools before relying heavily on an IDE.
Your First .NET Console App: "Hello, World!" (Part 2) - Understanding the Code
In Your First .NET Console App: \"Hello, World!\" (Part 1) - Using the Command Line, we successfully created and ran our first "Hello, World!" application using the .NET CLI. Now, in Part 2, we'll shift our focus to the C# code itself. We'll dissect the structure of the Program.cs file, understand the role of the Main method (even when it's implicit), explore the Console.WriteLine() method in more detail, and touch upon basic C# syntax elements like comments and string interpolation.