Friday, May 16, 2008

Introduction of visual studio.net

Welcome friends to the exciting journey of Microsoft .NET. If you are looking for information about what .NET is all about, what it can do for you or how it can help you and your customers, you have come to the right place. This section is intended to tell you about these and many more things. After covering this section you will be ready to delve into details of .NET.

The section is divided into following sub-sections:
1) Tracing the .NET History
2) Flavors of .NET
3) Features of .NET
4) Installing .NET Framework SDK

The first sub-section will introduce you with how .NET evolved and the path of .NET since its Beta releases.

The second sub-section will introduce you with various flavors of...NET and their respective SDKs. It also gives overview of Visual Studio.NET – an excellent IDE for developing .NET applications.

It is necessary to understand the features of .NET that make it robust, programmer friendly, powerful and flexible. The third sub-section is intended just for that. It gives overview of technical features that make .NET shine over traditional programming environments.

The final sub-section tells you how to install .NET framework SDK, what are the system requirements and related topics.

1.1 Tracing the .NET History

Sometime in the July 2000, Microsoft announced a whole new software development framework for Windows called .NET in the Professional Developer Conference (PDC). Microsoft also released PDC version of the software for the developers to test. After initial testing and feedback Beta 1 of .NET was announced. Beta 1 of the .NET itself got lot of attention from the developer community. When Microsoft announced Beta 2, it incorporated many changes suggested by the community and internals into the software. The overall ‘Beta’ phase lasted for more than 1 ½ years. Finally, in March 2002 Microsoft released final version of the .NET framework.

One thing to be noted here is the change in approach of Microsoft while releasing this new platform. Unlike other software where generally only a handful people are involved in beta testing, .NET was thrown open to community for testing in it’s every pre-release version. This is one of the reasons why it created so many waves of excitement within the community and industry as well.

Microsoft has put in great efforts in this new platform. In fact Microsoft says that its future depends on success of .NET. The development of .NET is such an important event that Microsoft considers it equivalent to transition from DOS to Windows. All the future development – including new and version upgrades of existing products – will revolve around .NET. So, if you want to be at the forefront of Microsoft Technologies, you should be knowing .NET!

Now, that we know about brief history of .NET let us see what .NET has to offer.

1.2 Flavors of .NET

Contrary to general belief .NET is not a single technology. Rather it is a set of technologies that work together seamlessly to solve your business problems. The following sections will give you insight into various flavors and tools of .NET and what kind of applications you can develop.
· What type of applications can I develop?
When you hear the name .NET, it gives a feeling that it is something to do only with internet or networked applications. Even though it is true that .NET provides solid foundation for developing such applications it is possible to create many other types of applications. Following list will give you an idea about various types of application that we can develop on .NET.

1. ASP.NET Web applications: These include dynamic and data driven browser based applications.
2. Windows Form based applications: These refer to traditional rich client applications.
3. Console applications: These refer to traditional DOS kind of applications like batch scripts.
4. Component Libraries: This refers to components that typically encapsulate some business logic.
5. Windows Custom Controls: As with traditional ActiveX controls, you can develop your own windows controls.
6. Web Custom Controls: The concept of custom controls can be extended to web applications allowing code reuse and modularization.
7. Web services: They are “web callable” functionality available via industry standards like HTTP, XML and SOAP.
8. Windows Services: They refer to applications that run as services in the background. They can be configured to start automatically when the system boots up.

As you can clearly see, .NET is not just for creating web application but for almost all kinds of applications that you find under Windows.

· .NET Framework SDK
You can develop such varied types of applications. That’s fine. But how? As with most of the programming languages, .NET has a complete Software Development Kit (SDK) - more commonly referred to as .NET Framework SDK - that provides classes, interfaces and language compilers necessary to program for .NET. Additionally it contains excellent documentation and Quick Start tutorials that help you learn .NET technologies with ease. Good news is that - .NET Framework SDK is available FREE of cost. You can download it from the MSDN web site. This means that if you have machine with .NET Framework installed and a text editor such as Notepad then you can start developing for .NET right now!


· Development Tools
If you are developing applications that require speedy delivery to your customers and features like integration with some version control software then simple Notepad may not serve your purpose. In such cases you require some Integrated Development Environment (IDE) that allows for Rapid Action Development (RAD). The new Visual Studio.NET is such an IDE. VS.NET is a powerful and flexible IDE that makes developing .NET applications a breeze. Some of the features of VS.NET that make you more productive are:

- Drag and Drop design
- IntelliSense features
- Syntax highlighting and auto-syntax checking
- Excellent debugging tools
- Integration with version control software such as Visual Source Safe (VSS)
- Easy project management

Note that when you install Visual Studio.NET, .NET Framework is automatically installed on the machine.





· Visual Studio.NET Editions
Visual Studio.NET comes in different editions. You can select edition appropriate for the kind of development you are doing. Following editions of VS.NET are available:

- Professional
- Enterprise Developer
- Enterprise Architect

Visual Studio .NET Professional edition offers a development tool for creating various types of applications mentioned previously. Developers can use Professional edition to build Internet and Develop applications quickly and create solutions that span any device and integrate with any platform.

Visual Studio .NET Enterprise Developer (VSED) edition contains all the features of Professional edition plus has additional capabilities for enterprise development. The features include things such as a collaborative team development, Third party tool integration for building XML Web services and built-in project templates with architectural guidelines and spanning comprehensive project life-cycle.

Visual Studio .NET Enterprise Architect (VSEA) edition contains all the features of Visual Studio .NET Enterprise Developer edition and additionally includes capabilities for designing, specifying, and communicating application architecture and functionality. The additional features include Visual designer for XML Web services, Unified Modeling Language (UML) support and enterprise templates for development guidelines and policies.



In addition to these editions, special language specific editions are available. They are:

- Visual Basic.NET Standard Edition
- Visual C# Standard Edition
- Visual C++ .NET Standard (soon to be released)

These editions are primarily for hobbyist, student, or beginner who wants to try their hands on basic language features.

A complete comparison of these standard editions with professional edition of VS.NET can be found at:

http://msdn.microsoft.com/vcsharp/howtobuy/choosing.asp
http://msdn.microsoft.com/vbasic/howtobuy/choosing.asp

· .NET Redistributable
In order to run application developed using .NET Framework the machine must have certain ‘runtime’ files installed. They are collectively called as .NET redistributable. This is analogous to traditional Visual Basic applications that required Visual Basic runtime installed on target computers. .NET redistributable provides one redistributable installer that contains the common language runtime (more on that later) and Microsoft .NET Framework components that are necessary to run .NET Framework applications. The redistributable is available as a stand-alone executable and can be installed manually or as a part of your application setup.


Note that if you have installed .NET Framework SDK, there is no need of installing redistributable separately. Also, note that there is difference between .NET Framework SDK and .NET redistributable in terms of purpose and tools and documentation supplied. .NET Framework SDK is intended to ‘develop’ applications where as .NET redistributable is intended to ‘run’ .NET applications.

· .NET and mobile development
Now days the use of mobile and wireless devices is ever increasing. PDAs, mobile phones, Smartphones, handheld PCs and HTML pagers are becoming common. As compared to full blown desktop computers, Mobile devices are generally resource-constrained. There are limitations on what they can display and in which form. For example you can easily display graphical menus in desktop applications but the same may not be possible for cell phones.

Today there are many vendors making CPUs and development tools for mobile devices. However, their standards are much varying. For example devices running Windows CE will have different tools and standards of development than Palm OS. Also, programming model for such devices is an issue of debate. For example, Wireless Application Protocol (WAP) was considered a ‘standard’ for mobile devices but it introduced disadvantages of its own such as requirement of continuous connectivity, lack in rich user interface and failure to utilize client –side resources effectively.

Mobile devices can be broadly divided into two categories:

1) Mobile Devices that have certain client-side resources like PDAs, Smartphones and Handheld PCs. They can run stand-alone application with rich user interface.
2) Mobile Devices that lack even these client-side resources such as mobile phones. They can not run stand alone applications having rich and more interactive user interface.

In order to encompass all possible devices from above categories Microsoft has developed two distinct technologies namely:

- Microsoft .NET Compact Framework (.NET CF)
- Microsoft Mobile Internet Toolkit (MMIT)
o Microsoft .NET Compact Framework
.NET compact framework is a sub set of entire .NET framework and is targeted at mobile devices having some client side resources. It provides support for managed code and XML Web services. Currently, .NET Compact Framework is in Beta 1 and is available on devices running the Windows CE or Windows CE .NET operating systems. However, Microsoft has promised support for other platforms in the future. As of now the framework supports Visual Basic.NET and C# as development languages out of the box. Support for other languages is planned in near future.

Microsoft is creating a set of extensions for Visual Studio .NET called Smart Device Extensions that will allow Visual Studio .NET developers to program for .NET Compact Framework. This means that developers familiar with Visual Studio.NET can start developing for mobile devices almost instantly.

More information about .NET Compact Framework can be obtained at
http://msdn.microsoft.com/vstudio/device/compact.asp
o Microsoft Mobile Internet Toolkit
Microsoft Mobile Internet Toolkit (MMIT) is designed to develop server side applications for mobile devices such as cell phones, PDAs, and pagers. It is different than .NET compact Framework in that it is a server side technology. It is ideal for devices that can not run stand alone applications.
MMIT mainly uses ASP.NET as a technology for delivering markup to a wide variety of mobile devices. As we know that each mobile device has

Sunday, December 30, 2007

Good Programming Style


Write Clearly - don't be too clever - don't sacrifice clarity for efficiency.
Say what you mean, simply and directly.
Be sparing with temporary variables.
Parenthesize to avoid ambiguity.
Use library functions.
Replace repetitive expressions by calls to a common function.
Choose variable names that won't be confused.
If a logical expression is hard to understand, try transforming it.
Choose a data representation which makes the program simple.
Don't patch bad code - rewrite it.
Write and test a big program in small pieces.
Test input for plausibility and validity.
Identify bad input - recover if possible.
Make sure input doesn't violate the limits of the program.
Terminate input by end-of-file or marker, not by count.
Make input easy to prepare and output self-explanatory.
Make sure all variables are initialized before use.
Watch out for off-by-one errors.
Make sure your program "does nothing" gracefully.
Test programs at their boundary values.
Check some answers by hand.
10.0 times 0.1 is hardly ever 1.0.
Don't compare floating point numbers solely for equality.
Make it right before you make it faster.
Make it fail-safe before you make it faster.
Make it clear before you make it faster.
To make it faster, change the algorithm not small details in the code.
Actually test code to see how fast it is.
Make sure comments and code agree.
Use variable names that mean something.
Format a program to help the reader understand it.
Don't just echo code in comments - make every comment meaningful.
Document your data structures.
Don't over comment.
Don't comment bad code - rewite it.
Use recursive procedures for recursively defined data structures.
Use data arrays to avoid repetitive control sequences.
From: The Elements of Programming Style, Brian Kernighan and P. J. Plauger,McGraw-Hill Book Company, New York, 1974.