Lately, interesting things keep popping up on the same topic.
For instance, what is this great programming principle MapReduce that allowed Google to get a share price of 500 bucks a pop?
It's very simple, read Joel. He's a homo by the way, but that's not why we love him (TM). However, the fact that he frequently hyperbolizes and shamelessly fantasizes is a point against him.
He writes there that it all originated from functional programming, which many badass programmers consider to be a much more powerful and proper tool than our native imperative languages like C.
I haven't read Solzhenitsyn, but I disagree. Maybe functional languages are worth knowing, but for everyday use and readability, they can only be used by a handful of mathematically savvy developers. I wrote about those recently; I'm not capable of it myself.
But what's interesting is that Microsoft will add LINQ to the third version of C#. It's an extremely interesting and powerful tool that does a lot of things. You could even call it unique; there hasn't been anything like it before.
It brings to C# elements of functional languages like lambda expressions. A lamba expression, getting back to our muttons, is just an ultra-shortened definition of a function.
For example, the expression s=> s >5 will define the function
bool Func1(int s)
{
return s >5;
}
Brings elements of scripting languages in the form of dynamic type definition based on the assigned expression
For example, after the expression
var a="text";
the type of variable a will become string , and the value - "text"
(Oh, how this will be abused)
Allows manipulating data in collections and XML, using a SQL-like syntax (this is tied to the capabilities , described above)
And even partially solves the problem of Object-Relational mapping, that is, the automatic correlation of rows in a database table and class members. Usually, a programmer does this by scribbling a ton of code by hand.
In LINQ the query looks like SQL written straight into the code, and is translated into real SQL executing in the database. As a result a new class is automatically created and returned, in which the fields are the columns of the table in the database. And the rows are a collection of such classes.
To all this we should add that LINQ contains built-in Map and Reduce. True, they are called differently there. (This is that very legendary MapReduce from Google, see above.)
Thus, Microsoft not only rips off good ideas once again, but improves them and in some ways even revolutionizes them.
But in my strictly amateurish opinion this will cause the following problems: although the simple application of LINQ improves readability and simplifies working with data, understanding and deeply utilizing LINQ requires a lot of extra effort from unprepared developers. That is, M$ made C# even more complex, more powerful, and somewhat more convoluted.
But the goal was to make it simple and readable, no? If they wanted power, they should have immediately promoted and implemented a functional language like OCAML or Haskell.
True, M$ has its own such language - F#, which is a dialect of OCaml.
MapReduce, LINQ, fnuctional languages
2006-12-15
But it is a wonderful, wonderful, wonderful tool. I will start using it, I am sure. MTs