Showing posts with label new features. Show all posts
Showing posts with label new features. Show all posts

Saturday, May 28, 2011

Visual Studio 2010–Before you begin

“Give me six hours to chop down a tree and I will spend the first four sharpening the axe.”

The saying above probably fits developers the most. More so if one happens to be a Microsoft technology developer, spending his day in and out of Visual Studio – the ultimate development experience (no offence intended to the Notepad developer). I am almost always amazed by the insane complexity that Visual Studio abstracts away from a developer, presenting it in a visually elegant and magnificent way. Before you even think of disagreeing, think of the top 3 features of the Visual Studio code editor according to you and try integrating it on a Rich Text Box in the language of your choice.

The bytes that follow intend to assist you in sharpening your axe, a.k.a Visual Studio 2010.
  • Service Pack 1 – Looking beyond the bug fixes: Gone are the days when Visual Studio Service Packs were a means to provide bugs and stability fixes. The trend in general has shifted to providing users with considerable feature additions, providing a sense of fulfillment and extended satisfaction to the developer community in general. Entity Framework was included as part of the Visual Studio 2008 Service Pack 1. With Visual Studio 2010 too, apart from the huge number of bug fixes and stability enhancements to the core editor, several new features were added:
    • Help Viewer 1.1 – A stand-alone application for viewing locally installed help documentation.
    • Silverlight 4 – Pre installed support for Silverlight 4 with designer and project system support.
    • Silverlight Profiling – Performance Wizard for Silverlight allows profiling of Silverlight applications which were cumbersome, to say the least in Visual Studio 2008.
    • SQL Server CE 4 – Support for managing Microsoft SQL Server Compact 4.0 databases (SDF) added to Solution and Server explorer.
    • HTML5 and CSS3 – Support for HTML5 and CSS3 in the html editor.
    • IIS Express support – Visual Studio 2010 SP1 enables you to use the Internet Information Services (IIS) 7.5 Express as the local hosting server for the website and Web Application Projects. Scott Guthrie’s introductory blog post about IIS Express explains distinctively how you can leverage local IIS right from your development box.

      A complete description of the Service Pack 1 can be found here.

  • Extend to conquer: Visual Studio 2010 not only sports a brand new managed code editor but it also includes a managed MEF based Extension Manager that lets you customize almost everything that comes by default with Visual Studio, including the Start Page. The following are few extensions that you wouldn’t regret installing:
    • Productivity Power Tools (Microsoft): By far the best (free) extension to Visual Studio 2010, developed by Microsoft, Productivity Power Tools does what its name implies, improve, rather boost the overall productivity of the IDE. A really slick looking Find box, a vibrant Solution Navigator and middle click scroll support, are some of the features that hooked me up instantly. More information and download can be found here.

      Productivity Power Tools
    • Visual Studio Color Theme Editor: Customize the Visual Studio 2010 color palette for menus, toolbars, tabs, title bars and more. It comes in with predefined themes to choose from and allows you to customize the palettes or create new themes. Check out the Visual Studio blog post or download the extension here.

      VS Color Theme Editor

The Visual Studio Gallery has enormous number of extensions (quite a few of them are free) already listed for you to try out. Go ahead. Customize, extend Visual Studio. Super charge it.

Visual Studio – It amazes me. First time, every time!

Sunday, March 14, 2010

Awaiting .NET 4

The .NET Framework version 4.0 is slated for release in April 2010 and everyone seems to be excited about it (everyone by definition includes everyone, so me too). Being the next big release of the framework, there exists number of enhancements and fusion of several new ways of writing old and new smart applications.
I sat down searching for what’s in it for me, the conventional (it’s the most reputable word I could afford for myself, corollary to calling bugs as exceptions) .NET developer for whom writing .NET code is not only about developing cool new smart applications (hardly get to do it thanks to the huge number of legacy and combo apps we need to upgrade day-in day-out) but also write that enlightening code quickly and smartly.
I have made an honest (as if honesty still exists?) attempt to compile what I felt was just so super cool changes to the framework or language in general. Let me #warn you not to expect the entire v4 enhancements from the lines that follow. That won’t ever happen (if I could do that MSDN would be hosted at my local desktop, right?).

1. StringBuilder.Clear(): I was surprised to see this as an addition to the v4 version, as all this time I had expected this member function to be omnipresent in the StringBuilder class (going by the superior and smart design of the .NET framework). Just recently while using it for dynamic html generation (I was using VB9 and still didn’t use VB XML Literals for some bizarre reason, which is indeed classified), I found the absence of this method. The workaround was setting the Length property to 0 which would then clear the contents of the StringBuilder object.
2. String.IsNullOrWhiteSpace(): As is eminent from the name of the method, it checks not only the Null or Empty content of the string object but also helps avoid the use of the Trim() method to make certain we don’t end up with a string of precious whitespaces. An authentic admittance though, I already had added my own extension method in my v3.5 extension methods repository that did verify the absence of both Null and Whitespaces before performing any further string operations and was aptly named String.HasValue(). I am indeed smart (I always knew this, but formally broadcasting it on this DateTime.Now).
3. ServiceProcessInstaller.DelayedAutoStart: While developing Smart Client applications it is a very common requirement to register the application to launch on Windows startup. However, as is eminent, too many applications loading on startup will upsurge the boot time significantly deteriorating the end user experience. This feature comes to the rescue by delaying the start of the application until all other auto-start services have already started.
4. SMTP Client enhancements: Some of the enhancements include enabling SSL mode in application configuration files, specifying heading encoding and most importantly, multiple replying to addresses through MailMessage.ReplyToList().
5. Guid.TryParse(): The TryParse method has now been added to the Guid, Version and Enum types and behaves exactly as its counterparts in other types.
6. 64Bit enhancements: Recognising the mainstream adoption of 64 bit systems the Environment class has been decorated with: Environment.Is64BitProcess and Environment.Is64BitOperatingSystem.
7. IEnumerable<T> everywhere: New overloads of String.Concat() and String.Join() now support IEnumerable elements so that you don’t have to convert them to strings prior to performing Join or Concat operations on them. Also enhanced are several System.IO members like the new File.ReadLines() which returns an IEnumerable<String> rather than a string array. This in turn gives superior performance benefits as its always (read mostly) desirable to read a file one line at time rather than loading the entire content in memory as in File.ReadAllLines().
8. Corrupted State Exceptions: How many times have I written the following?
try{
// Something that should fail, or else why did i incur this try cost, right?
}
catch(Exception ex)
{
// Never do anything here. Let them come back to me for fixes (guarantees job security)
}
In .NET 4.0, corrupted state exceptions will never be caught even if you specify a try… catch block. Even though this is a huge obstacle (a setback or even a crisis) on my attempts towards my job security, yet I welcome it as it encourages writing more stable (in theory) code. Before you start depreciating your intentions to upgrade to .NET 4 for this particular reason, there is a switch that allows you to get the old behavior back by setting the following attribute LegacyCorruptedStateExceptionsPolicy=true in the config file.
This behavior can also be enabled on individual methods with the following attribute:
[HandleProcessCorruptedStateExceptions]
9. System.Data.OracleClient: Before you plunge into thinking why MS shelled it’s resources to enhance OracleClient, instead of their own franchise SQL Server, there is a surprise awaiting you. OracleClient is available in .NET 4 but marked as deprecated. Don’t believe me? No need to, just help yourself by visiting http://blogs.msdn.com/adonet/archive/2009/06/15/system-data-oracleclient-update.aspx .
10. VB Auto Implemented Properties and C# Named and Optional Parameters: These are some of the language specific enhancements essentially following Microsoft’s strategy of co-evolving the two languages.
VB now has auto implemented properties thereby reducing the amount of code generated significantly (I hated VB Dev Center for not introducing it in VB9).
C# developers now stand equal by having named and optional parameters (which to me should have been there at least since v2 of the language).  

The list above was never meant to be exhaustive, it does not even attempt to touch the Parallel computing extensions and dynamic (or functional) enhancements to the framework, but it surely addresses most of us, the conventional .NET developers, writing managed code that manages our company, our clients and primarily us!

Happy Coding!