10 ms·
Those kinds of features are wonderful and all and they don't add much complexity to having them in your language. The thing that makes languages more or less si
by Touche 4y ago
Those kinds of features are wonderful and all and they don't add much complexity to having them in your language. The thing that makes languages more or less simple (and more or less complex) is the number and degree of abstractions they have. C has relatively few abstractions, which means you can spend more time thinking about what you're building. Most of the C replacements have more abstractions, which means you spend a lot of time thinking about the code itself (am I using the right abstraction here?) and less time thinking about the thing you're building.
That's one thing that has made Zig more attractive as an alternative for (a lot of) C developers, it stays close enough with only small abstractions.
- WalterBright 4y agoI find the opposite is true. Having better abstractions makes the code easier to think about, and hence it's more productive. For example, D: foreach (i; 0 .. 10) { body } C: for (int i = 0; i < 10; ++i); { body } Which one is more better? I can speak from experience that the former is much better, much easier to read, and has fewer bugs. C doesn't allow forward referencing. What this means in practice as people lay out the code in a source file backwards, i.e. the leaf functions come first and the top level functions come last. This is just not the ergonomic way to write code. The public functions should be first and the private leaf functions last. The code should read top to bottom.