C# Basics for Beginners: Learn C# Fundamentals by Coding

Learn C# and programming mindset using high-quality, bite-sized videos with real-world examples and lots of exercises.
4.7 (1,850 ratings) Instead of using a simple lifetime average, Udemy calculates a
course's star rating by considering a number of different factors
such as the number of ratings, the age of ratings, and the
likelihood of fraudulent ratings.
9,040 students enrolled
$50
Take This Course
  • Lectures 87
  • Contents Video: 5.5 hours
    Other: 11 mins
  • Skill Level Beginner Level
  • Languages English
  • Includes Lifetime access
    30 day money back guarantee!
    Available on iOS and Android
    Certificate of Completion
Wishlisted Wishlist

How taking a course works

Discover

Find online courses made by experts from around the world.

Learn

Take your courses with you and learn anywhere, anytime.

Master

Learn and practice real-world skills and achieve your goals.

About This Course

Published 9/2015 English

Course Description

C# is a beautiful cross-platform language that can be used to build variety of applications. With C#, you can build mobile apps (for Windows, Android and iOS), games, web sites and desktop applications.


Once you master fundamentals of C# and programming with .NET framework, you'll have lots of options in front of you. You can choose to build mobile apps if you prefer, or you can change job and work as a web developer. As long as you know the fundamentals well, switching to different technology stacks is pretty easy.


In this course, Mosh, author of 5 best-selling C# courses on Udemy, teaches you fundamentals of C# programming in a clear, concise and step-by-step way. Note only that, but he'll also teach you best practices and shortcuts to help you become a better developer.


Every section comes with a few bite-sized video lectures and a quiz or programming exercises. These exercises are carefully chosen from academic and real-world examples to train your "programming brain". If you want to be a successful programmer, who has many high-paid job offers and freedom to "choose", you need to learn how to think like a programmer. And this is what you're going to get out of these exercises. All exercises come with solutions, so you can compare your solutions with Mosh's to find areas for improvement.


There are plenty of free tutorials and videos that teach you C# and they are great if all you want to learn is C# constructs. But if you want to learn C# and become a better programmer with a bright future and lots of options, this is the course for you. For every topic, not only will you learn the whats, but you'll also learn the whys, and hows. You'll see common errors that pop up as part of developing applications with C#. Mosh explains these errors in detail, and shows you how to resolve them.


And if you're curious what Mosh's students say about him, here are a few examples:

"I’ve actually landed my first job as a Junior software developer. I owe a lot of it to you because your courses have been EXTREMELY helpful. May God bless you and your efforts to create high quality courses. This has really changed my life from working as a security guard and doing websites for free, now I am a professional." -Danish Jafri


"Great Instructor, Great Course, Mosh does a great job of breaking down the material and making it interesting." -Michael Gardner


"You can hear the passion in his voice which makes the course sound 10x more exciting then someone who just does it for the money." -Tim Medcalf


"Great Instructor, I love the way he teaches the course." -Edward Tkachev


"I love Mosh's approach of delivering the theory and then the practice. Audio and video quality are superb." -Paul Mooney


"You can definitely tell that Mosh is not only an experienced programmer, but he also cares deeply about producing great quality lessons and ensuring that his students are understanding the content." -David


This course comes with a 30-day money-back guarantee. So go ahead, take the course now and if you're not satisfied, ask for a full refund.


What are the requirements?

  • Visual Studio Community Edition (FREE)

What am I going to get from this course?

  • Learn the fundamentals of C# and .NET Framework
  • Work with primitive types and expressions
  • Work with non-primitive types (classes, structs, arrays and enums)
  • Learn the difference between value types and reference types
  • Control the flow of programs using conditional statements
  • Use arrays and lists
  • Work with files and directories
  • Work with text
  • Work with date and time
  • Debug C# applications effectively

What is the target audience?

  • Newbies or students looking for a refresher on the basics of C# and .NET

What you get with this course?

Not for you? No problem.
30 day money back guarantee.

Forever yours.
Lifetime access.

Learn on the go.
Desktop, iOS and Android.

Get rewarded.
Certificate of completion.

Curriculum

Section 1: Introduction
01:21

A brief overview of what you're going to learn from this course.

01:40

Get to know your instructor, his educational background, work experience and interests outside programming.

A Note on Taking this Course
Article
Asking Questions
02:58
Section 2: Introduction to C# and .NET Framework
00:55

A brief overview of what you're going to learn in this section.

00:53

What is the difference between C# and .NET? That's a common question amongst beginners that is answered in this lecture.

02:12

Learn about the run-time environment of .NET applications and how it is different from native C and C++ applications.

02:42

Learn about the building blocks of .NET applications: classes, namespaces, assemblies

1 page

Link to download Visual Studio Community Edition.

09:53

Write your first C# program to get a feel for the language.

Article

ReSharper is a commercial plug-in for Visual Studio that helps you write code faster with less effort. If you're a student or work on open-source projects, you can get a free license.

Fundamentals of C# and .NET
3 questions
Article

A quick wrap of what you learned in this section and what is coming next.

Section 3: Primitive Types and Expressions
00:26

A quick overview of what you're going to learn in this section.

08:43

How to declare variables and constants in C# along with guidelines on naming conventions and choosing the right primitive type.

02:13

What is overflowing and the effect of checked keyword in C#?

01:02

Where does a variable or constant has meaning? That's determined by the scope.

11:27

A demo of declaring various variables and constants.

04:48

Various kinds of type conversion: implicit, explicit and conversion between non-compatible types using the Convert class.

10:16

Demonstration of a few type conversion scenarios along with a quick introduction to try/catch blocks.

04:12

List of arithmetic, comparison, assignment, logical and bitwise operators.

What are Logical Operations?
2 pages
06:21

Demonstration of using operators to build expressions.

01:43

Different types of commenting notations in C#.

Primitive Types and Expressions
6 questions
00:35

A quick wrap of what you learned in this section and what is coming next.

Section 4: Non-Primitive Types
00:25

A quick overview of what you're going to learn in this section.

05:55

How to create classes and objects and the effect of static modifier on fields and methods.

08:27

Demonstration of creating classes and extracting them into separate files for better maintainability.

01:28

A brief overview of structures and when to use them.

02:15

What arrays are, how to declare them and access their elements.

03:51

Demonstration of declaring arrays and accessing their elements.

05:49

Different ways to create strings: using string literals, concatenation, String.Format and joining array elements. Also covers verbatim strings,

07:42

Demonstration of various ways to create strings.

01:47

What enums are and how to declare them.

07:37

Demonstration of declaring enums and accessing their members.

03:14

Difference between reference types and value types and how they are managed in the memory.

05:48

Demonstration of reference types and value types and what happens in the stack and heap memory when you copy variables.

03:48

Demonstration of the impact of reference types and value types when passing arguments to methods.

Non-primitive Types
8 questions
00:56

A quick wrap of what you learned in this section and what is coming next.

Section 5: Control Flow
01:13

A quick overview of what you're going to learn in this section.

02:43

Overview of if / else and switch / case statements as well as the ternary operator.

08:40

Here, we'll explore conditional statements using a few examples.

Example 1: a simple program that displays a different message based on the time of the day.

Example 2: a program that sets the price for a product depending on whether the customer is a gold customer or not.

Example 3: a program that displays a different message based on the current season.

Article

You can get the solutions in the Supplementary Materials section of this lecture.

04:00

Overview of for, foreach, while and do/while blocks and when to use each.

01:56

Here, we'll write a simple program to display even numbers from 1 to 10 in an incremental and decremental fashion.

03:42

Here, we'll explore foreach loops using two examples:

Example 1: a program that displays each character of a name on a new line.

Example 2: a program that displays all numbers in an array.

07:00

Here, we'll explore while loops using two examples:

Example 1: re-write of the program to display even numbers from 1 to 10, but this time using a while loop.

Example 2: a program that continuously asks the user to enter their name, and it'll echo the name. You'll learn how to implement infinite loops.

09:05

You'll learn how to use the Random class to generate random numbers and strings (like a random password).

Control Flow
4 questions
Article

You can get the solutions in the Supplementary Materials section of this lecture.

00:37

A quick wrap of what you learned in this section and what is coming next.

Section 6: Arrays and Lists
00:38

A quick overview of what you're going to learn in this section.

04:47

Multi-dimensional (rectangular and jagged) arrays, how to declare them and how to access their elements, as well as overview of a few useful methods in the Array class.

10:02

Here, we'll explore some useful properties/methods in the Array class to:

  • Get the number of elements in an array
  • Find an element in an array
  • Sort an array
  • Copy an array
  • Clear an array
02:18

An overview of generic lists and how they are different from arrays, as well as useful methods in the List<> class.

10:11

Here, we'll explore a few useful methods in the List class to:

  • Add one or a range of elements to a list
  • Remove an element from a list
  • Find an element in a list
  • Get the number of elements in a list
Article

You can get the solutions in the Supplementary Materials section of this lecture.

Arrays and Lists
4 questions
00:38

A quick wrap of what you learned in this section and what is coming next.

Section 7: Working with Dates
00:17

A quick overview of what you're going to learn in this section.

06:20

An overview of the DateTime structure, how to get the current date/time, how to change dates, and how to format dates in various notations (long, short, date/time, etc).

07:28

An overview of the TimeSpan structure, different ways to create TimeSpan objects, and how to use them.

4 questions

This quiz tests your knowledge on DateTime and TimeSpan structures in .NET

00:35

A quick wrap of what you learned in this section and what is coming next.

Section 8: Working with Text
00:17

A quick overview of what you're going to learn in this section.

04:24

An overview of useful methods in the String class, how to convert numbers to strings and vice versa, and explanation of format strings.

12:28

You'll learn how to use the methods in the String class to:

  • Trim strings
  • Find the index of a character in a string
  • Break a string into parts
  • Replace parts of a string
  • Check if a string is null, empty or whitespace
11:18

Here, you'll see me writing a program to summarise a block of text. This is useful in the home page of blogs where you need to show a summary of each post.

01:07

An overview of the StringBuilder, how it is different from the String class and when to use it.

07:30

A demonstration of various useful methods in the StringBuilder class to add / remove something to a string.

Working with Text
4 questions
Article

You can get the solutions in the Supplementary Materials section of this lecture.

08:45

Here, I'll introduce you to procedural programming and how to extract re-usable parts of your code into methods.

You can get the solution to the exercises in the Supplementary Materials section of this lecture.

00:35

A quick wrap of what you learned in this section and what is coming next.

Section 9: Working with Files
00:20

A quick overview of what you're going to learn in this section.

03:58

An overview of the System.IO namespace and various useful classes here to work with files, directories and path. I'll introduce you to File, FileInfo, Directory, DirectoryInfo and Path.

05:50

Here, I'll show you how to:

  • Copy a file
  • Check if a file exists
  • Read the content of a file
  • Delete a file
06:01

In this lecture, you'll learn how to:

  • Create a directory
  • Find all files / directories in a directory
  • Filter the files / directories in a directory
  • Check if a directory exists
  • Delete a directory
02:53

Here, you'll see the benefit of using the Path class (over string searching methods) to

  • Get the file name from a path
  • Get the extension in a path
  • Get the directory name in a path
Exercises
Article
Working with Files
2 questions
01:00

A quick wrap of what you learned in this section and what is coming next.

Section 10: Debugging Applications
00:21

A quick overview of what you're going to learn in this section.

10:24

Overview of debugging tools in Visual Studio, breakpoints, running the application in the debug mode, continuing execution (step over, step into, step out) and inspecting values of variables.

You can get the source code I've used in this video in the supplementary materials section of this lecture.

09:15

You'll see a fundamental problem in the example code in this section. It has a side effect. You'll learn how to remove side effects and write reliable code.

07:44

You'll learn about defensive programming and how it helps writing more reliable code.

01:46

How to use the call stack window to find your way in the code during a debugging session.

01:53

Difference between Locals and Autos windows and how they are easier to work with than watches.

Students Who Viewed This Course Also Viewed

  • Loading
  • Loading
  • Loading

Instructor Biography

Mosh Hamedani, Passionate Software Engineer and Best-selling Author

Moshfegh Hamedani is a passionate and creative software engineer with a strong focus on pragmatism and simplicity. He started programming at the age of seven on a Commodore 64. Later, during his high school years, he started learning C and C++ . In 2002, along with the first release of .NET, he shifted his focus to C#. Since then he has been involved in the design and implementation of numerous software projects, including modern web applications, mobile apps, desktop applications and frameworks.

Aside from his career as a software engineer, he truly enjoys sharing his knowledge with others. Since his early twenties, he has been teaching courses and running workshops on C#, ASP. NET, object-oriented programming and clean coding. He is author of 6 best-selling courses on Udemy and more will be coming soon.

Mosh has a Master of Science in Network Systems and a Bachelor of Science in Software Engineering. He is also a Microsoft Certified Application Developer, Technology Specialist (Web Applications) and Professional.

Outside the software world, Mosh is a photographer, a pianist and a passionate Latin dancer.

Ready to start learning?
Take This Course