3 ms·
As the designer of D, I can attest that syntax matters very, very much and it is not just a 'personal' issue. Many times I've discovered that altering the synt
by WalterBright 9y ago
As the designer of D, I can attest that syntax matters very, very much and it is not just a 'personal' issue.
Many times I've discovered that altering the syntax for something (not its semantics) can completely transform its use.
- le-mark 9y agoInteresting, do you have an example in mind?
- WalterBright 9y agoThe original syntax for lambdas in D worked, but it was so clumsy nobody used it, and people even said "D doesn't have lambdas". Changing it to a much simpler syntax changed everything. old: function double(double a, double b) { return a + b; } new: (a, b) { return a + b; } Currently, the syntax for in/out contracts is being revised for usability: https://github.com/dlang/DIPs/blob/98052839441fdb8c6cc05afccb9a81d084051c4d/DIPs/DIP1009.md https://github.com/dlang/DIPs/blob/98052839441fdb8c6cc05afcc... D has a different syntax for templates than C++, and is far more approachable and convenient: C++: template<class T> void foo(T t) { } template<class T> class S { }; D: void foo(T)(T t) { } class S(T) { }