Is LINQ a copy of Hibernate? Part 2
February 5, 2007 § 1 Comment
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?” . 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.