Friday, October 03, 2003

This came in DotNetNuts.com and was brought to attention by Deepak Kumar Vasudevan, a fellow MVP... Thanks Deepak for the same...

The Ten Commandments of .NET

1. Thou shall learn XML, now! If .NET is an angel from Microsoft then its wings are woven with XML, and you need to understand the basics of XML before you can fly with .NET. XML is used for configuration files, SOAP,Serialization, and it's tightly integrated with ADO.NET. You can get away without knowing XML, but you won't get far.

2. Thou shall become an object-oriented programmer! To understand .NET and build successful applications you must understand OOP. VB programmers now have new object-oriented capabilities, but may not know how or when to use them. You should understand interfaces and abstract classes (there's a difference between the two in .NET), implementation inheritance, function overriding, and shared members. If your not familiar with OOP at all, start learning ASAP. If your established with OOP as it applies to VB6 then dig deeper into OOP methodology, it will certainly make .NET more enjoyable.

3. Thou shall concentrate on the .Net framework, not the language being used. No matter what .NET language you use, your still using the same framework, so it's very important to focus on the framework, not a particular language. Keep in mind that most of the functions you'll use while programming are from the framework, so using a new language is easy, simply adjust to the syntax. Plus, having C#, C++, VB, Perl, Pascal, COBOL, Fortran, and Eiffel on your resume is more impressive than having just one.

4. Thou shall not go it alone. Get involved in the .NET community. This is the best way to dive into .NET. Message boards are a great resource because you can read problems and questions posted by beginners, and examine the solutions they received. After all, it's better to learn from others mistakes than to learn by repeating them. DotNetNut.com is a great place to start. You'll find message boards, original articles, constantly updated FAQ, and an enormous amount of links to other great resources. We 'll help you spend more time learning and less time digging for answers.

5. Thou shall adapt to new development environment. For VB programmers the VS.NET IDE is a big change, and it's going to take some effort to adjust. Not only is there much better support for debugging than in VB6, but there is also the ability to record and playback macros. Get intimate with the IDE, missing out on great new features is shameful.

6. Thou shall abandon DCOM and use remoting. DCOM was a big step in Microsoft distributed computing, but it's time has passed. Remoting is the .NET model for distributed computing. It's more flexable, featuring plugable channels and protocols, and it generally out performs DCOM (Though note:Remoting outperforms DCOM is in intra-appdomains where as between processes and across network Remoting is slower by 250%..Thanks Sanjay Vyas for his inputs). Administration is done easily through application configuration files which elevate the headache of DCOM administration. Althought it takes a little more coding than DCOM the benefits are well worth it.

7. Thou shall not use VS.NETs code generators without understanding the code they generate. VS.NET has some great code generators that can save you time, but only use them if you understand the code they generate. Create a sample application, use the code generators, and be come very familiar with the results. It's impossible to support code ou don't understand.

8. Thou shall use structure error handling in VB. VB developers have a choice, either learn how to use structured error handling, or use the old On Error method. Using structured error handling brings flexibility and maintainability to VB and is one of the best new features. There are two reasons On Error should be left behind. One is because Try Catch Finally will be used in all .NET languages, On Error is VB specific. Two, because structured error handling is much more powerful, giving you the ability to nest Try Catch statements and layer exceptions.

9. Thou shall avoid using COM+ for single phase transactions. COM+ is great for two phase commits because of the DTC, but there is extra overhead for database locks due to the nature of the transaction. It's a waste of database resources to indiscriminately use COM+ when a less intensive lock can be used. Transactions through the Data namespaces are lighter and should be used for single phase transactions. It is possible to get the same automatic transaction enrollment available in COM+ by using the SinglePhaseTransactionContext component available for download (complete with source files) at DotNetNut.

10. Thou shall not underestimate the complexity of .NET. Is .NET going to make development easier? Yes, but (there's always a but) the .NET framework is so vast, and there are so many new concepts involved that NET will be difficult at first. If your new to the .NET runtime, than you may not know what value types and boxed types are, how the garbage collector works, or what application domains are. All these concepts are new to microsoft developers and important, to ignore them is sinful.

No comments: