I've not found that to be true - C# is a lot of fun to work with.
I've not found that to be true - C# is a lot of fun to work with.
from a in b select a.x
This syntax is actually backwards compared to both SQL and list comprehension syntax is most languages, which have the selector expression is before the input list. E.g in SQL: select b.x from b
Or list comprehensions (in eg. Python): [a.x for a in b]
So why did MS change the syntax like this? Most developers already knows SQL syntax, and Linq queries are supposed to be able to map directly to SQL.The reason it that it is not possible to provide code completion in the selector expression if the type of the list is not yet known. Hence in C# the list is written before the selector expression, so the editor helpfully can list all a's members when typing `select a.`
Another example is "Partial Classes" which is a curious language feature which makes it more smooth to work with UI-designer generated files, but which I don't think has any useful function outside of an IDE.
I don't think many other languages are designed with IDE support in mind in such a way. This makes it possible to provide a very smooth IDE experience.
Besides... when I write SQL I write it thus:
SELECT * FROM BLAH
Then refine to:
SELECT * FROM BLAH WHERE FOO
Before finally adding:
SELECT COL1, COL2 FROM BLAH WHERE FOO
Linq matches the way I construct SQL by putting it into the order I logically think of it:
FROM BLAH WHERE FOO SELECT COL1, COL2
This seem to me to be closer to SQL syntax.
I suspect that SQL was actually designed to match the notational order (but reversing the intent) they still got it wrong: to match the notation, it should be SELECT .. WHERE .. FROM.
a(b(c(x))) is "backwards" because the functions are evaluated in the opposite order than they are written. This is a flaw in math and in most programming languages! I suppose stack-based languages have it right, and the OO method chaining syntax in Linq and in e.g. JQuery has it right, since evaluation order is left-to-right.
How practical would that be nowadays?
How long should it take? And note, most of the time is spent writing the code (~4 minutes).
When working on a big project, if I want to just test out a piece of code, I actually find myself launching the project, pausing it, and using the "Immediate" window in Visual Studio as a REPL, even though it's inconvenient for the purpose.
And here's my comment to another comment on the blog post:
The question is not whether you've used C# extensively and think it is pragmatic, but whether you have used anything better (e.g. Common Lisp) and _still_ think it's as pragmatic you once thought it was. If you say that C# is more pragmatic than, say, using COBOL for an web application, then sure. But the author of this post is correct insofar as new C# features sound a lot better on paper than how they really stack up when wanting to express yourself in code.
Not to even mention that if you go outside of the OOP/procedural paradigm in C# and start coding using functional-style language constructs, C# gets pretty ugly pretty fast.
http://www.paulgraham.com/avg.html
And yes, I actually wish I had more time to spend learning Lisp and using it for web development as well. See my blog (http://ifelipe.net) for what it's worth---though it's on a bit of a hiatus.