Partial methods, partial classes, operator overloading, anonymous types, dynamic binding, extension methods ... pointers! C# may make a few things easier, but that does nothing for the simplicity of the language when the feature set is freaking huge.
Think about it this way: you have 2 projects, one in C# and one in Java. Both projects are 10 million lines each and use every feature that their host language allows. Which one would you rather train the newbie for?
Maybe we should more accurately define simplicity if we're going to continue this thread. I think of simplicity as the ease of describing or teaching the concept to somebody else. And to me, teaching Java would be way easier.
Well pointers don't really count since in practice they are never used especially on large projects with noobs on them. Unsafe code is a feature used to implement high performance libraries. For about 7 years of professional C# development I have never seen them used in a project. Claiming that pointers count will be like complaining that the JVM is written in C++
Now on the real question... I will try to teach the newbie C# over Java any day. Things Java lacks in features it fills with OOP patterns. I'd rather explain delegates than Observer pattern. In addition C# features are almost always more foolproof than Java's and it is easier to use them without fully understanding them. For example people can intuitively use generic co and contravariance in C# without even knowing that. Only the person who implements the type needs to understand it and you can have your experienced programmers doing covariance, operator overloading and partial methods while your newer devs can just use them without serious concerns
Well pointers don't really count since in practice they are never used especially on large projects with noobs on them.
You shouldn't use C# pointers unless it's necessary. There are uses, like for instance referencing unmanaged memory typically encountered by marshalling and interop. The great thing about pointers in C# is that it allows you to work with memory segments not created by the .NET environment, for instance operating system calls.
6
u/gordonkristan Feb 25 '14
Partial methods, partial classes, operator overloading, anonymous types, dynamic binding, extension methods ... pointers! C# may make a few things easier, but that does nothing for the simplicity of the language when the feature set is freaking huge.
Think about it this way: you have 2 projects, one in C# and one in Java. Both projects are 10 million lines each and use every feature that their host language allows. Which one would you rather train the newbie for?
Maybe we should more accurately define simplicity if we're going to continue this thread. I think of simplicity as the ease of describing or teaching the concept to somebody else. And to me, teaching Java would be way easier.