3 ms·
"Prehistoric" or not, the classical C as created by Kernighan and Ritchie is actually a perfect example of a sensibly minimalist design. Subsequent changes made
by Koshkin 10y ago
"Prehistoric" or not, the classical C as created by Kernighan and Ritchie is actually a perfect example of a sensibly minimalist design. Subsequent changes made to the language have spoiled the characteristic elegance of that design.
- mpweiher 10y agoWell, function prototypes in the first ANSI standard were a fine addition, if you ask me. After that...
- Koshkin 10y agoThis is where it all started. In general, I would agree with you, but the immediate loss of the original elegance and simplicity of the design is obvious. (Also, I believe it was a deliberate design decision to only require that the return type be specified - if it is not 'int' - in a declaration of a function. Besides having resulted in easy-to-understand semantics and an uncluttered syntax, this opened a direct way of dealing with an unknown number and/or types of the arguments without needing any additional syntactical "niceties".)
- mpweiher 10y agoYes, the fact that calling conventions changed with prototypes in a way that was incompatible with and could not be duplicated by the existing calling conventions was a mistake. I wrote a little about a very similar case with Objective-C and the default 'id' argument and return type here: http://blog.metaobject.com/2014/03/cargo-cult-typing-or-objective-c.html http://blog.metaobject.com/2014/03/cargo-cult-typing-or-obje...