4 ms·
Both decisions to use parentheses for both arrays and argument lists and omitting parentheses for call with arguments come from Ada's design goals of supporting
by hox007 4y ago
Both decisions to use parentheses for both arrays and argument lists and omitting parentheses for call with arguments come from Ada's design goals of supporting programming at large. While this is contrary to some other languages that focus on specifics of implementation, the decision isolated design intent from implementation details.
The original "Rationale for the Ada programming language" book provides a lengthier discussion on these points.
TLDR; The syntax is an intentional language design choice which puts capture of design intent in the forefront over implementation details.
- CivBase 4y agoThat's all well and good but whatever the rationale it still makes code unnecessarily hard to read. A := B; X := Y(Z); Is B a variable name or a function call? Is Y a function or an array? Is Z itself a function call? There is no way to know the answers without looking up the definitions for B, Y, and Z. And the answers are important because function calls can alter the program state and affect performance in ways that a variable deference or array subscript cannot. So when reading Ada code, a developer has to constantly jump around the code base to understand which fundamental language mechanics are being used. It's a frustrating problem for someone who has to review real-time, safety-critical Ada code. And I've never run into that problem with any other language.
- docandrew 4y agoWith more descriptive variable names it’s not really a problem in practice. If B and Y contain verbs, they’re probably procedure/function calls.
- renox 4y agoThere's the same issue with C++ vs C: C++ is better for 'programming in large codebase ' because it can hide/encapsulate more things. But that makes C++ worse for hard real time programming where you want to know what's happening.