C
C#16mo 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
AadarshOP16mo ago
And if possible please do share some resources from where should I learn?
Denis
Denis16mo ago
.net core, or to be specific .NET version 5 and onwards is what you want $projects
MODiX
MODiX16mo 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
Jimmacle16mo ago
tl;dr you want .NET 7 and ASP.NET Core, everything else is old and microsoft is bad at naming things
Denis
Denis16mo ago
On Microsoft learn you should find plenty of resources for developing ASP.NET Core
Aadarsh
AadarshOP16mo ago
how are they both different from each other? what should i learn first out of these?
Denis
Denis16mo 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
Jimmacle16mo ago
.NET is basically interchangeable with C#, it refers to the runtime and standard libraries
Aadarsh
AadarshOP16mo ago
can't find exactly where? can you please share the link
Jimmacle
Jimmacle16mo ago
ASP.NET Core is specifically the framework used for web development in C#/.NET
Denis
Denis16mo 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
AadarshOP16mo ago
so I should only focus for asp.net core for web dev, and forget about all the other things right
Denis
Denis16mo 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
Jimmacle16mo 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
Denis16mo ago
You'll learn C# and .NET while learning ASP.NET Core, this is inevitable
Jimmacle
Jimmacle16mo 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
Denis16mo 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
MODiX16mo 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
Jimmacle16mo ago
there is also $helloworld if you want to start from scratch
Aadarsh
AadarshOP16mo ago
yeah same, someone suggested me to directly jump on learning the framework, and eventually you will learn c# as you go
Denis
Denis16mo 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
AadarshOP16mo ago
is this the complete tutorial ?
Denis
Denis16mo 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
AadarshOP16mo ago
I get it, I must hop into open source projects to learn more
Denis
Denis16mo ago
That is one strategy
Angius
Angius16mo ago
Just pick a project and google your way to completion
Aadarsh
AadarshOP16mo ago
damn that look tiring and time consuming
Denis
Denis16mo ago
That is literally learning any skill If you are passionate about it, it isn't tiring, but addicting
Aadarsh
AadarshOP16mo ago
I must try that
Angius
Angius16mo ago
There's nothing that will lead you by hand to learn everything
Aadarsh
AadarshOP16mo ago
I must get passionate now too lol
Denis
Denis16mo ago
This ^ And if you think there is, then you'll get stuck in tutorial hell for eternity without learning a damn thing
Aadarsh
AadarshOP16mo ago
I agree
Denis
Denis16mo ago
Well everyone's approach is different
Aadarsh
AadarshOP16mo 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
Denis16mo 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
AadarshOP16mo ago
Yaaa, perfect example, I can't agree more
Denis
Denis16mo 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
AadarshOP16mo ago
and the best part abot learning multiple programming langage is that, it is almost the same concept everywhere
Denis
Denis16mo 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
AadarshOP16mo ago
I am currently learning c++ btw, just about to finish
Denis
Denis16mo 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
AadarshOP16mo ago
lol I suspect that, its very tough too
Denis
Denis16mo ago
You can try and explore interoperating between C# and C++ at some point. Just for fun
Aadarsh
AadarshOP16mo ago
But whats the use, the memory management is completely skipped in c#
Denis
Denis16mo ago
Well... Not really the case Not to that degree as it is in C++
Aadarsh
AadarshOP16mo ago
yeah I am thinkign to stick will 1 langauge for the rest of my life maybe
Denis
Denis16mo ago
But your code can result in memory piling up and not being automatically garbadge collected
Aadarsh
AadarshOP16mo ago
in c#?
Denis
Denis16mo 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
AadarshOP16mo 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
Denis16mo ago
I suppose you can think of it this way
Aadarsh
AadarshOP16mo ago
it uses memory management?
Denis
Denis16mo 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
AadarshOP16mo ago
aha ok
Denis
Denis16mo 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
AadarshOP16mo ago
does c# has any feature that is not realted to any other language and that is heavily used in the industry?
Denis
Denis16mo ago
As a language feature?
Aadarsh
AadarshOP16mo ago
f#, isn't that a different programming langauge? yeah
Denis
Denis16mo 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
AadarshOP16mo ago
So, c# will beat java in the future
Denis
Denis16mo ago
Same goes for .net It already has, basically
Aadarsh
AadarshOP16mo ago
wow, on job perspective also?
Denis
Denis16mo ago
Enterprises are still using it. But licensing decision from oracle killed java for most companies, imho
Aadarsh
AadarshOP16mo 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
Denis16mo 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
AadarshOP16mo ago
cool, will it be as fast as c++/c in later time?
Denis
Denis16mo ago
C# is even built with C# And you can lookup the source code Dunno, but it is quite performant
Aadarsh
AadarshOP16mo ago
how is c# threads compared to other languages threads
Denis
Denis16mo 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
AadarshOP16mo ago
Oh have you tested it, is it in production yet
Denis
Denis16mo ago
Instead you have asynchronous code Async await
Aadarsh
AadarshOP16mo ago
but for that nodejs is perfect imo
Denis
Denis16mo ago
Nope, no time to test that I think C# was the pioneer of this feature. Not sure
Aadarsh
AadarshOP16mo ago
I didn't quite get it, does that mean that c# has not that performant threads
Denis
Denis16mo 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
AadarshOP16mo ago
for larger applications shouldn't threads be preferred, over async /await
Denis
Denis16mo ago
No
Aadarsh
AadarshOP16mo ago
what are you sure
Denis
Denis16mo 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
Angius16mo ago
C# is smart enough to move tasks to a new thread when needed
Aadarsh
AadarshOP16mo 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
Jimmacle16mo ago
async/await isn't just multithreading either, it avoids using unnecessary CPU resources when waiting on other devices (like network IO) $nothread
MODiX
MODiX16mo ago
There Is No Thread
This is an essential truth of async in its purest form: There is no thread.
Denis
Denis16mo ago
Well, yeah... You can start multiple process in parallel
Aadarsh
AadarshOP16mo ago
is that the task of c# or async/await in general?
Angius
Angius16mo ago
In case of C# specifically For example, JS is strictly single-threaded So async/await will never execute on another thread
Denis
Denis16mo 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
AadarshOP16mo ago
Yeah that single threaded thing I understand, but why prefer single threaded in c# when we have multi threaded
friedice
friedice16mo ago
web dev whyy
Angius
Angius16mo ago
It's not that you should prefer one over another C# can decide for you
Denis
Denis16mo ago
It does the heavy lifting for you
Angius
Angius16mo 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
Denis16mo ago
And once the execution is done, the code returns back to the caller thread. Unless you specify otherwise
Angius
Angius16mo ago
Yep Think of Tasks as kinda-sorta an abstraction of Threads A higher-level API
Denis
Denis16mo ago
That also look much nicer than doing new Thread(......).Start()
Aadarsh
AadarshOP16mo ago
now i understand
Denis
Denis16mo 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
Angius16mo 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
AadarshOP16mo ago
lol
Denis
Denis16mo 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
Angius16mo 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
Denis16mo 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
AadarshOP16mo 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
Denis16mo 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
Angius16mo 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
Denis16mo ago
Task is like a promise
Aadarsh
AadarshOP16mo ago
thank you for the apprectiation(whatever is the spelling)
Denis
Denis16mo ago
Keep jn mind that with asp.net core you'll have to tackle MVC
Aadarsh
AadarshOP16mo ago
Task or Task<T> difference?
Angius
Angius16mo ago
void -> Task T -> Task<T>
Denis
Denis16mo ago
Or, if you are feeling adventurous, you can do asp. Net core with Blazor and use MVVM instead of MVC
Aadarsh
AadarshOP16mo ago
ok, the asyn/await?
Angius
Angius16mo 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
Denis16mo ago
The T in the <> is a generic parameter. Look up C# generics
Aadarsh
AadarshOP16mo ago
Is it commonly used in inustries?
Angius
Angius16mo ago
Blazor, not really that common
Denis
Denis16mo ago
Asp.net core is much more popular and widely used
Angius
Angius16mo ago
MVC and API, fairly common
Denis
Denis16mo ago
But blazor is growing and beloved
Angius
Angius16mo ago
Razor Pages somwehre in the middle
Aadarsh
AadarshOP16mo ago
something like templates in Typescipt?
Denis
Denis16mo ago
Ugh... Don't quite remember Maybe?
Angius
Angius16mo ago
Doesn't TS also have generics?
Denis
Denis16mo ago
It does
Angius
Angius16mo ago
Or do they call it "templates"?
Denis
Denis16mo ago
That might be the case
Aadarsh
AadarshOP16mo ago
can i make apps with react as frontend and asp.net core as backend ? and maybe use graphql to integrate both
Denis
Denis16mo ago
Yeah you can Asp.net core can be used to host some api And handle a db connection
Aadarsh
AadarshOP16mo ago
lol, I haven't reached the generics section yet, I was still learning
Denis
Denis16mo ago
No, templates is something different It is also called generics
Aadarsh
AadarshOP16mo ago
also, what db should i learn?
Denis
Denis16mo ago
None Learn EF Core It abstracts the db and you do everything with C#
Aadarsh
AadarshOP16mo ago
wat is that
Angius
Angius16mo 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
Denis16mo 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
AadarshOP16mo ago
thanks, I was thinking to learn that too
Denis
Denis16mo ago
You would have to anyway
Angius
Angius16mo ago
For Pg you'd use the NpgSQL driver
Denis
Denis16mo ago
But if you want a simple db for testing, you can use SQLite
Aadarsh
AadarshOP16mo ago
Mysql good?
Denis
Denis16mo 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
AadarshOP16mo ago
Ok I think i should learn pg then
Denis
Denis16mo ago
With C# and EF Core you don't learn a db directly
Aadarsh
AadarshOP16mo ago
a very wierd question, can i use c++ in asp.net core
Denis
Denis16mo ago
Why would you You can interiop C# and C++
Angius
Angius16mo ago
MySQL bad, if anything use MariaDB Postgres best
Aadarsh
AadarshOP16mo ago
no idea, maybe for adventour or speed
Denis
Denis16mo 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
AadarshOP16mo ago
managed c++ and c++ are different?
Denis
Denis16mo ago
Yes Unmanaged - you have to delete allocated memory
Aadarsh
AadarshOP16mo ago
ok then leave, I will do c# peacefully lol
Denis
Denis16mo 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
AadarshOP16mo ago
long live c# I must go to sleep its 4:10 am here now lol I can open any eye now
Denis
Denis16mo 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
AadarshOP16mo ago
thats so cool, is it stable
Denis
Denis16mo ago
Idk, ZZZZ time Work tomorrow
Aadarsh
AadarshOP16mo ago
😭 bye thank you for the help, see ya ++done !done
Denis
Denis16mo ago
Gn /close use this
Aadarsh
AadarshOP16mo ago
checking if it allows to send msg
Denis
Denis16mo ago
@nyendrak do not hijack other threads, create your own. Moreover, this thread is closed
nyendrak
nyendrak16mo ago
Oh, Sorry. I didn't realize.
Accord
Accord16mo 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.
Want results from more Discord servers?
Add your server