SBC DotNet Weblog

Microsoft MVP - SharePoint Server

DotNet Links

DotNet Weblogs

General Links

Groove Weblogs

June 2003 - Posts

802.11 Planet Expo in Boston

I spent the day, yesterday at the 802.11 Planet Expo (Wireless tech) in Boston. MS was there with some interesting demo for embedded tech devices.

Larry King of Internet Talk Shows

Last night, the very knowledgeable and enterprising Carl Franklin gave a presentation at the CT .NET Developer Group's meeting. The topic was about Objects and VB.NET. Franklins.NET has a radio show called .NET Rocks! This is a terrific show that interviews .NET legends like Chris Sells, Ingo Rammer, Dino Esposito and others. Hmm... I think that makes a Larry King of Internet Talk Shows amongst our admist.

Posted: Jun 25 2003, 07:54 AM by SB Chatterjee
Filed under:
Amazon sends out Web Services Newsletter #1

I just received Amazon Web Services Newsletter #1. More info here...

Posted: Jun 23 2003, 10:14 PM by SB Chatterjee
Filed under:
Designing databases prior to development

Database design is very much an intuitive process - so quite a few (I'd say most), just wing it. This would be true for smaller-type applications, i.e., websites or smaller apps but not so, for larger and complex apps that perform healthcare or financial services.

For the website or smaller apps (be it in ASP.NET or WinForms), it'll pay greater dividends if you develop the underlying database with a (semi) formal process to create a database model (ERD). This entails knowing the entities, relationships (child/parent), relation forms (one-many-one), keys (primary/foreign), normalization (at least 3NF) and integrity (domain/referential). Why is a well-developed database model important? This is the foundation of your app's information base - any changes or failures here has repurcussions throughout the entire application. A poor or no design ('winged' design) is like building a house of cards - its fall is truly earth-shattering. So, peer review of database design or better still, a second opinion from a database modeller, is very crucial in app development.

Here are some references:

Application Blocks for .NET

MSDN now has five Applications Blocks for .NET. Two of these have been around for well over a year but three were  released within the past two weeks !

I am currently incorporating the Exception Management Application Block for a client's ASP.NET application. This is a sigh of relief to some of the developers - prior exception handling mechanisms had an overhead almost as large as the application module itself! I think MSDN is also working on a Security Management Application Block, now that will be most welcomed !

201 Principles of Software Development

201 Principles   

Alan Davis' 201 Principles of Software Development - I had picked this one up back in the mid-90's for $20, it's now over $100 in the used-book market. If you see one at a good price, grab it. This is one of those books that pays for itself after it solves an issue/bug or two... Principle #199 - Use Profiler Before Optimizing.

Posted: Jun 16 2003, 06:29 AM by SB Chatterjee
Filed under:
.NET Code Optimization

I got this email from WinDevNet. I couldn't find the content below at their website, so I have excerpted it here. I believe it's written by Richard Grimes and it'll interest the MC++ developers in particular.

.NET Code Optimization

For code efficiency, C++ has the best optimizer of any .NET language

One of the questions I often get asked is "Why use managed C++?" I usually give the C++ interop story as my answer, and this satisfies many questioners. However, some people reply that they do not need any interop, so then I go onto the next answer—optimization. The C# compiler does have a code optimizer, but there are no options about how it works, so you can either run the compiler with the optimizer or without it. The C# compiler is also new technology, so you can imagine that the technology hasn’t matured to the point that all optimization techniques have been exploited. On the other hand, the C++ compiler is a mature product and the C++ team has had the opportunity over many years (this year is the 10th anniversary of the Microsoft C++ compiler) to try different optimization techniques. Furthermore, the compiler gives you the option to optimize for speed or size.

Now let’s throw in another optimizer. The .NET JIT compiler includes an optimizer that will be applied to all IL except assemblies built for debugging. Compilers will add the assembly level [Debuggable] attribute to debugging code, and this has a property called IsJITOptimizerDisabled, which will be set to True so that the debugger can relate the IL to the source code easier. If this field is set to False, or the attribute is missing, then the optimizer will be run by the JIT compiler as it compiles the IL. This assumes that the assembly is built specifically for debugging, but in the rare case that you want to debug a release build assembly (assuming you have symbols), you can turn off the optimizer using an ini file. This file takes the same name as the process (so app.exe has an ini file called app.ini) and it is located in the same folder as the process. This ini file has a similar structure to other Windows ini files, the optimizer is controlled through a section called [.NET Framework Debugging Control], and a value called AllowOptimize can be set to a value of 0 to disable the optimizer.

Clearly the JIT optimizer is important, but code compiler optimizers also play a part because they provide the IL used by the JIT optimizer and they have more information about what the code should do. Comparing the actions of compiler optimizers is difficult; however, I will give a few general observations. The first point I should make is that the C++ compiler does extensive checks on the code to determine which code will actually be called. If you create a library assembly (DLL), the compiler will only include private classes if the C++ class is actually used directly, or indirectly, by code that is part of a public class. On the other hand, the C# compiler will add all classes to the resultant library, which will clearly make the library larger than it should be. However, it is interesting to note that both the C++ compiler and the C# compiler will include private methods, even if those methods are not called by public or protected methods.

The C++ compiler inspects the code that you have provided. If it determines that code will not be called or that it does not do anything useful, the optimizer will remove that code. For example:

void NothingUseful()

{

int j = 0;

for (int i = 0; i < 100; i++)

j++;

}

The C++ compiler will compile the function but the optimizer will remove all code because clearly, the value of j is never used. While doing tests on the optimizers I found this action very irritating because the optimizer removed most of the code I was trying to test! The C# compiler, on the other hand, will include code that clearly does nothing useful (like the code above). Of course, the function NothingUseful() has a bad side effect: When code runs this method, extra CPU cycles will be wasted.

The lesson to be learned is that now that managed C++ can create verifiable assemblies, there are no reasons not to use it for much of your code. Since C++ has a far more efficient optimizer than any of the other .NET languages, it makes sense that C++ should always be your first choice in any situation where efficiency is important.

Two free dev tools - AxTools Visual Logger & AxTools VssRecursive Purge

Found two interesting (free) dev toolsAxTools Visual Logger (trace log) & AxTools VssRecursive Purge (for Visual Source Safe).

.NET Dev Engineering jobs (in Montreal)

 

Alexis Smirnov has a couple of job openings for .NET dev engineers. His firm, Zero-Knowledge systems is located in Montreal. Tempting... tempting...

Posted: Jun 14 2003, 07:48 PM by SB Chatterjee | with 2 comment(s)
Filed under:
Borland bridges platforms

Mixed-feelings Borland has announced 'Janeva' (that's Java+Geneva, perhaps they are short on their marketing staff). 'Janeva' will be incorporated in Borland's development products and will tie-in .NET front ends to CORBA and J2EE-based applications. This will help bridge the different platforms which is something we have to address in the corporate environment.

Posted: Jun 14 2003, 10:59 AM by SB Chatterjee | with 2 comment(s)
Filed under:
More Posts Next page »