Skip to main content

40 docs tagged with ".net"

View all tags

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.

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.

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.

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.

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.

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.

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.