by hacknat · 11y ago · 0 comments
Lambdas, null conditionals, LINQ, compile-time generics, etc, none of these features on their own are all that amazing, but when you add them all up it just makes for a more pleasant experience.
Most of my time is spent in Java, building an Android app right now, and C#, building services, and I constantly feel like I'm doing battle with Java's syntax (it's interesting to me that the new Android Studio compresses lambda-like classes, like runnable, to look like lambdas).
In other words, LINQ should have been a library, not a language feature. (In my ideal world. It is possible that someone with better info could see such a move as a terrible mistake.)
I do agree though that LINQ seems to hint at and start evolving C# into a different semi-functional kind of language, and what we're stuck now with is a language with one foot in both worlds. Hopeful another language will come along one day and chisel out those ideas into a more pure form. (and I'm not meaning a pure functional language like for instance F#)
There is obviously a relationship between code like
.Select(blah).From(blah).Where(blah)
and SELECT blah FROM blah WHERE blah,
and I think it would be worthwhile to look into a language feature that allowed a reliable translation between these kinds of things. Maybe I want to write LET a = blah IN blah
from .Let(a, blah).In(blah)
or some such thing. It it just syntactical sugar? Is it a pattern that can be abstracted well?No, that's flat-out wrong. LINQ's main feature is turning code into data: Put code in, get an expression tree out.