ASP.NET Articles

RSS Feed - Tag ASP.NET

Contrasting C# and VB.NET

Tags: ASP.NET | on 5/5/07

Microsoft ASP.NET Framework

If you ever program in the Microsoft ASP.NET framework, you have to choose whether to program in VB.NET or C#. Recently I've had to work on a project where the client wanted a website in VB.NET because that is what their programmers knew how to maintain. Needless to say my experience with VB.NET has been painful, yet my experience with C# went just fine.

What was the difference? The community, answers and examples I found were all using C#. I couldn't find the proper VB.NET code or answer any time I looked. I ended up going line by line translating VB.NET to C# to figure out how to make it work. Jeff Atwood summed up my feelings with this excerpt from his article, C# and the Compilation Tax:

Most of the community has settled on C# as the de-facto standard, so you're in for a rough slog of code translation if you want to stick with VB and cleanly integrate commonly available source code libraries into your codebase. And if you want to understand the code you're absorbing into your application (note: this isn't really optional in my experience), you better learn how to read it without a bunch of mental translation gymnastics. And once you've learned how to read and write the language well enough to integrate it, you've come full circle. Like me, you'll be left wondering why you didn't just cut out the translation penalty entirely and stick with one language in the first place.

He points out exactly my frustration with VB.NET. The bulk of the community has settled on C# and if you want to do anything complex in VB.NET be prepared to translate C# code over to VB. So the moral of the story is stick with what people use the most - C#.

Dealing with ASP.NET 2.0 Errors

Tags: ASP.NET | on 5/5/07

ASP.NET 2.0 Error

See the error screen above? It is like the windows blue screen of death, except it's yellow and tells you a semi-useful error message. If you are starting in ASP.NET 2.0, you probably will get these yellow screens of death frequently.

For instance, you can only use HTML form tags once in an ASP.NET 2.0 page or else it will throw you errors. There are a bunch of these strange little things that ASP.NET 2.0 doesn't like that you have to find ways around.

To deal with these yellow screen of death just copy and paste the error message into Google in quotes, then fix the error based on what you find out. If it gives you another error, rinse and repeat.