As C# has progressed, many language features have been added. It has come to the
ID: 643253 • Letter: A
Question
As C# has progressed, many language features have been added. It has come to the point where it's becoming unreadable for me.
As an example, consider the following code snip from Caliburn.Micro code here:
container = CompositionHost.Initialize(
new AggregateCatalog(
AssemblySource.Instance.
Select(x => new AssemblyCatalog(x))
.OfType<ComposablePartCatalog>()
)
);
Now, this is just a small example.
I have a number of questions:
Is this a common or known problem?
Is the C# community finding the same?
Is this an issue with the language, or is it the style used by the developer?
Are there any simple solutions to better understand others code and avoid writing code in this way?
Explanation / Answer
Quick note on where the language is should clear it up: C# is a general purpose programming language; unlike C (like C++) it strives for high abstraction; unlike Lisp dialects it aims for practical expressiveness, and, unlike Java, it is more aggressively driven - Microsoft is quick to respond to demand.
That is why it's turning into a mixture of LINQ, lambdas and weird new keywords - it's adapting to new problem domains quickly, and this is indeed a slippery slope towards a language so complex that very few can use it correctly (like C++). It's not a problem with C# itself, it's a problem with any language with these ambitious goals.
The community is aware of this and, more importantly, the guys behind C# are acutely aware of this (the few blog entries and podcasts on what was behind the new additions in C# 5.0 show how bad these guys want to keep things simple). Microsoft is trying to take some of the load off their flagship such that it doesn't become a tarpit: the introduction of the DLR, a bright spotlight over new languages (F#).
Moreover, course material on C# (including MS certifications) recommends different (but consistent) styles of use for C# depending on the problem - choose your weapon and stick to it: Fluent-style LINQ on some problems, lambdas with TPL on others, plain-old for most.
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.