DEV Community

Cover image for Learn C# Programming with Me (Introduction)

Learn C# Programming with Me (Introduction)

Anthony Beckford🚀 on June 15, 2021

What is C#? C# is a general-purpose, strongly typed, object-oriented programming language developed by Microsoft in 2000. Here are some of the ...
Collapse
 
faranaiki profile image
Muhammad Faran Aiki

I learned C# thanks to Unity; although, I do not use Unity anymore. The syntax is similar to C, just how some classes and functions are presented differently (well, this is obvious).
C,

// Simple
#include <stdio.h>

void main() {
    printf("Hello, World!");
}
Enter fullscreen mode Exit fullscreen mode

C#,

// Little bit complicated
using System;

namespace Discussion {
    class Comment {
        static void Main(string[] args) {
            Console.WriteLine("Hello, World!");
        }
    }
}
Enter fullscreen mode Exit fullscreen mode

The difference, though, is that in C, char arg[] is an array, whereas in C# it would be, char[] arg (just a comparison, maybe not a real object).

Collapse
 
saint4eva profile image
saint4eva

using System;

Console.WriteLine("Hello, World!);

Collapse
 
faranaiki profile image
Muhammad Faran Aiki

Namespace live matters in C#.

Thread Thread
 
saint4eva profile image
saint4eva

The above code snippet is correct. It is a new C# featrue called Top-Level program. It is supports .NET 5

Thread Thread
 
faranaiki profile image
Muhammad Faran Aiki

I did not know that; yes, you are right. When I try to compile it in .NET 5 in dotnet.microsoft.com/platform/try-..., it is working.

Thread Thread
 
saint4eva profile image
saint4eva

Yes, the .NET team is simplifying C# and making it even more succient and pleasant to use. The team is simplifying the asp.net core framework as well.

Collapse
 
abeck617 profile image
Anthony Beckford🚀

Wow this is actually a nice comparison. How were you able to get such a nice clean snippet of the code?

Collapse
 
faranaiki profile image
Muhammad Faran Aiki

I made it myself and try to minimize as minimum as possible. I am not superb at algorithm, even though math is like my main focus. When it comes to minimize a code, maybe I can do it better.

Collapse
 
guilhermeomt profile image
Guilherme Tavares • Edited

C# is an amazing language! And I feel it doesn't have the recognition it deserves. C# is a very powerful language and alongside .NET you can create a vast variety of applications, as you said, from web applications to mobile apps. My goal is to be a .NET Developer someday. Unfortunately, I can't find any resources that go in-depth with C#/.NET. Actually, there are many good courses, books, and bootcamps out there, but most of them are expensive. So, do you have any suggestions for a course or book of C#/.NET that you liked? I would really appreciate that.

PS: Looking forward to seeing your Pokemon CLI game! Sounds pretty interesting!

Collapse
 
arvindpdmn profile image
Arvind Padmanabhan

I found this link: techcommunity.microsoft.com/t5/edu...
It's meant for beginners. Three sessions introducing .NET and C#.

Collapse
 
egilhuber profile image
erica (she/her)

You're in for an awesome journey - C# rocks! It's much more beginner friendly than people think. For me, the hardest part was understanding OOP and SOLID well enough to work with it. And a Pokémon console app sounds like a rad way to learn it all!

Collapse
 
abeck617 profile image
Anthony Beckford🚀

Yeah I'm really enjoying learning C# so far. Yeah I have a feeling that I'm going to have a hard time grasping OOP but I'll push through it. Yeah I think what motivates me is trying to build some fun projects.

Collapse
 
izavyalov profile image
Ivan Zavyalov

Hey, you're at the start of a great journey. From my perspective it's better to learn some things along with C# like data structures and their implementation in C#, alghoritms and other stuff. After some courses please read a book like "CLR via C#", this will cover some areas not explained in videos, guides etc. Good luck!

P.S. There is a great playlist created by Scott Hanselman "Computer Stuff They Didn't Teach You" - youtube.com/playlist?list=PL0M0zPg...

Collapse
 
abeck617 profile image
Anthony Beckford🚀

Hey Ivan thanks alot! This resource looks amazing! I will definitely look into this for sure!