logoalt Hacker News

jordanbyesterday at 5:40 PM0 repliesview on HN

I learned Ada back in the day, and like it a lot. Always want a project to get back into it. It's more C++ than C though. Arguably, it's C++ done right, or rather, a worse-is-better situation with C++.

One take away is that learning Ada would be a good way to learn the proper way to write C++ code, because the patterns that C++ developers eventually adopted for that level of abstraction are prescribed in Ada. For instance, Ada's Controlled Types map pretty much exactly to the C++ "RAII" pattern.

Ada also is better than C as an embedded language because it has features that make mapping to hardware easier. For instance, it has Representation Clauses that describe to the compiler how a data structure needs to be laid out in memory. It also has native support for bit manipulation. This makes mmaped-io extremely easy and reliable.