Must know technologies

Following are the technologies I believe are the future and want to learn but not finding the time for:

  • Workflow Foundation: The reviews of this are really really good and people are saying, nothing can beat the designer for this.
  • Windows Communication Foundation: Microsoft has unified the way two processes communicate, be they on the same box or on a remote client/server. We don't have to decide between .NET Remoting, Web Services, Message Queues, Distributed Transactions and a few other related technologies anymore. The basics of WCF are that you create a service and add endpoints to it. If you want a remote .NET client to communicate with it, you add a TCP endpoint (which is equal to .NET Remoting). If you want a Java client to communicate with it, you add HTTP endpoint (which is equal to Web Services). Note that the service remains the same, you only need to keep adding endpoints which reduces code duplication / complexity.
  • .NET Framework 3.5: This has a lower priority as it is not out yet but the additions that Microsoft is making to the framework are pretty interesting. The biggest proof that it is interesting is the fact that Sun is taking a few pages from .NET 3.5 for the next version of it's framework Wink. (Note: Microsoft itself is taking a lot of ideas from open source projects like Hibernate)
  • Windows Presentation Foundation: This has the lowest priority on my list but I find it the most interesting. Future windows applications are going to be built on top of this technology. GDI+/WinForms are past it's maturity and WPF is taking it's place. However people are not just going to run and make WPF apps. I see over the next two years a lot of small companies coming out with WPF followed by the big boys.

Update: I had Java on my list but scratched it off after a lot of reading over the past few days. The reason being that there are so many different directions you can take within Java that getting my head around it is in itself a big challenge. Hence I have decided to teach myself more of the .NET stuff instead of trying to be on two ships at the same time.


.NET vs Java

I have been reading about the Spring Framework, Hibernate and the Java world in general for the past couple of days. Trust me when I say I am reading about Java just out of curiosity and nothing else Smile.

Here is what I have learnt so far:
With .NET Microsoft took the approach of making it very very simple for developers from the get go. Most .NET applications feel like writing shopping cart applications Smile. They did not add any high level complex APIs and kept the entire platform very very developer centric and simple.

With J2EE Sun took the exact opposite approach and made the platform Enterprise level which resulted in developers having to learn EJBs which from what I have read required a lot more work to get even simpler projects done. This lead to the creation of the Spring Framework, which adds some neat technologies such as Inversion of Control and Aspect Oriented Programming to POJOs (Plain Old Java Objects). I imagine .NET to be like POJOs when I write code.

The end result is that these two technologies are moving towards each other (.NET scaling upwards and JEE scaling downwards in terms of simplicity) and are going to clash/meet somewhere in between.

I think the existing .NET 3.0 framework (which includes Windows Workflow Foundation and Windows Communication Foundation) and .NET 3.5 framework (which adds OR Mapper like Hibernate) right into the framework, while J2EE coming up with frameworks like Spring to simpify Java development is a good indication of this.


On the tooling side I was really surprised to read that Eclipse was more powerful than Visual Studio. I work day in and day out of Visual Studio and never imagined anything more powerful, but after reading some of the features of Eclipse I think we can be a lot more productive if VS had those features.

To name a few:

  • Refactoring: Hands down the refactoring support in VS 2005 is pretty lame and may be about 5% of what Ecllipse can do.
  • Type search. If you want to search for some class that is sitting in some third party assembly, you can find that just by hitting Ctrl+Shift+T and typing the first few letters. The tool will take you straight to the class if source code is available else will take you to the type definition.
  • Automatic imports statements: As you type your code when you reference a class that is not part of the using statements at the top, Eclipse will automatically add it. It will also remove those statements when your code no longer uses any of the classes in that namespace.

There are a lot more, but I forget them Sad. I will try to find the link where I read the differences and update this post.

Having said that I think the refactoring support in Visual Studio 2007 due this year end will improve dramatically. Just by the looks of it, it appears that MS just threw in basic refactoring into VS 2005 at the last movement. The beauty about VS 2007 is that it will target multiple .NET versions (2.0, 3.0 and 3.5). So you can write .NET 2.0 code in VS 2007 with all the productivity benefits they add to that release.


Oh No! There goes my motivation to write C# 3.0 Part 2

Following are short videos that explain all about C# 3.0 language features. I couldn't have explained it better than this:

C# 3.0 Language Enhancements in action
C# 3.0 LINQ in action
C# 3.0 XLinq in action
C# 3.0 DLinq in action
Anders Hejlsberg on LINQat Channel 9 - Channel 9
Chatting about LINQ and ADO.NET Entities - Channel 9

Source: TheServerSide.NET

Have fun!


Is LINQ a copy of Hibernate? Part 2

In response to my previous post, Lilly made some good comments. Here are a couple of them "Generilization is good in a way.  But it never optimizes for performance", "Declarative type of programming?  O, man.  Are they planning to turn the developers to robots?" Grin. Microsoft has a bigger goal than turning developers into Robots. Today when you write a program you instruct the compiler line by line the entire program. In short you tell the compiler how you want to accomplish rather than what. In SQL Server (true for all RDBMS) you never tell the SQL compiler how you want it to fetch data, you tell it what you want. That is exactly what Microsoft is trying to achieve with .NET 3.5.

By abstracting / generalizing the how from the programmer, the compiler will be able to make smart decisions on the most optimum way to get the desired results (just like SQL Server does). It is never fool proof and hence we will need some sort of a hinting mechanism (again just like SQL Server) for better performance.

In the end the biggest gain by abstraction is that when you run the same program on machines that have 2, 4 or 10 core processors (near future) the compiler can generate the how part of your code such that the CLR can divide the task and run the sub-tasks on different cores, merge the results from the sub-tasks into one result and return it to the program. This would lead to faster executions and hence better performance.

.NET 3.5 is the first step in this direction, Microsoft has a research project going on for almost a year now on PLINQ (Parallel Language INtegrated Query). I think we will see the fruits of this project in the next 2-5 years. Until then we can only feel dumb as more and more code gets auto-generated leaving less and less work for the developers. Look at the positive side, if we were still writing assembly code we wouldn't have been come so far in the computing world.


Is C# 3.0 a copy of Hibernate?

When you look at the features (LINQ) Microsoft is adding to C# 3.0 you would say hey! wait a minute, that is a rip off of Hibernate. I think not. Why? because the main goal of Hibernate is to give you persistent storage and a very SQL like way of accessing the database. While that is what you can do in C# 3.0 the similarities stop right there. In LINQ you can query collections irrespective of where that collection came from. It may have come from the database or an XML file, flat file or any other source (Active directory, in memory collection created by you, anything). Hibernate, as it works with databases needs XML files for configuration. LINQ does not as it does not care about the source. The other big difference is that LINQ is baked right into the framework so you can be sure when it gets released that all built in classes (all meaning the ones that you think should) will support LINQ.

More later ... (after I get flamed for this post Smile)


Visual Studio 2007 (Orcas)

Looks like Microsoft has been busy working on the next version of Visual Studio codenamed Orcas (may be named VS 2007) scheduled to ship by the end of this year. A ton of features and performance improvements. You can read all about it here and here. Also note that when VS 2007 ships we will have a new framework versioned 3.5. I personally think Microsoft has messed up versioning. Up until v.2.0 everything was actually v.2.0 (ASP.NET 2.0, C# 2.0, CLR 2.0) but when Microsoft released WinFX the new set of technologies for Vista, they decided to rename it to .NET 3.0. Which means that all these WinFX technologies sit under the .NET umbrella.

So what does that mean? It means v.3.0 consists of  CLR 2.0 (ASP.NET 2.0, C# 2.0) + WinFX (1.0). When v.3.5 ships it will be CLR 3.0 (ASP.NET 3.0, C# 3.0) + WinFX (1.0). WOW! I need to take a break, my head is already spinning just by typing all this.

Note: I am not finding enough time to write Part 2 of the C# 3.0 series, so posts like these are simply fillers Sad


Channel 9 videos

Good Channel 9 videos on the future of .NET. I used to have a lot of debate with a friend of mine on .NET vs Java. The outcome of it was, I always learnt what was going in the Java world.

Ask the Expert: Anders Hejlsberg
Software Composability and the Future of Languages

Anders Hejlsberg (the chief architect of C#) talks in the first video about the Java language not getting to innovate a lot because of the Java Community Process where multiple people drag the language in different directions.

.NET languages this year are getting a lot of dynamic language features (Python, Ruby and so on). It makes me curious to see what approach Java is taking. With .NET it's time to start learning new syntax and language features. The new version of these languages are due to be released by the end of this year. My guess is that it will be ready by the Microsoft Professional Developers Conference scheduled for the month of October.


Added Captcha support

I finally found some time to work on the website and have added the captcha support I talked about in my last post. While it is a lot more annoying right now, the real use for it will come when I add the ability to enter comments / feedback from the main page itself. That would be a real powerful feature as the user can not only read previous comments but also add their own, and just move on to the next post without going back and forth between pages. Just better user experience.


Captcha support

I am planning to add CAPTCHA support to the blogging engine. For those who don't know what CAPTCHA is, remember those web sites that ask you to enter the text displayed in a distorted image before submitting the page? That's what CAPTCHA is. You can read more about it over here.

It is very easy to write code that would programmatically post hundreds of comments within a couple of seconds and bring your web site down. This has been the problem for many forums / blog sites, hence most blog sites do not allow anonymous comments anymore. Not many people know about my site and hence I don't have that threat, but I want to implement a feature where you don't have to leave the main page to add a comment or read existing comments. Having to navigate back and forth between pages breaks the reading experience. In order to implement the ability to add / read comments from the main page, I will have to use AJAX. I plan to use webservices that would add / retrieve comments. This website being open for anonymous users, anyone can add comments, which means that if someone gets the path to my webservice (which is easy, just "view source" to get it) they can easily post thousands of comments through the webservice as it would not be authenticated. The best protection against it is to add CAPTCHA support.

Here's my plan:
Phase I: Add captcha support to the existing feedback page, see how it goes. I am in no hurry to get this done, will plan and get it out in the next couple of weeks. To create the CAPTCHA distorted images, I would be using the code from the DotNetNuke project instead of re-inventing the wheel.

Phase II: Once all hurdles from Phase I are overcome, add webservices that would create / retrieve comments from the main page on the fly.


Virtual Path Provider

I have been trying to find material reading on the Virtual Path Provider (VPP) feature of ASP.NET 2.0. So far I haven't found a lot. The whole concept is supercool. If you visit the new MSDN website, it is built on VPP. The cool thing about VPP is that all those pages that you see are not actual physical ASP.NET files, instead they are all coming from a backend database. The most important feature from a user stand point is that you can query a website through the url. Yes you heard me right. Type http://msdn2.microsoft.com/system.net and you will be redirected to the .NET libary's System.Net namespace homepage. You can do the same with any class in the framework. Try http://msdn2.microsoft.com/System.String. That is simply awesome.