DEV Community

Victor Nwanguma πŸ‘¨β€πŸš€
Victor Nwanguma πŸ‘¨β€πŸš€

Posted on • Updated on

.Net developers how did you guys do it

I'm a full stack JavaScript and php developer.
My stack is react, node, Laravel.

The past few months have hell for me learning.net.

Wft invented webforms that's the dumbest thing ever.

I need tips to learn .net

Discussion (19)

Collapse
kachidk profile image
Victor Nwanguma πŸ‘¨β€πŸš€ Author

Wow I never thought people would reply, I was just ranting to my self when I sent this.

My current employer is requiring me to learn web forms to manage an eight year code base.

Initially I learnt .net core which was going great till I picked up this project.

Employers should endeavor to schedule a project update at the end of the year.
To ensure their packages are up to date.
It helps Junior developers or people coming from a different background alot.

I really wanted to quit today, because using c# in the frontend is pure pain.

For a simple post request using the fetch API or axios is simple and straight forward but in c#

HttpClient client = new HttpClient()
client.baseAddress = new Uri("......")
var result = client.GetAsync(client.baseAddress).Result.

// Deserialization etc....
Enter fullscreen mode Exit fullscreen mode

Doing this makes everytime makes me rethink my life choices.

What is the equivalent of optional lchaining in c#

But thank you all for your replies it had given strength and courage to get up and try again tomorrow.

Collapse
jayjeckel profile image
Jay Jeckel

You have my sympathy for having to deal with WebForms, that framework was a bad idea from its inception. However, working with a real, statically typed language can only improve your abilities as a programmer, so take the opportunity and learn everything you can.

One thing to note, HttpClient is an IDisposable class and should be wrapped in a using block so that it can free any unmanaged resources it has allocated.

using (HttpClient client = new HttpClient())
{
    client.baseAddress = new Uri("......")
    var result = client.GetAsync(client.baseAddress).Result.

    // Deserialization etc....
}
Enter fullscreen mode Exit fullscreen mode
Collapse
agnesinc profile image
agnesinc • Edited on

Don't sweat to learn the fundamentals of web forms or Net. Coming from someone who has been in .Net world for 10 plus years and moved to JavaScript and Go If I was you I would just learn enough so I can get the job at hand done and move on. I would also ask my boss if this web form work will keep coming back to you, if so, I would pack and leave. Tons of companies out there doing cool shit and paying great than just being stuck at web forms.

Collapse
kachidk profile image
Victor Nwanguma πŸ‘¨β€πŸš€ Author • Edited on

Thank you so much for your advice

"I would also ask my boss if this web form work will keep coming back to you, if so, I would pack and leave." πŸ˜‚

Collapse
fullstackchris profile image
Chris Frewin

I'm the reverse - I prefer .NET over Node backends for performance and static typing.

Collapse
kachidk profile image
Victor Nwanguma πŸ‘¨β€πŸš€ Author • Edited on

For Beginners taking this path. This videos coincidentally explains the basic well for .net core. link to the video

This makes me want to buy Rider even more

Collapse
webbureaucrat profile image
webbureaucrat

My tips right offhand:

  • On the off chance you don't already know this--don't learn WebForms unless you have a good reason (i. e., unless your employer is forcing you to).

  • I know it's too easy to say, "StackOverflow" but honestly .NET is so big and so old and so used in enterprise that there really is nothing new under the sun. Whatever your question is, there are already seven duplicates from ten years ago.

  • PluralSight is great for .NET stuff in particular. It costs money, but it's worth it if you're struggling.

  • Entity Framework is garbage--looks good in a ten-minute demo but it breaks all the rules of object-oriented engineering and is utterly unsuited for serious work in my opinion. If you have any choice, just use ADO.NET DataTables and DataRows.

  • Don't get cute with page lifecycles in WebForms. It's super tempting to try to do things in a modern way instead of doing a "postback" full page refresh for everything, but once you've started down that path, you're in for a lot of pain. If you find yourself writing nontrivial JavaScript, stop and think.

  • Don't be hard on yourself. If you're learning WebForms in the current year and struggling, it's probably because you're working on really objectively awful code.

Collapse
curiousdev profile image
CuriousDev

It looks like a project requires learning it in this case and I would see this as a chance to get some experience. Even if you would discourage learning WebForms, it should be worth something (especially if you have to work with it anyway and I hope people, like manager, are aware of the developer being more experienced with JS etc. compared to C# and WebForms).

Collapse
devhopes profile image
M M • Edited on

As a veteran .Net web developer,

.Net web technologies are :

  • ASP.Net Webform (supported but legacy now)
  • ASP.Net MVC
  • ASP.Net Core MVC (latest and where all new features are added)

Webform is today a legacy framework and it was created to imitate the Winform (or Visual Basic) way to code applications. The goal was to easily attract Desktop developers in the world of web development. For example, all forms controls can be added with a wizard into the page (drag and drop) and double clicking on a control auto-generate event code (all the classic desktop good stuff)...

Webform abstract a lot of web technologies (generated html, queries) or simply change the web stateless paradigm to a stateful one.

And last but not least, asychronous queries weren't trending in that era and its support is fairly poor... Likewise, client code (javascript) integration isn't straightforward and require a bit of plumbing to work.

All this was replaced with ASP.Net MVC around 2010. And ASP.Net Core version is today the preferred way to create new web application.

As a fellow consultant/dev, I would say webform isn't a great platform to invest on :

  • it's deprecated by the editor itself (no new features)
  • its technology is outdated
  • many projects has already been converted from webforms to MVC since years ago...

Good luck though, as every mission got his legacy monster project to maintain ;)

That being said, if the client allow it, rewriting it in ASP.Net Core is a more interesting investment as :

  • it's still .Net so the client probably has the infrastructure to host it
  • It's MVC and you might already know the overall architecture of a MVC web app
  • .Net core is Cloud ready, container ready, a lot of good selling point
  • the front layer can be : React, Angular (all configured at the project startup)
  • this stack is used by many companies (so it's good for your resume) and has a strong support.

Cheers

Collapse
peerreynders profile image
peerreynders

The goal was to easily attract Desktop developers in the world of web development.

A poster child for how tailored DX can push a product in totally the wrong direction especially when the abstractions introduced only serve to appeal to the familiarity/preference of the developer rather than streamlining the underlying platform and/or problem domain.


webforms that's the dumbest thing ever.

You feel this way because you aren't representative the target audience of ASP.NET WebForms. So the technology violates your sense of familiarity. More often than not familiarity gets in the way either by rejecting valid but foreign perspectives or leading to abstractions that are ill suited to the problem being solved.

Some people seem to be able to just "wing it" but typically that just delays the inevitable meltdown. You're going to have to put the React mindset aside and approach this differently. As wasteful as it may seem investing, at least on a high level, some time to understand what is happening under the hood during compile and run time should build the necessary mental model to grasp some of the reasoning behind the WebForms tooling (however ill-conceived) and how it needs to be manipulated to do what it was created to do.

Aside: Did ASP.NET Web Forms Need to Die?

And while you may be excited now there is a good chance (at least in my opinion) that Blazor based technologies will primarily be used for internal enterprise applications (there will always be exceptions)β€”client (WebAssembly) Blazor tends to lead to large initial downloads while server Blazor uses the network heavily; neither of which is a problem inside the enterprise but can be an issue on the public web when connection quality and client device computational capabilities of your target audience are unknown or (often enough) poor. (The Fallacies of Distributed Computing (Applied to Front-End Performance) - technology changes, physics don't).

I guess this is when some people start programming on their own timeβ€”to remind themselves that it can be interesting (and to get ready to bail out if necessary).

Collapse
panditapan profile image
Pandita

Since everyone has better tips than me project related I'll offer you one a bit more eh:

Stop thinking it's stupid, that you hate it, that you're in hell and so on. It will only frustrate you even more in the long run. Change your perspective on it. You're dealing with legacy code, what can you learn from it. Consider it an experiment etc etc. This won't be the last time you'll face a situation like this.

Good luck and google is your friend ;3

Collapse
kachidk profile image
Victor Nwanguma πŸ‘¨β€πŸš€ Author

Thank you so much

Collapse
canro91 profile image
Cesar Aguirre

Webforms was the product of its time. I guess Microsoft wanted to increase the rate of adoption from Winforms developers at the time, and it was its best bet. There are still legacy applications where all the business logic is implemented in UI elements events. (one of my clients has a major refactoring to migrate away from Webforms) Definitively, there are better alternatives. These days, you will find .NET for all the backend side artifacts (API, background processors, etc) and Angular/React/insert-new-ui-framework-here/ for the front end.

Collapse
natescode profile image
Nathan Hedglin

Webforms is pretty straight forward and that's ancient technology. I use all .NET CORE now.

Collapse
kachidk profile image
Victor Nwanguma πŸ‘¨β€πŸš€ Author

Based on my experiences web forms has not been straight forward.
Blazor is !!! And I'm so excited for Blazor.

Collapse
natescode profile image
Nathan Hedglin

It is probably different than what you're used to. Blazor is its own beast. It'll be ready someday.

Collapse
polterguy profile image
Thomas Hansen

If your current employer is forcing you to use WebForms, you should quit, assuming you can of course. .Net is an amazing framework, but WebForms is obsolete by (at least) a decade. Learn .Net 6 (.Net Core), create web APIs, and combine with React (or Angular). WebForms is dead and has been dead for at least a decade ...

Collapse
dhanush9952 profile image
Dhanush
Collapse
dhanush9952 profile image
Dhanush