REBOL for COBOL programmers |
April 4, 2016
This is a personal note about my own struggle to understand REBOL,
and about the understanding that came to after, and somewhat as a
result of, being on vacation in Seaside Florida in 2016.
This note is not any sort of reference documentaion, so it will
be delivered in the first person, as my own experience.
To an experienced REBOL person, this note will be obvious, and possibly incorrect. But it would be arrogant of me to assume that I am unique in the universe, so there probably is someone else out there who has similar difficulties. We should form a support group. Or, failing that, here is my contribution to our common effort.
References:
Where I went on vacation, the inspriation for this note.
Some relevant comments by Carl:
REBOL Functions are not Commands
From someone who can explain things better:
I took a vacation to Seaside Florida in 2016, the second trip since the first in 2010.
Seaside is a little town that came into being when its founder inherited 80 acres of "wasteland" on the coast of Florida and had to decide what to do with it. Leaving it alone for the use of wildlife seemed to be out of the question, so the question reduced to what to build there. They decided to build a whole town, an actual operating, well-designed, town. They wanted to show a better way of development than the "suburban sprawl" style that had become so common that any other ways were almost forgotten.
So they built it, following certain design principles, and it turned out to be a very nice place. It had narrow streets, houses that followed some design principles, shared common areas, ocean views for everyone, and all those features put together made it a very nice place to be. House prices went up, lots of people wanted to go there.
This year when I went back, it looked like a real-estate gold rush was taking place around it. Building was going on like crazy, small houses were being torn down and replaced with monster houses, tall buildings were showing up near the beach to block the views from inland. Seaside itself still was pretty intact, but all around it the building seemed to be ignoring some of the principles that made Seaside so nice and made people want to come to the area.
So what is going on in a more general terms? I'm a programmer, not a mind reader, but I have a theory. All the features of Seaside are there in plain sight, and everyone feels how nice it is to be there, but people aren't making the connection between those features and the niceness. All they know is that people like to come to Seaside, so let's get in there and start building more houses, and they build in the only way they know how, which is big. And if you have enough money, take the choicest spots for yourselves. It's a free country, after all.
In other words, they can see what Seaside is, but they can't "see" it. They don't realize that all those details that are out there in plain sight are the reason that Seaside is so nice, and if they build more building that ignore those details, they will make something that is not as nice, and if they do too much of that they will destroy the niceness. They look at Seaside and they don't know what they are looking at.
When I saw REBOL, I could see what it was, on the surface. There was the User Guide, the function dictionary, some code samples. But I didn't know what I was looking at. For example, I was used to defining variables. How do I do that in REBOL? OK, it looks like I can just write the variable name and a colon, and then set it to an initial value. After a while I realized that "defining" variables was not really necessary, although one could to it anyway if it made one feel better. But I didn't understand the significance of not having to do it.
REBOL has some significant features:
- There is no formatting. You should follow the style guide for indenting and such, but you don't have to. Conversely, formatting is not part of the syntax, as in python, such that if you don't follow the formatting bad things can happen. The lack of formatting requirements means that you can do things like generate code, or store compact code in a data field in a file.
- There is no punctuation. It does make things a bit harder to follow in some situations, but it also means that a misplaced punctuation mark will not cause your program to run but to run not as you want.
- There is no need to define variables. This can reduce coding quite a bit, and also contributes to the ability to generate code or store code as data.
- Functions return results that can be passed to other functions. That makes a flow of data and reduces the need for temporary intermediate results, which contributes to less code.
- Data types are defined by the format of the data. If you can store your data in formats recognized by REBOL, you can process it with less code.
These features, and other that I am not aware of or don't understand, are things that give REBOL its power. So you should not look at REBOL and wonder how to use it to do things the way you are used to, you should try to do things the REBOL way.
When you look at REBOL, you are not looking at a language that is just different syntax for the same things. You are looking at different things. When you learn a foreign language, it is not just a matter of a substitution cipher where you replace all the foreign words with their translations and suddenly you understand the language. You are learning different ways of thinking and seeing things.
With REBOL you are looking at different ways of expressing solutions to your programming problems. Try to accept and embrace that.