4 ms·
I would actually really love Ada if it weren't for a couple extremely frustrating syntax decisions: using parentheses for both call arguments and array subscrip
by CivBase 4y ago
I would actually really love Ada if it weren't for a couple extremely frustrating syntax decisions: using parentheses for both call arguments and array subscripts, and making parentheses optional for calls with no arguments. Those two decisions make it incredibly difficult to distinguish between function calls, variables, and array subscripts. I absolutely have to use an IDE for Ada as a result. Also, Title_Case_With_Underscores is just silly.
Otherwise, I agree. Ada is pretty great. It deserves more love.
- sroussey 4y agoWhen I used Ada the IDE was vim. LoL. Actually, I wrote an optimizing compiler for Ada in C++. Also in vim.
- coolspot 4y agoHave you done all those things in vim simply because you couldn’t find how to exit from vim?
- hox007 4y agoBoth 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.
- ibiza 4y agoIs there potential for a Erlang -> Elixir play here? Ada -> Grace :). I find it a shame languages w/ a Pascal lineage are unpopular simply for syntactic reasons.
- deleted 4y ago[deleted]