User loginNavigation |
"Crutches in language design", accidental complexity and feature overlap
dmbarbour's new Freedom and Crutches blog post details an interesting point of language design. I found it very relevant to LtU and would be interested in more examples of crutches. Named parameters are given as example. They help to alleviate long parameter lists, but would be unnecessary if the offending functions were reformulated with better abstractions, packing more parameters together in semantically meaningful compounds. Named parameters, he says, also have negative effects on the language:
It's interesting that neelk recently used a very related argument against N-ary function types. If the alternative to n-ary functions is tuples, the alternative to named parameters is passing a record with named field. It is quite difficult, however, to do that "without sacrificing performance" -- you would need value tuples and structures, which brings important implementation subtleties. What other crutches do you know? How should they be avoided? I'm wondering if there are also cases of two language features that are, taken independently, not crutches, being both beneficial, but combined together create a crutch-like feature overlap. Edit: when discussed a given language feature, please try to provide some concrete example of (one of) its intended use case(s). It always help discussion to be less abstract, and it's often interesting to ask oneself: "what is the core of this example? could a simpler facility accomplish this more specific case?". By gasche at 2011-10-14 21:19 | LtU Forum | previous forum topic | next forum topic | other blogs | 12153 reads
|
Browse archives
Active forum topics |
Recent comments
22 weeks 6 days ago
22 weeks 6 days ago
22 weeks 6 days ago
45 weeks 13 hours ago
49 weeks 2 days ago
50 weeks 6 days ago
50 weeks 6 days ago
1 year 1 week ago
1 year 6 weeks ago
1 year 6 weeks ago