6 ms·
I did a bunch of stuff with Ada, and like it a great deal; the core language is rock solid, fast, expressive, and extremely easy to work with. But I still have
by david-given 10y ago
I did a bunch of stuff with Ada, and like it a great deal; the core language is rock solid, fast, expressive, and extremely easy to work with. But I still have a laundry list of issues, and probably would pick something else for future projects. (My current one is in C. C89. Because reasons. Sigh.)
The three biggest turnoffs for me with Ada are:
- case insensitive identifiers. I understand why they chose that, but history has shown that that's not what programmers want, as evidenced by ever other mainstream programming language ever. Also, there's nothing more likely to repel a new developer than forcing them to switch to a new coding style. (It's also weirdly unAdalike; surely a language which puts such an emphasis on correctness and precision wants things that look different to be different?)
- no garbage collector. As soon as you spend any time with the language it becomes obvious that one's been planned right from the very beginning --- it would drop right in. It just hasn't been implemented.
- deeply inscrutable object oriented syntax. I've used it several times and I still have to look it up, every single time, and even so I keep getting it wrong. There are several hidden gotchas --- it only works properly if your class is defined in a named package and all your method declarations need to be next to each other. I think. It's all totally unmemorable and desperately needs a 'class' keyword.
There's some other stuff which would be nice to have, like better strings, or the ability to have pre- and post-conditions on procedure definitions and not just declarations, but for me those are the three big ones.
I might try Nim next, as that looks nice, and appears to have a number of features borrowed from Ada.
- PeCaN 10y agoThe class syntax feels like they wanted to make it clear that an object is just a tagged record with a vtable. Unfortunately, it ended up looking like they were trying to design a Java-like OO system without using the word “class”. Thankfully you can generally avoid OOP in Ada with the really well designed packages and generics. I wish they hadn't tried to tack on OOP or at least not half-assed it so much. I agree with you about the core language. It's elegant and fun to use. The stdlib isn't too bad either. I just wish it either was explicitly GCed or explicitly not-GCed like Rust, instead of “well, it could be GCed, so we'll make pointers kind of safe but kind of not”.
- fghgfdfg 10y agoI rather like Ada. It certainly does have some issues, but I'm not sure I agree completely with all of your points anymore. I have had similar thoughts in the past though. - In practice I don't find the case insensitive identifiers to be much of an issue. GNAT (and perhaps other compilers?) will check for consistent casing if you ask. I'm pretty happy with that middle ground - things that look different are different, and you don't have identifiers that vary by case only. - You're right that it was designed to be able to accept a garbage collector, but it was never intended to be required either. If you really wanted it, you could try targeting the JVM. I haven't found anybody with much experience with it, but it does look like an option. Apparently there is also a 13 year old patch for GCC GNAT [1] but I imagine that's mostly a historical curiosity. - I've gone back and forth on this one. It basically treats classes as any other type, which I like. It would seem pretty strange if you had to change to completely different syntax structure for declaring a tagged or non-tagged type. So if you wanted to do a more traditional 'class' syntax for tagged types, you'd need them for non-tagged types too. That could be both strange and nice. But that wouldn't really fly with the way primitive operations work right now - it can be primitive for more than one non-tagged type, so where does it go? It's actually a pretty complex issue that would have a large impact on some core parts of how the language works. The rules around this sort of stuff are probably some of my least favorite parts of Ada. It's a lot more implicit than the rest of the language, which has gone out of the way to be explicit. I don't think it has an easy syntax-level fix though. Hopefully Nim works out for you, but I found it seemed to mostly be inspired by a few of the complaints you just raised about Ada. It also seems to lack the things I enjoy most about it. [1] http://www.enyo.de/fw/software/gnat-gc/ http://www.enyo.de/fw/software/gnat-gc/
- jordanb 10y ago- case insensitivity I'm not sure it was clear in 1983 that programmers preferred one way or the other. Most languages were case sensitive because it was easier to write the compiler that way and I think programmers "prefer" it now because it's what they are used to. Personally I find the different syntax and conventions as one of the fun things about learning different languages - no GC This is a consequence of the level of abstraction Ada is operating at. Actually I think it's one of Ada's greatest strengths because Ada does a really amazingly good job of implementing the pattern C++ programmers call "RIAA". Ada calls it Controlled Types and it puts the power to manage memory in the hands of the programmer without making it unsafe or prone to bugs. RIAA is implemented so messily in C++ and explained so poorly in the community that I've spoken with C++ programmers who agree that the best way to learn to write good C++ is to learn Ada. - OO Syntax Yeah I agree with your assessment. I think the problem was that Ichbach wanted to make an OO language originally but felt that some OO features (inheritance, dispatching) weren't appropriate in a high-integrity language in 1983. So he ended up making a language that was 80% OO. Then in 1995 it was clear that the language was worse for not having those features so they were shoehorned in.
- cjhanks 10y ago*RAII. And C++ does just fine.
- pjmlp 10y agoAda83 had support for optional GC, but since no vendor ever bothered to implement it, Ada 2005 removed it from the standard. In any case the memory management is quite similar to how Rust does it and in the SPARK dialect for high integrity systems, one isn't even allowed to do dynamic allocations anyway.
- open-source-ux 10y ago"case insensitive identifiers" Why is this considered bad? I tend to think the opposite. I've never come across a convincing argument in favour of case-sensitivity. In fact, every language that is case-sensitive always warns users to be alert to misspelled case-sensitive identifiers as a source of errors. "there's nothing more likely to repel a new developer than forcing them to switch to a new coding style." So the principal reason in favour of case-sensitivity is habit and familiarity on the part of the programmer (rather than any sound or convincing design reasons)?
- watt 10y agoI did some VB6 coding back in the day. I simply loved it how you could write identifier without any regard to case (lowercase), and IDE would bump it to correct capitalization automatically. And when you decide to change capitalization in variable declaration, it would then re-capitalize it in your sources, sort of "rename variable" refactoring lite. And yes, it's pretty insane that languages will treat 2 differently-cased variables as separate, or indeed even allow them. If compiler is allowed to play dumb, at least modern IDEs will flag such code, and modern lints will not allow it.
- pjmlp 10y agoVB.NET still works that way. Likewise the SQL, Oberon and Modula editors, where keywords are uppercase by convention.
- ziotom78 10y agoI believe that Ada allows case insensitive identifiers in order to prevent programmers from using the same names for different variables/procedures. Once I saw some C code like this: int x, X; X = 0; for(int i=0; i < N; i++) { /* long code to calculate the value of x */ ... X += x; } Personally, I appreciate that there are languages which prevent this, like Ada and Pascal.
- ZenoArrow 10y ago> "the ability to have pre- and post-conditions on procedure definitions and not just declarations" Perhaps it wasn't supported in older versions of Ada, but it seems to be supported now. http://www.adacore.com/adaanswers/gems/gem-31/ http://www.adacore.com/adaanswers/gems/gem-31/