This article is a nice discussion of various programming languages. I was disappointed that the dislikes of C# were not mentioned, however. Of the dislikes listed I believe the author was quite accurate and I appreciated his thoughts.
In the first half of the article the author discusses what to look for when evaluating a language. As part of that he says:
"Consider what happens when someone proposes a great new language feature. There are several possibilities; the language designer may reject it outright, saying that it doesn't fit in the language.Consider what happens when someone proposes a great new language feature. There are several possibilities; the language designer may reject it outright, saying that it doesn't fit in the language."
This prompted a thought that I don't believe any mainstream languages support. Why can't we write code that runs at compile time and changes what the compiler generates? For example:
I would like to decorate my class with a TraceAttribute such that when the .NET compiler runs a trace message would be inserted at the beginning of the functions on the class. To do this the .NET compiler would call into the TraceAttribute code at runtime and pass the CodeDOM of the class that was decorated with the TraceAttribute. The code inside the TraceAttribute would then be able to iterate through the CodeDOM and insert the call to trace at the beginning of each function. The knowledge of whether the TraceAttribute was a normal custom attribute or a compile time attribute, an attribute invoked at compile time, could be determined by whether it supported an ICompileTimeAttribute or derived from a CompileTimeAttribute.
This is a .NET implementation of such a feature but hopefully the explanation, even in its brevity, makes sense.
Below is one more quote I enjoyed:
"...a language that could prevent really, really bad programmers from doing really, really stupid things probably wouldn't be useful for much else."
11:11:29 AM
|