Making a website after learning c#
Posted by Last-Watercress-8192@reddit | learnprogramming | View on Reddit | 16 comments
I have learned the basics of c# and I wanted to make a project. I was going to go with a website but then I kept hearing that I need to learn JavaScript as well is this true or can I use c# instead?
silverscrub@reddit
Most mainstream backend languages have frameworks for server-side rendered web pages. This works similarly to a plain webpage with HTML/JS/CSS, except you write the code in for example C# and your backend renderers the actual HTML/JS/CSS.
If you want to make an app with lots of dynamic functionality then a Single Page Application (SPA) might be a better option. Then your server sends a bunch of JavaScript and a minimal HTML file. It's a SPA because even though your web page has many routes like /items and /users, it's really just one single page that the framework transforms on the client-side.
There is also a mix of both for more advanced use-cases. Either way, you don't need to use any specific tech to make a website. You can pick one that interests you and learn more about the other options later if they also interest you. Either way, learning a bit of HTML, CSS and JS won't hurt because that's the browser uses in the end, regardless of which option you picked.
ObeseBumblebee@reddit
Websites typically have two sides.
Front and Backend.
Backend is where the database lives and how you setup the roadmap of your website. Typically this is written in C#. This side interacts with the database and allows you to route out the URL paths of your website and collect the relevant data for each page of your site.
Frontend is what your users will see. It takes the data that was packaged by the backend and displays it in a userfriendly way.
Frontend is typically written in a JavaScript library. That's definitely the most common. But recently Blazor has been introduced which is a frontend version of C#. And that's totally a viable option.
If you're looking to set yourself up for a career and pad your resume, I'd learn some JavaScript.
If you're looking to build a product quickly and you feel like you've got a handle on C# and feel very comfortable sticking with C#, then I'd go Blazor.
There is no wrong choice.
Last-Watercress-8192@reddit (OP)
so a backend would only be needed if i have stuff like logins right?
Ezazhel@reddit
No, backend would be required if you need dynamic data. Else you can put your data in the front. You can have backend without login.
Search 'Api'.
Ok-Advantage-308@reddit
Use blazor or asp.net MVC with razor pages
I think some .NET devs would not like the idea of recommending MVC since it’s not the newest shiniest technology, but it still works just fine.
Just please don’t use web forms!
EliSka93@reddit
Actually a lot of us don't recommend MVC anymore because it's outdated. With the more purpose-built Blazor framework it was basically discontinued and isn't being worked on anymore.
It's still fine to use it, if you already know it, but if we're talking about learning something new, I would recommend Blazor instead.
Last-Watercress-8192@reddit (OP)
what is bad about web forms?
megacope@reddit
Yeah you’re going to need to learn a lil bit of that script. I’d suggest running through a quick HTML/CSS/JS course just to get some basics under your belt. If you understand how to build a static page with those it should ease the learning curve when you get ready to jump into the server side action. After that hop on them .net projects. MvC, razor, blazor, etc.
Last-Watercress-8192@reddit (OP)
do you have any recommendations for a course on that? i am sort of familiar in html but no the others
megacope@reddit
Bro code has a pretty good html/css course. The JavaScript class is 12 hours, but all three of those were a good start for me. They won’t make you an expert but you will definitely be able to spin up a basic webpage when it’s all said and done.
Ok_Assistant_2155@reddit
yeah for websites you’ll still need JavaScript at some point
C# handles backend stuff really well
ScholarNo5983@reddit
Using something like Blazor, you can actually create a website without needing JavaScript and you get by with coding nothing but C# and Blazor takes care of the rest.
Ok_Assistant_2155@reddit
I'll try that.
polymorphicshade@reddit
https://learn.microsoft.com/en-us/aspnet/core/get-started 👍
nobanpls2348738@reddit
My good sir, c# is for desktop apps. You need to learn html, css and javascript
p1-o2@reddit
You can use C#. Razor pages or Blazor would work just fine.