Thanks to your work, that's about to change.
Thank you times a thousand <3
Thanks to your work, that's about to change.
Thank you times a thousand <3
I see you're into horror stories.
Oberon is absolutely a horrible language. It's an example of how you can screw up a good language by insisting on things that were important in 1960-s.
Like not allowing multiple returns (not multiple return _values_ but multiple returns).
Insisting that the problems of 1960 are the only thing that matters, and MUST be solved dogmatically is not.
At the same time, software from 1960-s did not have to deal with a lot of error conditions. When all you have is infallible computation code, you tend to overlook handling cleanups and exceptions. It was also single-threaded, so there was no focus on locking/mutability.
And it turns out that dealing with both of these requires stepping away from pure structured programming with one nice happy path and a single return.
It's the lack of something significantly larger that matters for this myth.
> Hence the long distance railways often use exactly the same gauge - but the exact measurement was a matter of Parliament deciding on what compromise to draw based on early railway lines, bearing in mind that it was a lot easier to reduce gauge rather than increase it.
The Russian railway was specifically designed to be incompatible with others (it's slightly larger) to make it harder for invading forces to use it. But even then it was not that much different from others.
Structured programming was the answer to the earlier mess with unstructured gotos, but in the process of trying to improve it, structured programming became just as messy when taken dogmatically.
In real life, what matters is the mental load. Every ambient condition that you need to track adds mental load. Early returns/breaks/continues reduce it while in a "structured program" you have to keep track of them until the end of the function.
> It's not that hard -- you just have a variable and you set it to what you want to return and the last line of the function returns that variable.
And also have a flag "skip to return" to skip all the conditions. Or you end up mutating arguments of the function. I know, I suffered through programming on Standard Pascal.
Thus it's wise to limit the complexity of your code. If it starts getting difficult, it might be time to break it down in smaller, more understandable, pieces.
E.g. a USB driver.
In comparison, Oberon has... nothing. If you check the source code of Oberon OS for something like USB, a lot of code is either YOLO or a mess of nested blocks.
Unfortunately just like the authors did in 1972, they are keen ignoring other languages learnings.
> Although we entertained occasional thoughts about implementing one of the major languages of the time like Fortran, PL/I, or Algol 68, such a project seemed hopelessly large for our resources: much simpler and smaller tools were called for. All these languages influenced our work, but it was more fun to do things on our own
https://www.nokia.com/bell-labs/about/dennis-m-ritchie/chist...
And thus systems programming without bounds checking was eventually made mainstream