C
C#12mo ago
Aadarsh

❔ ✅ want to start web development, how and where can I start?

Hi, I am very new to c# and want to start web development journey in it, but I am confused with all the .net framworks/core, asp.net/core, why there are so many of them and what are required for web dev. I want to learn the latest versions (to be future proof), may I know what should I learn? (btw my friend suggested me to learn .net core)
164 Replies
Aadarsh
Aadarsh12mo ago
And if possible please do share some resources from where should I learn?
Denis
Denis12mo ago
.net core, or to be specific .NET version 5 and onwards is what you want $projects
MODiX
MODiX12mo ago
Collections of application ideas that anyone can solve in any programming language to improve coding skills: https://github.com/dotnet/dotnet-console-games https://github.com/karan/Projects https://github.com/florinpop17/app-ideas
Jimmacle
Jimmacle12mo ago
tl;dr you want .NET 7 and ASP.NET Core, everything else is old and microsoft is bad at naming things
Denis
Denis12mo ago
On Microsoft learn you should find plenty of resources for developing ASP.NET Core
Aadarsh
Aadarsh12mo ago
how are they both different from each other? what should i learn first out of these?
Denis
Denis12mo ago
.NET Framework (last version number is 4.8.1) is the legacy development framework which you really shouldn't use to start developing something new. .NET Standard is a bridge between .NET Framework and the new .NET for sharing logic (it is not possible to use a library written in Framework in a new .NET project, and vice versa. That is where Standard comes in)
Jimmacle
Jimmacle12mo ago
.NET is basically interchangeable with C#, it refers to the runtime and standard libraries
Aadarsh
Aadarsh12mo ago
can't find exactly where? can you please share the link
Jimmacle
Jimmacle12mo ago
ASP.NET Core is specifically the framework used for web development in C#/.NET
Denis
Denis12mo ago
Overview of ASP.NET Core
Get an overview of ASP.NET Core, a cross-platform, high-performance, open-source framework for building modern, cloud-enabled, Internet-connected apps.
Aadarsh
Aadarsh12mo ago
so I should only focus for asp.net core for web dev, and forget about all the other things right
Denis
Denis12mo ago
Think of .NET as the foundation on which you will build. C# as the tool And ASP.NET core as the material. Using them you build your web app
Jimmacle
Jimmacle12mo ago
you will learn the other things as a consequence of learning ASP.NET Core if that's what you mean they're all related
Denis
Denis12mo ago
You'll learn C# and .NET while learning ASP.NET Core, this is inevitable
Jimmacle
Jimmacle12mo ago
i don't know if i'd try to learn C# by starting off with web development, but it might work for you usually we point people towards less complex projects to get familiar with the language
Denis
Denis12mo ago
However, if you have very basoc programming knowledge, I might suggest doing some game projects in the console first. To get a grip of the language. You need to learn how to hold your tool - C# Here are some good beginner $projects
MODiX
MODiX12mo ago
Collections of application ideas that anyone can solve in any programming language to improve coding skills: https://github.com/dotnet/dotnet-console-games https://github.com/karan/Projects https://github.com/florinpop17/app-ideas
Jimmacle
Jimmacle12mo ago
there is also $helloworld if you want to start from scratch
Aadarsh
Aadarsh12mo ago
yeah same, someone suggested me to directly jump on learning the framework, and eventually you will learn c# as you go
Denis
Denis12mo ago
Really depends on how much new information you can handle at a time Cause with web development you need to worry about so much more than just some conditions, loops, and oop Same thing applies to any GUI development, cause worrying about those buttons, images, etc. can get quite overwhelming if you do not know the core basics
Aadarsh
Aadarsh12mo ago
is this the complete tutorial ?
Denis
Denis12mo ago
Well... There is so.much more to it then just that tutorial 😂 But that should get you an idea of what asp.net core is You might also find some tutorials online. Possibly something from freecodingcamp There is no complete tutorial per se
Aadarsh
Aadarsh12mo ago
I get it, I must hop into open source projects to learn more
Denis
Denis12mo ago
That is one strategy
Angius
Angius12mo ago
Just pick a project and google your way to completion
Aadarsh
Aadarsh12mo ago
damn that look tiring and time consuming
Denis
Denis12mo ago
That is literally learning any skill If you are passionate about it, it isn't tiring, but addicting
Aadarsh
Aadarsh12mo ago
I must try that
Angius
Angius12mo ago
There's nothing that will lead you by hand to learn everything
Aadarsh
Aadarsh12mo ago
I must get passionate now too lol
Denis
Denis12mo ago
This ^ And if you think there is, then you'll get stuck in tutorial hell for eternity without learning a damn thing
Aadarsh
Aadarsh12mo ago
I agree
Denis
Denis12mo ago
Well everyone's approach is different
Aadarsh
Aadarsh12mo ago
Thats the worst case hopefully I will do good, but thank you so much for clearing my doubt, I must start the journey now
Denis
Denis12mo ago
But imho learning a language is done best by doing it. Same goes for learning a human language - learn by speaking and listening. Programming language - learn by doing it
Aadarsh
Aadarsh12mo ago
Yaaa, perfect example, I can't agree more
Denis
Denis12mo ago
It's a long journey, full of headaches, doubt, error codes. But it will pay off. It is really fun. You will be the engineer, the architect, the detective and so much more at once..which is awesome
Aadarsh
Aadarsh12mo ago
and the best part abot learning multiple programming langage is that, it is almost the same concept everywhere
Denis
Denis12mo ago
I might be biased, but I suggest sticking to one to stay focused. Otherwise you'll be a jack of all trades and master of none
Aadarsh
Aadarsh12mo ago
I am currently learning c++ btw, just about to finish
Denis
Denis12mo ago
But yeah, I can do stuff in Java, react etc if needed. It's basically all the same unless you face some very specific requirement for that environment Oh boy, you neverfinish 😂 But C++ is a wonderful language to know It'll help you understand C# better
Aadarsh
Aadarsh12mo ago
lol I suspect that, its very tough too
Denis
Denis12mo ago
You can try and explore interoperating between C# and C++ at some point. Just for fun
Aadarsh
Aadarsh12mo ago
But whats the use, the memory management is completely skipped in c#
Denis
Denis12mo ago
Well... Not really the case Not to that degree as it is in C++
Aadarsh
Aadarsh12mo ago
yeah I am thinkign to stick will 1 langauge for the rest of my life maybe
Denis
Denis12mo ago
But your code can result in memory piling up and not being automatically garbadge collected
Aadarsh
Aadarsh12mo ago
in c#?
Denis
Denis12mo ago
That is the other extreme which is also not correct. Be open minding to change to something at some point. The job market can demand it Yes E.g., in WinForms which is a old GUI framework for Windows desktop applications you've gotta look up for GDI+ objects. They are used to draw what you see on the monitor. If you exceed a certain amount, your app crashes. So you have to properly dispose of your objects And of course, C# has the feature of unsafe blocks, marshalls etc. It is a very powerful tool
Aadarsh
Aadarsh12mo ago
I heard somewhere that programmers need to be T shaped, I of the T is the base (where you must make yourself perfect at, or you are confident in) and the - part of the T is where you can learn and explore different technologies
Denis
Denis12mo ago
I suppose you can think of it this way
Aadarsh
Aadarsh12mo ago
it uses memory management?
Denis
Denis12mo ago
C# has a garbage collector that cleans up unused memory from the heap However, if you have some reference to an object which you forgot to remove, it will not be garbadge collected.
Aadarsh
Aadarsh12mo ago
aha ok
Denis
Denis12mo ago
One such object is... Well fine. But it you are e.g. adding and removing tons of objects in a period of time, then your used memory grows Until you get some error. Eg out of memory exception or smth like that But, fear not. C# has descent error messages. Not of the same level as Rust, but useable. Especially compared to C and C++ And once you decide to try functional.programming, you have F#
Aadarsh
Aadarsh12mo ago
does c# has any feature that is not realted to any other language and that is heavily used in the industry?
Denis
Denis12mo ago
As a language feature?
Aadarsh
Aadarsh12mo ago
f#, isn't that a different programming langauge? yeah
Denis
Denis12mo ago
Not sure. All I can say, is that it has outgrown Java by a mile. And C# is evolving, new versions coming out regularly with new and awesome features
Aadarsh
Aadarsh12mo ago
So, c# will beat java in the future
Denis
Denis12mo ago
Same goes for .net It already has, basically
Aadarsh
Aadarsh12mo ago
wow, on job perspective also?
Denis
Denis12mo ago
Enterprises are still using it. But licensing decision from oracle killed java for most companies, imho
Aadarsh
Aadarsh12mo ago
I see they are doing some improvements over the years, hoping for it to become as popular as java what about in c#, it is completely free right? for enterprises
Denis
Denis12mo ago
.NET is moving towards full AOT support. Meaning ahead of time compilation Which is what, e.g. C and C++ does Yes it is free And opensource
Aadarsh
Aadarsh12mo ago
cool, will it be as fast as c++/c in later time?
Denis
Denis12mo ago
C# is even built with C# And you can lookup the source code Dunno, but it is quite performant
Aadarsh
Aadarsh12mo ago
how is c# threads compared to other languages threads
Denis
Denis12mo ago
It is Always a trade-off between comfort for the developer and performance Well the threads are the same. But in C# threads by themselves are not really used anymore.
Aadarsh
Aadarsh12mo ago
Oh have you tested it, is it in production yet
Denis
Denis12mo ago
Instead you have asynchronous code Async await
Aadarsh
Aadarsh12mo ago
but for that nodejs is perfect imo
Denis
Denis12mo ago
Nope, no time to test that I think C# was the pioneer of this feature. Not sure
Aadarsh
Aadarsh12mo ago
I didn't quite get it, does that mean that c# has not that performant threads
Denis
Denis12mo ago
Didn't mean threads specifically. I mean t the language in general. I do not know how C# compiled with AOT compares to C++ But AOT compiles to native machine code
Aadarsh
Aadarsh12mo ago
for larger applications shouldn't threads be preferred, over async /await
Denis
Denis12mo ago
No
Aadarsh
Aadarsh12mo ago
what are you sure
Denis
Denis12mo ago
I refrain from explaining the difference between them, because I might get some crucial detail incorrect. If I maybe dumb it down to dust, async await helps you use threads much easily, then using them directly So hopefully someone else can explain this with more confidence
Angius
Angius12mo ago
C# is smart enough to move tasks to a new thread when needed
Aadarsh
Aadarsh12mo ago
I know Golang is good for better threads (with their goroutines) and they say that it is the mostly favoured reason for enterprise application to adopt it. And for multiple users at a time threads should be used am i missing anything?
Jimmacle
Jimmacle12mo ago
async/await isn't just multithreading either, it avoids using unnecessary CPU resources when waiting on other devices (like network IO) $nothread
MODiX
MODiX12mo ago
There Is No Thread
This is an essential truth of async in its purest form: There is no thread.
Denis
Denis12mo ago
Well, yeah... You can start multiple process in parallel
Aadarsh
Aadarsh12mo ago
is that the task of c# or async/await in general?
Angius
Angius12mo ago
In case of C# specifically For example, JS is strictly single-threaded So async/await will never execute on another thread
Denis
Denis12mo ago
E.g., in a classic desktop GUI application you have a so called UI (a.k.a. main) thread. It handles the drawing of the UI and e.g. button presses When a user presses a button, you don't want the Main thread to process whatever that button does, because the UI would freeze - it is processing the button press. Instead you'd run that on a different thread And run it using async await.
Aadarsh
Aadarsh12mo ago
Yeah that single threaded thing I understand, but why prefer single threaded in c# when we have multi threaded
friedice
friedice12mo ago
web dev whyy
Angius
Angius12mo ago
It's not that you should prefer one over another C# can decide for you
Denis
Denis12mo ago
It does the heavy lifting for you
Angius
Angius12mo ago
If resources on the current thread are free, C# will execute a given Task on the current thread If it's busy, and another thread is free, it'll be executed on that thread
Denis
Denis12mo ago
And once the execution is done, the code returns back to the caller thread. Unless you specify otherwise
Angius
Angius12mo ago
Yep Think of Tasks as kinda-sorta an abstraction of Threads A higher-level API
Denis
Denis12mo ago
That also look much nicer than doing new Thread(......).Start()
Aadarsh
Aadarsh12mo ago
now i understand
Denis
Denis12mo ago
But don't view threads or async await as a hammer and all of your functions as a nail Applying these everywhere won't make your app faster In fact, it might even slow it down And this is not a C# thing, but a general programming rule of thumb
Angius
Angius12mo ago
Generally, await methods that are already async, and make methods that await something inside async. Shenanigans like await Task.From(...) that turn synchronous code into asynchronous code are mostly unnecessary Or rather, you should use them when you're sure you need them, not because "more cores go brrr"
Aadarsh
Aadarsh12mo ago
lol
Denis
Denis12mo ago
E.g., GetUsersFromDatabaeAsync() Is slmething that takes time and you'd want to run a different thread. And naturally, such methods usually are async Which forces you to await them Unless you do some dirty fire and forget And lose track of exceptions
Angius
Angius12mo ago
Chances are it won't actually run on a new thread, though, because the current one is just free to do that But it can, if need be
Denis
Denis12mo ago
So by using async await, you are guaranteed to use threading resources in the most optimal way Ofc, if you see some very specific use case you can use the classic threads But generally, think async And await
Aadarsh
Aadarsh12mo ago
I think its too much for me to handle now as a beginner, you guys really explains well, as a beginner I understood it all lol classic threads and tasks are the same? or tasks are asysnc/await?
Denis
Denis12mo ago
Then your brain is a wonderful sponge. And you might be able to tackle learning ASP.NET Core straight away Tasks are async await You await a task In an async method
Angius
Angius12mo ago
As a beginner, just remember this about async/await: 1. If a method is async it must be awaited 2. If a method does any awaiting it must be async 3. If a method is async it must return a Task or Task<T>
Denis
Denis12mo ago
Task is like a promise
Aadarsh
Aadarsh12mo ago
thank you for the apprectiation(whatever is the spelling)
Denis
Denis12mo ago
Keep jn mind that with asp.net core you'll have to tackle MVC
Aadarsh
Aadarsh12mo ago
Task or Task<T> difference?
Angius
Angius12mo ago
void -> Task T -> Task<T>
Denis
Denis12mo ago
Or, if you are feeling adventurous, you can do asp. Net core with Blazor and use MVVM instead of MVC
Aadarsh
Aadarsh12mo ago
ok, the asyn/await?
Angius
Angius12mo ago
So if a method would be void when non-async, when it's async it should return Task not Void And if a method would return an int, it should now return a Task<int> And so on
Denis
Denis12mo ago
The T in the <> is a generic parameter. Look up C# generics
Aadarsh
Aadarsh12mo ago
Is it commonly used in inustries?
Angius
Angius12mo ago
Blazor, not really that common
Denis
Denis12mo ago
Asp.net core is much more popular and widely used
Angius
Angius12mo ago
MVC and API, fairly common
Denis
Denis12mo ago
But blazor is growing and beloved
Angius
Angius12mo ago
Razor Pages somwehre in the middle
Aadarsh
Aadarsh12mo ago
something like templates in Typescipt?
Denis
Denis12mo ago
Ugh... Don't quite remember Maybe?
Angius
Angius12mo ago
Doesn't TS also have generics?
Denis
Denis12mo ago
It does
Angius
Angius12mo ago
Or do they call it "templates"?
Denis
Denis12mo ago
That might be the case
Aadarsh
Aadarsh12mo ago
can i make apps with react as frontend and asp.net core as backend ? and maybe use graphql to integrate both
Denis
Denis12mo ago
Yeah you can Asp.net core can be used to host some api And handle a db connection
Aadarsh
Aadarsh12mo ago
lol, I haven't reached the generics section yet, I was still learning
Denis
Denis12mo ago
No, templates is something different It is also called generics
Aadarsh
Aadarsh12mo ago
also, what db should i learn?
Denis
Denis12mo ago
None Learn EF Core It abstracts the db and you do everything with C#
Aadarsh
Aadarsh12mo ago
wat is that
Angius
Angius12mo ago
Well, EF does require some database to connect to EF Core is an ORM As for the database I would recommend, hands down PostgreSQL
Denis
Denis12mo ago
It maps your C# to a database with a connector that you choose. E.g., for PostgreSQL you select a PostgreSQL connector For SQLite you choose a different connector
Aadarsh
Aadarsh12mo ago
thanks, I was thinking to learn that too
Denis
Denis12mo ago
You would have to anyway
Angius
Angius12mo ago
For Pg you'd use the NpgSQL driver
Denis
Denis12mo ago
But if you want a simple db for testing, you can use SQLite
Aadarsh
Aadarsh12mo ago
Mysql good?
Denis
Denis12mo ago
Or maybe even an in memory databae Depends on your app size ig PostgreSQL is very powerful and scalable from what I've heard. MySQL should be fine
Aadarsh
Aadarsh12mo ago
Ok I think i should learn pg then
Denis
Denis12mo ago
With C# and EF Core you don't learn a db directly
Aadarsh
Aadarsh12mo ago
a very wierd question, can i use c++ in asp.net core
Denis
Denis12mo ago
Why would you You can interiop C# and C++
Angius
Angius12mo ago
MySQL bad, if anything use MariaDB Postgres best
Aadarsh
Aadarsh12mo ago
no idea, maybe for adventour or speed
Denis
Denis12mo ago
You also have managed C++ which runs on .NET And afaik gets the .NET garbage collector plus some extra special pointer symbols like ^ But yeah... Only for adventure Speed no C# is fast enough
Aadarsh
Aadarsh12mo ago
managed c++ and c++ are different?
Denis
Denis12mo ago
Yes Unmanaged - you have to delete allocated memory
Aadarsh
Aadarsh12mo ago
ok then leave, I will do c# peacefully lol
Denis
Denis12mo ago
Managed - it is done for you, it is managed for you I believe there was also a project called IronPython that made python run on .NET But afaik that is dead
Aadarsh
Aadarsh12mo ago
long live c# I must go to sleep its 4:10 am here now lol I can open any eye now
Denis
Denis12mo ago
Oh no it's not. They released a version with python 3.4 running on .net 6 Yes, time to sleep You can see sharp ly
Aadarsh
Aadarsh12mo ago
thats so cool, is it stable
Denis
Denis12mo ago
Idk, ZZZZ time Work tomorrow
Aadarsh
Aadarsh12mo ago
😭 bye thank you for the help, see ya ++done !done
Denis
Denis12mo ago
Gn /close use this
Aadarsh
Aadarsh12mo ago
checking if it allows to send msg
Denis
Denis11mo ago
@nyendrak do not hijack other threads, create your own. Moreover, this thread is closed
nyendrak
nyendrak11mo ago
Oh, Sorry. I didn't realize.
Accord
Accord11mo ago
Was this issue resolved? If so, run /close - otherwise I will mark this as stale and this post will be archived until there is new activity.