C++ class scopes have the with problem. class foo { // int x; int y; int bar(); }; // in another file int x; foo::bar() // "with whole friggin class scope ..." { return x + y; // global ::x plus class member y } Now uncomment the x in the class declaration, and the x + y now adds two class members.
Which is why C++ has a global scope operator.
Note that it's alluded to in a comment in my comment.
The scope operator is an ugly opt-in mechanism you will only use if you discover the problem.
May be obvious to some, but the braces can be replaced by BEGIN and END keywords by multiple methods, including careful editor search and replace, or use of a preprocessor before compiling (may not handle tokens in strings or comments), or maybe the best option, by hotkey mappings, like BEGIN to some key combo, and END to another.
Oh yeah, I do know that with modern editors it's not such a chore anymore. I just mentioned that as an example of verbosity that slightly annoys me. (The same with Ada too, which I understand also draws inspiration from Pascal).
Yes, I get you now. Agree about the verbosity issue, although, interestingly, it did not bother me at all in Pascal, which I learned as my 2nd language or so, before C.
Noticed it even in the syntax of BCPL (C's grandpa), and, IIRC, BLISS, and of course Eiffel. The 2nd- and 3rd-last above were before my time, only read about them in books. I like Eiffel for many reasons, though. A real pity it did not get more popular.
Oh yeah, I do know that with modern editors it's not such a chore anymore. I just mentioned that as an example of verbosity that slightly annoys me. (The same with Ada too, which I understand also draws inspiration from Pascal).
Yes, I get you now. Agree about the verbosity issue, although, interestingly, it did not bother me at all in Pascal, which I learned as my 2nd language or so, before C. Noticed it even in the syntax of BCPL (C's grandpa), and, IIRC, BLISS, and of course Eiffel. The 2nd- and 3rd-last above were before my time, only read about them in books. I like Eiffel for many reasons, though. A real pity it did not get more popula…
I found BCPL quite cool too, except for the verbosity, which, like Pascal, I did not much feel at the time. I read the whole (slim) book about it, by Martin Richards, its creator, and enjoyed it. Good amount of low-level system programming examples in the book, and it all being in a language with only one type (the machine word), made it more fun to me, although (or because) I did not know of higher level programming constructs at the time.
Nostalgia! I learned programming in my own time on 1980's 8-bit machines, but in college it was Pascal on Vax VMS then Turbo Pascal on, IIRC, an Act Sirius. Loved the language. Then along came JPI TopSpeed Modula-2 (Pascal++ [joke]) and even though I now do C#, Go, Node, Python, Ruby, and FreePascal, nothing matches the sheer productivity and performance that TopSpeed provided. And their IDE was incredible at the tim…
Yeah I have to say if TSM2 had been maintained I'd still be using it. It was badass. Remember that green thread car traffic demo? That was cute. It's unfortunate the tyranny of C never let M2 break through. Opinion is that the software world would would be in better shape now if M2 had gotten a real foothold.
> Remember that green thread car traffic demo?
Indeed - I still have the software (though the disks are long gone).
A few years back I even rewrote that demo in C# (console app) because why not.
Edit: Anders Heljsberg is responsible for C# and TypeScript. Prior to that he wrote what became Turbo Pascal and was chief architect on Delphi. Seems I can't escape his stuff.
As long time follower from Niklaus Wirth work, Oberon is more capable than Pascal, only if you are speaking about the original edition of Pascal in the mid-70's.
Yes, what I have in mind are the languages designed by Niklaus Wirth. What's fascinating about Oberon is how small and clean it is compared to equally capable languages.
Just to stay within what Extended Pascal and Modula-2 allowed for.
The original Oberon and Oberon-07 lacked any support for subranges, enumerated indexes for arrays, co-routines, monitors and exceptions.
Oberon-07 goes even further cutting features from Oberon.
For me the best language from the Oberon family is Active Oberon.
Oberon-07 is a nice exercise in minimalism, but not something I would enjoy using in production.
It seems like the "modern" way to write Pascal would be with FreePascal ( https://www.freepascal.org/ ) and the Lazarus IDE ( https://www.lazarus-ide.org/ ) both of which seem like stable, open and capable projects. That said, i'm afraid that modern Pascal isn't awfully popular, which hurts its practicality a bit (e.g. learning about it, finding tutorials and others' experience with it, getting help). However, it's a…
I had my share of porting C# GUI programs to Object Pascal (Lazarus/Delphi). I think the best part of FreePascal are the "outputs". I will always choose native GUI easily multi-platform programs over framework-dependent bytecode Windows-biased programs. It's also pleasant that you don't have to spend hours figuring out how to compile popular GUI framework X for C/C++ while Lazarus/Delphi just works out of the box. Fo…
I bought this (back in 1986 I think) and used it on a Tatung Einstein running CP/M. I absolutely loved it and went on with TP 4.0, 5.0, 5.5 and 7 then switched to Delphi.
Yes, what I have in mind are the languages designed by Niklaus Wirth. What's fascinating about Oberon is how small and clean it is compared to equally capable languages.
Just to stay within what Extended Pascal and Modula-2 allowed for. The original Oberon and Oberon-07 lacked any support for subranges, enumerated indexes for arrays, co-routines, monitors and exceptions. Oberon-07 goes even further cutting features from Oberon. For me the best language from the Oberon family is Active Oberon. Oberon-07 is a nice exercise in minimalism, but not something I would enjoy using in product…
As the famous quote by Antoine de Saint-Exupéry goes: “Perfection is achieved, not when there is nothing more to add, but when there is nothing left to take away.”