4 ms·
> For example I never could understand why we need enums. > Why should I ever put const in the argument of a function? Reducing potential state and conveying
by woodman 11y ago
> For example I never could understand why we need enums.
> Why should I ever put const in the argument of a function?
Reducing potential state and conveying programmer intent. Both lead to safer and more performant code (by way of compiler optimizations).
- fithisux 11y agoWhat you say is incompatible with the "Cross-platform assemble", simple language ideals. If that was the intent why not throw namespaces and other goodies in?
- woodman 11y agoWell those ideals are pretty subjective, I'd say that the ideal language would be flexible, performant, safe and productive. As those goals conflict with one another, the ideal language would find the perfect balance. I don't know if C has found that balance, but it has had a pretty good run. Defining sets (enums) and memory access constraints (consts). I wouldn't describe that as high level from a conceptual or practical perspective. Namespaces are simple conceptually but not in practice. The same can be said about the beautiful logical consistency of S-expressions.