Thursday, February 21, 2008

Common Performance Hurdles

I have been asked numerous times to review application design and/or implementation due to lack of desired performance.

More times than not, the issue is not within the .NET code itself, rather in the misuse of the View State or the session variable.

Remember that performance of a ASP.NET page is not merely the time it takes to render controls (HTML, JS, CSS, etc...), it also includes the time it takes to send the bytes and bits over the wire.

Dave Reed has a fantastic post on how to properly use the View State

Check it out in this post.

http://weblogs.asp.net/infinitiesloop/archive/2008/02/19/truly-understanding-viewstate-comment-index.aspx

Mike Voldarsky wrote a good article a few years back on the Session State.  You can find that here:

http://msdn.microsoft.com/msdnmag/issues/05/09/SessionState/default.aspx

Wednesday, February 20, 2008

Client Product Roadmap Announced

In his latest post Scott Guthrie discusses the enhancements to the desktop platform.  These new enhancements will be good news for many of the developers targeting the desktop.

http://weblogs.asp.net/scottgu/archive/2008/02/19/net-3-5-client-product-roadmap.aspx

For those who did not make the connection (or just may have forgotten), there is an ASP.NET Web Road Map that Scott has published back in November.

http://weblogs.asp.net/scottgu/archive/2007/11/29/net-web-product-roadmap-asp-net-silverlight-iis7.aspx

These are a must reads for the developers and architects targeting these platforms.

Friday, February 15, 2008

Microsoft Releases .NET 2.0 SP1 and .NET 3.0 SP1

Last week Microsoft released two service packs for the 2.0 and 3.0 versions of the .NET framework.   Download links did not contain the details (or it was not apparent) as to what was fixed so I thought I post it here for anyone who is interested what issues have been addressed:

 

.NET 2.0 SP1

http://support.microsoft.com/kb/945757

.NET 3.0 SP1

http://support.microsoft.com/kb/945826/en-us

 

To Download these SP1 you can use Windows Update or the links below:

.NET 2.0 SP1

http://www.microsoft.com/Downloads/details.aspx?familyid=79BC3B77-E02C-4AD3-AACF-A7633F706BA5&displaylang=en

 

.NET 3.0 SP1

http://www.microsoft.com/downloads/details.aspx?familyid=EC2CA85D-B255-4425-9E65-1E88A0BDB72A&displaylang=en

Saturday, February 2, 2008

ADO Entities - The new beginning....

 

As a developer you are (most likely and definitely hopefully) eager to use tools that will get you recognized as the one who stands out from the typical developer.  You strive to be better at what you do by following known, well defined and proven patterns. You reach for the tools to make your solutions more predictable.

This was relatively easy in most of the facets of application development, until it came to changing schemas and other database related areas.  You have stared the DBA's in the eye and at some points prayed that the changes they are making would not cause you undergo a full rewrite or a substantial tear-down of your application.

While you hoped and prayed, ADO.NET team has listened to your prayers and released a very slick framework called ADO Entities and an ADO Entity Designer (aka Astoria). 

This is truly a new and very nice beginning.  Imagine the new world where:

  • DB Schema can be exposed as objects
  • those objects are actually defined as a Model to your application and not just straight schema map
  • those objects can span (use multiple tables to store/read info)
  • or tables can be merged into a single object
  • objects collections can be used in a JOIN and other LINQ related operations
  • lazy load and concurency  is no longer your issue
  • compiler will let you know if the column name exists
  • you no longer have a need to write or maintain complex DAO layers

Well,  that world is here now...

Currently in Beta 3 this is a nice set of tools to be adding to your developer toolbox. 

Join the excitement and start exploring the new and wonderful world of ADO Entities.

http://www.microsoft.com/downloads/details.aspx?FamilyId=15DB9989-1621-444D-9B18-D1A04A21B519&displaylang=en

 

Enjoy and be sure to let me know what you think....

Friday, January 11, 2008

Speaking At CodeCamp 2008-1

Come and see 55 passionate people speak on technical topics.  There sure to be a topic for everyone from developer to manager to just plain tech junkie.

The meeting is being organized by the Philly.net user's group. 

Check out the agenda, speakers and other interesting stuff

http://www.phillydotnet.org/Meetings/MeetingEmails/2008/January122008/tabid/603/Default.aspx

 

If you are interested in joining the group, or interested to speak at future events click on the link below.

http://www.phillydotnet.org/

 

Max

Thursday, January 10, 2008

The Inaugural Post

My name is Max Zilberman and I am currently a Enterprise Software Architect for a Fortune 100 company. I have been doing .NET all the way back when no one really understood what .NET really was. To be precise, I started with the Beta 1 of 1.0 and never looked back since.
Other the years, I have been asked a number of different questions on technical topics, some that have been technically inspiring to learn for my self, others that are fun to answer and write about. I am hopeful to use this blog to talk and discuss various topics including Software Architecture, .NET in the Enterprise as well as down to earth topics that are just plain cool.
I have recently received a question that was cool to answer using complete sentences and not just a blurb fired back:

"I've been learning C#.Net and I'm hoping you can provide some insight on something: I've heard that there are some applications that are currently in C and need to be upgraded .Net. At the am I correct that the Developer would have the choice to pick (or at least recommend) the .Net
language as either VB.Net or C#.Net. Can you think of any reason why it wouldn't logically go to C#.Net. Am I also correct that C is a subset of C+ which is a subset of C++ which is a subset of C#, which is a subset of C#.Net? Are all C# versions various releases of .Net?"

 

Now for my answer:


Let’s start with some language history and background on your questions below:
C – as a language has been introduced in the early 70’s as a way to empower the developers to develop the way they want, and also get very good performance. The actual intention of the language was to do system level programming on Unix OS. One of the first compilers (I believe) was done by Brian Kernighan and Dennis Ritchie at Bell Labs and to this day their book remains a classic reference (although I think it is a bad book to learn from, it is good reference). C in itself is what is called a “imperative, functional language” meaning it does not support objects (but it does support object like structures called: “struct”). C was and is one of the most powerful languages around because of its simplicity to learn and the power of the simple libraries that come with and relative interoperability on different OS’s
C++ - was created by the father of C++ Bjorn Stroustrup. Actually the first C++ compiler was nothing more than just a pre-processor to C. Although you can program in C and compile with C++, at the core if you are doing C++ you are really not doing C. Most things are different including, declaration, object notation, passing by val or by ref, method declaration among a notable few. C++’s power is speed, Most applications that require “cycle counting” performance will most likely be done in C++. For example, although Microsoft created .NET, the entire Visual Studio (with exception of some add-ins) is done in C++. The downfall of C++ is its complexity in its notation and memory management. In the interview given by Bjorn about 5 years ago, he mentioned that initially memory management (what we know as Garbage Collection) was part of the language spec, however it was removed because overhead of that processing was very high and computers were not as powerful as they are today.
C# - C# is one of over 20 languages that are now part of the .NET Languages. The simplicity of .NET is that memory management is done for you. Although many say that VB had that from beginning, VB never had the power of inheritance, memory mapping, type safety and many other aspects that are today very natural and native in ..NET. C# has pointers just like in C and C++, but uses for them are very sparse for a general developer. C# has both the benefits of .NET and the elegance of C/C++.
In .NET, the intent of the language is to describe the semantics of the intent, but not the specific code for execution. To be clear, when one writes in .NET what the compiler is doing is translating the C# (or other) code into an executable language called MISL (pronounced missile). MSIL is what is actually executed when a .NET program runs. There are provided tools like “Reflector” by others, that are able to translate MSIL into any language in .NET, thus if the code was originally written in “managed C++” it can be simply viewed as VB.NET or vice versa. (this is called “intent to code” or “intentional programming”). To date there have been 3 specifications of C# (all of course are part of .NET) and the differences are just syntactical (even IL is the same).
For an example we can look at a the change from C# 1.0 and 3.0 for "property declarations":


In 2.0:

public string _firstName = "";
public string FirstName
{
get
{
return _firstName;
}
set
{
_firstName = value;
}
}


In 3.0, C# team realized that most of the properties look alike and make a short hand notation:



public string FirstName { get; set; }



It must be noted that this is a single example among any other language improvements since the C#1.0, all (most if not all) of the syntax from C#1.0 is compatible with the newer specifications.



Now onto your actual question:



The performance has very marginal differences when one chooses to program in VB.NET over C#, however from a style and readability perspective C# wins because of smaller and fewer keywords to describe a statement. There ARE sure differences in the IL that is being produced because the compilers are different, but in the end those differences are very minor.



Having spoken to developers at other companies, most write C#, when they write ..NET code. C# would be my language of choice as well.



That said, it is VERY important to consider the capabilities and willingness to learn for a given development team, and in the end if the decision to choose VB.NET due to the overwhelming majority of programmers who grew up with VB6.  Then that is the right decision



I hope you enjoyed reading this as much as I enjoyed writing it.





MZ