Aktuelle Änderungen Printable View Änderungen Bearbeiten
LiskovSubstitutionPrinciple > HomePage > CSharpClear TrailC# is, in some sense, the programming language which most directly reflects the underlying .NET Framework on which all .NET programs run, and it depends strongly on this framework; there is no such thing as an unmanaged C# program.
a Moped is just fast enough to get you into trouble, but not fast enough to get you out of trouble.
A couple years back there was a blog meme floating around called Is Ruby an Acceptable Lisp? When C# 3 came out, there was some quiet discussion in ALT.NET circles that maybe the new language features (the "var" keyword, better type inference, lambdas) would be enough to satisfy us in regards to Language Oriented Programming and keep us from clamoring for Ruby. The answer for me after three months of hands on C# 3 is that C# 3 is NOT an acceptable Ruby. Simply having Duck Typing (or maybe the super type inference that OCaml and other exotic languages have) would have made what we were trying to do easier to code and easier to read. Some of the Fluent Interface work helps to boil down code into a much smaller surface area, but there's still too many extraneous angle brackets, squiggley brackets, and semicolons floating around to make it really readable the same way that a Ruby or Python internal DSL can be. Maybe my entire point here is that C# is simply not Ruby and we shouldn't try so hard to use C# like Ruby.
Unlike most other programming languages, no C# implementation currently includes any distinct set of class or function libraries. Instead, C# is tied closely to the .NET Framework, from which C# obtains its runtime functions and classes.
public interface ISomething <T> where T: SomeClasspublic class Dictionary<K, V> where K : IComparable {}
IComparable can be called on KDuckTypingC# generics are really just like classes, except they have a type parameter. C++ templates are really just like macros, except they look like classes.
So in a sense, C++ templates are actually untyped, or loosely typed. Whereas C# generics are strongly typed.