4 ms·
> It being a one-pass compiler bugs me (there is no excuse for a modern language to require forward declarations). He refers to the need for forward declaratio
by guenthert 2y ago
> It being a one-pass compiler bugs me (there is no excuse for a modern language to require forward declarations).
He refers to the need for forward declarations as "one-pass compiler". Historically at least, Ada compilers were infamous for requiring many passes and being consequently slow.
Whether it is still acceptable for a programming language to require forward declaration seems to me rather a matter of personal taste. Sure, compilers improved and there's plenty of memory for them to use, but human programmers' capacity increased little, if any, I'd think. I think of those forward declarations as form of double-entry bookkeeping.
- kevlar700 2y agoInteresting. I love Ada and these historical doomed to repeat ourself facts are interesting like Ada books from the 80s talking about AI. Before I switched from Go to Ada I actually used to use var upfront out of preference.
- binary132 2y agoI like forward declarations and think that’s the order that things should be written in anyway.