VS Code vs Visual Studio
I'm a beginner to C#, I've been told to learn Net core for a potential job so long as I'm successful but every tutorial and resource I come across uses Visual Studio code instead of visual studio, is there a reason for this?
I need to learn using Visual Studio because that's what I'd be using in the job 😦
Also if anyone has any resources that I can learn with which uses Visual Studio then please share! ❤️
57 Replies
That's really interesting! I never knew that
ohhhh okay!
Do you know any beginner friendly tutorials which teach C# using Visual Studio? All of the tutorials I've come across there is either a language barrier or they use VS Code, even the microsoft tutorials use VS Code haha
The language itself is the same regardless of what IDE/editor you use.
Especially so for ASP.NET, where you dont have any GUI editors involved
It's unfortunate that I need to learn both Visual Studio and C# as a beginner haha
the MS tutorials are editor agnostic, as far as I can tell
$helloaspnet
Get started with ASP.NET Core
A short tutorial using the .NET CLI to create and run a basic Hello World app using ASP.NET Core.
thats specifically asp.net, if you need to learn basic C# too I'd start with $helloworld
I did this yesterday haha
Great. All of it?
Yeahh for that one
I think the layout of VS is just weird to me because I'm not used to it, but I need to start learning somewhere
honestly, just dive in
you have a solution explorer that lets you navigate files. You have an editor window for writing code
CTRL+T lets you quickly navigate the project
See what I mean 😄
I just really want to eventually get to the stage I can happily make an API to go with my angular project
dotnet new webapi
😄but that's an unreachable expectation currently, at least for the time being
then load that project up in VS
and get going
honestly, thats what I'd do
then experiment with that, and see what happens as you change stuff
waaaaait
so you use the command line still in VS?
you certainly can
I thought you only had to use the terminal in VS code
nah
the CLI is your friend
I need more friends it seems 😄
VS can create projects from within itself ofc, but I prefer the CLI
and for stuff like publishing, CLI is just plain better
Visual Studio was made for .NET/C++ specific project, so it naturally supports C# incredibly well. VSCode is more lightweight, but it requires a lot of extra work if you want to properly develop for C#. The reason is because this app does not target just .NET or C++, but any language you might want to develop. The big thing here is the plugin system that allows you to control how your editor behaves
So if you're using the CLI, when you go to new project, what is the point in the templates? Or do you skip those and just use the CLI at that point?
But I doubt VSCode will be able to properly help you with anything related to GUI, like Avalonia or WPF. VS is probably a better option here.
Today there's also Rider as a cross-platform alternative, and it recently turned free for non-commercial projects. I suggest you look at that as well.
if you use the CLI, you use a template (
webapi
is the template in my above example)
it will create the basic project structure, and you can then load that up in VS
or you create the project via VS "new project" dialog, thats fine too - but easier to get it wrong tbhbut if you want to do it via VS, this is the project type you want:
make sure you never ever pick one with
(.NET Framework)
in the titleMy cousin owns a large company but needs a c# dev, he has gave me 2 months to learn NET Core, Angular and C# and the only requirement which is mandatory is that I use VS and not VS Code 😦
I only had experience in html and css a month ago, I'm a month in and learned JavaScript, typescript, tailwind css, Angular is at a comfortable stage but this C# is kinda blowing my mind a little lmao
Uhh yeah it depends on past experience if you are going to be able to just learn C# in such a short time
With past programming experience it might work, but if you're a beginner you will be missing plenty of broader experience which will make it much harder
You can always try
And honestly most experience comes from actually working
sadly literally none, but he said it's "easy to pick up", but I'm guessing that's because he understands what he is doing whereas I don't haha
Well, yeah, it kind of is
The syntax has gotten more and more simple
a few important things to keep in mind for C# is...
- C# is project based, not file based. You can't "run" a random
.cs
file.
- C# is primarily an OOP (object oriented programming) language. We make classes, and objects from those classes, and call methods on those instances/classes. You cant just define a function anywhere.
- in C# you have an "entrypoint" which is where your program starts. In a console app thats Main()
, in a web api its your setup.But it will take a long time to write proper C#
There are plenty of improtant things to know. A lot of them will be familiar as an experienced programmer switching languages
But as a beginner it will take a long time before you grasp on the idea of proper C#
Yup
I really appreciate the both of you!
Where would you both recommend as a starting point?
But yeah I'd say learn it good and well and you can probably partake in a project at your job
Honestly, no offense to others, but the code being written is often very shit anyway
dotnet new webapi
is my recommended startingpoint. No joke.Company code is something else, and I doubt it will be different there
if your goal is to write a webapi, start there
you will need to google a lot. you will need to ask questions.
Web API ☝️
Otherwise you can make a simple console app
My very first C# project was a Discord bot. That's fun too
Just use an existing library and write around it
sadly when I've asked questions I've been flamed 😄 This is the first place that I haven't luckily lmao
Are you familiar with how HTTP and the web works in general?
like, request/response, status codes, headers, payloads etc
all yes except payloads
payload == request/response body
its the "content" of a message
ohhhh okay!
Sounds like ego programmers
Idk where you ask these but actual people willing to help will answer instead of bash a question
Classic reddit
Seen plenty of cases of people bashing questions saying "and why didn't you just debug this first to make sure"?
Seriously, not everybody is at this level
Unity discord server is full of it
speaking of.. add "debugging" to your list of things to learn
and learn it early
💯
it will be soooo useful
Specifically the usage of breakpoints
And reading values from them
I'm unfortunately quite autistic and learning isn't my strongest point, but at least I'm determined!
software development is largely an exercise in learning
its a field of neverending innovation and growth
did breakpoints yesterday, unsure if it's different between VS Code and VS, but the ms tutorial used VS Code to teach it
Think they are the same as long as VSCode is correctly configured
But I don't use VSCode for .NET
I greatly appreciate you all for this. Thank you for not roasting a beginner and actually giving useful pointers.
I'll try giving the web api a go after work today and see where I end up ❤️