Posts Tagged ‘vb.net’
I am about to embark on the “religious” topic of naming conventions. I was reminded of this topic by the short post, “Hungarian Notation, what do I think”, by Richard Dingwall.
I’m sure there will be those of you who will disagree with me, but as I’ve stated in previous posts, these general guidelines I’ve been using for .NET programming have served me well since .NET 1.0; they are meant as strong suggestions for those who are looking for guidance, not rules I expect the industry to adopt because I know better than anyone else.
In fact, while I will propose what I consider the “best” way, I will also provide some alternatives.
Republished by Blog Post Promoter
Most ASP.NET programmers are aware that the environment allows programmers to write code in multiple languages. This is what allows a programmer who prefers CSharp to write modules for DotNetNuke in CSharp even though the core code is written in VB.NET. (Until version 6.0, anyhow, where the core will finally be written in CSharp.)
What many don’t realize is that you can’t have CSharp code reference VB.NET and also have VB.NET code reference the CSharp code within the same application. At least, you can’t do it directly.
I wrote the following article a long time ago on my main domain, but recently I had a reader send in a question that this article addresses. So I’m putting this article here so that it is easier for readers to find in the future….
In the past, when you selected a language, you were selecting an application programming interface (API) as well. So if you decided to use C++, you automatically were selecting the MFC class libraries as well as ATL and STL. You don’t really need to know what these initials stand for, just understand they represent a complete set of functionality that did not have to be written by the programmer.
We all do it. I’m sure of it. It’s too easy. I need code that looks almost like something else I wrote so I just copy and paste it over to the new code. Done.
But at what cost?
Is it really that much like the other code? Did you forget to change something? What happens when you need every instance of this change to be changed? Are you going to remember all the places where you made this change?
The one thing we all do to save time is the one thing that ends up costing us the most time in our development projects.
Let me illustrate.
By now, most people are familiar with the fact that ASP.NET will send mail from the codebehind by simply adding a few lines to your web.config file and adding another few lines of code in the codebehind file.
But it wasn’t until recently that I found that you don’t need to have access to an SMTP server to test your code.