3 ms·
> If you can remove it, and it still works, it's unnecessary. There are elements in source code whose sole purpose isn't only to express instructions to the co
by DrJokepu 11y ago
> If you can remove it, and it still works, it's unnecessary.
There are elements in source code whose sole purpose isn't only to express instructions to the computer. Expressing the programmer's intent to future readers of the source is obviously also a frequent goal. Comments. Extra parentheses that are not strictly required due to order-of-operations rules. Various annotations and attributes. I mean, these are not exactly new, revolutionary ideas.
- nailer 11y agoYou're completely right: non essential things are fantastic for expressiveness to other developers. I was talking in the context of things which are unnecessary to the compiler, rather than to people. All the things that you mention exist to help the user: that's what indentation's original purpose was, since parenthesis were obviously not good enough. Having the computer respect the same rules humans use is logical and helps remove the chance for inconsistencies.