|
Pages: [1]
|
 |
|
Author
|
Topic: suggestion related to "back" and "next" (Read 339 times)
|
|
DrenThales
|
The choice of using the word "back" as the command that returns the series at the current index - 1 seems convoluted to me. The word "back" inheritly implies a doing of something (as in going back). And yet "back" and "next" do not inheritly progress back or to the next index, rather they return the value at such a position; in order to progress "back" or "next", one assigns a word referencing the block to back or next that block. The word "back" has the wrong conoctation and is linguistically inconsistent with the "next" command, it should be changed to "prev" (as in "previous").
Anyway, here's my suggestions for what the series commands in question should be (including some additions):
prev return series at index - 1 next return series at index + 1
back move series index of reference variable back 1 (modify index by - 1) forward move series index of reference variable forward 1 (modify index by + 1)
begin move series index of reference variable to head of series end move series index of reference variable to tail of series
It's true that the user can create such commands names themselves, but I think the standard REBOL should have a more clear use of terms than its poorly chosen use of the words "back" and "next".
Oh, and perhaps also consider "jump" vs "skip". The reason being because the phrase "skip 1" actually linguistically implies moving +2 indexes from the current position (because it's "skipping" a certain # of intermediate values); which is not what it does, it moves +1. Whereas, on the other hand, the term "jump" is less ambiguous in meaning (it makes more sense that "jump 1" means index +1, than that "skip 1" means index +1).
Tell me what you think.
|
|
|
|
« Last Edit: April 07, 2008, 09:12:27 AM by DrenThales »
|
Logged
|
|
|
|
|
btiffin
|
Tricky business the naming game.
Most of us have gotten so used to the series functions that changing them would probably meet with some resistance.
Brian Hawley ported a new FIRST+ to 2.7.6. This new function retrieves FIRST and then advances the series reference. Handy, and it's SOURCE can be a template for other such words.
Good points though. Clarity of meaning is something that REBOL terminology hinders rather than helps in some case.
Cheers
|
|
|
|
|
Logged
|
|
|
|
|
DrenThales
|
Backwards support of terminology is all well and good, but consider what has happened in the syntax of C++, for example. C++ is part of a chain of derived languages whose design is highly backwards compatibility oriented; as such, syntax quirks have accumulated in the language over the years. These quirks make it so that those programming in the language must memorize the quirks, which places substantial burden on productivity and slows the rate at which a programmer can develop the source code. Not only that, it also increases the chance of the programmer making errors, and thus also increases the cost of code maintenance.
REBOL is not as old of a language as C++. It would be better to fix it now than to allow the effect of the syntax deficiencies to accumulate. Also, keep in mind that as this is merely a naming change, which changes no underlying behavior whatsoever, it would be easy to simply perform a find and replace all on the document. Not only that, but REBOL technologies could easily include a program in its releases for automatically making the changes to any given document, until such time as no significant amount of source code using the old terminology exists (after all, one of the things REBOL excels at is parsing text).
REBOL has been said of having the purpose of providing uniform communication between computers, among other things. Clear distinction of meaning in words is an asset to language and communication. The more distinct and clear the words, the more powerful a means of expression a language becomes.
|
|
|
|
« Last Edit: April 10, 2008, 06:33:01 PM by DrenThales »
|
Logged
|
|
|
|
|
DrenThales
|
Now that I've thought about it some more, I think defining my suggested (modification oriented) "back", "forward", "begin", and "end" words would likely actually end up being detrimental, because of the clarity decreasing effect that side effect functions (ie 'procedures') tend to have, when one tries to read source code. Better to just literally write the assignment statements.
Also, now that I think about it, "skip" would be more clear in the context of loop structures and control, so I take back the suggestion of replacing it with "jump".
Also, in suggesting "prev" as a replacement word for "back", I failed to account for the fact that "prev" (ie "previous") has a strong connotation of previous in time, rather than previous in location. To say "prev" might suggest to the reader that the series is being reverted (that it is being moved backwards in time; canceling the current state of the series to set it to the previous state of the series... this would be a bad connotation indeed).
Thus I take back my suggestion, having had time to consider the consequences fully. But it was an entertaining exercise nonetheless.
|
|
|
|
|
Logged
|
|
|
|
|
DrenThales
|
Well, then again, perhaps "prev" isn't so bad a choice after all. I'll have to think about it some more.
|
|
|
|
|
Logged
|
|
|
|
|
notchent
|
You can adjust Rebol with your own dialect, as you see fit: prev: :back
|
|
|
|
|
Logged
|
|
|
|
|
DrenThales
|
Yes, I am aware.
The concern was whether or not the standard name is the best name choice.
|
|
|
|
|
Logged
|
|
|
|
|
fhein
|
I don't think "prev" is a good word since it's an abbreviation of previous, and thus make the code slightly less readable.
|
|
|
|
|
Logged
|
|
|
|
|
|
Pages: [1]
|
|
|
 |
News: 01-09-08 Alpha version of REBOL 3 has been released!
2193 Posts in 573 Topics by 1685 Members
Latest Member: BupQuilegip
|