Jump to content











Photo
- - - - -

Commas vs non-commas


  • Please log in to reply
121 replies to this topic

#1 Nuno Brito

Nuno Brito

    Platinum Member


  • Team Reboot
  • 10452 posts
  • Location:boot.wim
  • Interests:I'm just a quiet simple person with a very quiet simple life living one day at a time..
  •  
    European Union

Posted 14 March 2010 - 09:00 AM

There has been turbulence at Boot Land regarding the use of commas or not inside the WinBuilder script syntax.

We need to decide amongst a significant majority of .script developers (and wb fans) what will the preferred way for writing code.

Do we use:

echo,"Hello, I'm here!"


OR do we use:

echo,"Hello#$c I'm here!"


Before a poll is raised, I would like to hear good arguments either pro or against the use of commas inside strings.

We also have a nice a google spreadsheet that can be used to write your opinion and weight on either one method or the other:
http://spreadsheets....t...FBN3c&hl=en

Please participate.

Let's be professionals and express good valid arguments why each method is better in certain situations than others and possibly identify the weak points as well.

Above all, let's keep each reply simple and short so that it's also easier for everyone to read and reply back.

Thank you!

:cheers:

#2 pecd.net

pecd.net

    Silver Member


  • .script developer
  • 947 posts
  •  
    Germany

Posted 14 March 2010 - 09:25 AM

Just my two cents, i will not start a big discussion about it...:

For years it seemed clear to me that a comma inside quotes is OK and this was used several 100 times in my projects...

A lot of files would need changes and this would be a hard break in compatibillity.

I agree that sometimes it is neccesary to change things, but to me this seems like the first step towards text like below, because there are reasons to also not have spaces (to get rid of the quotes completely), and writing text like this is aboulutely a bad idea...

Echo,"I#$slike#$scommas#$sinside#$squotes#$c#$sand#$sspaces#$stoo#$s!"

Who can want this? Not me...

#3 TheK

TheK

    Frequent Member


  • Advanced user
  • 141 posts
  • Location:Germany (BW)
  •  
    Germany

Posted 14 March 2010 - 09:30 AM

My vote: Allow commas, get rid of ANY escape characters.

In my opinion this is save AND simple:

echo,"Hello, I'm here!"


I can't see any reason for using escape sequences at all. A lot of programming and scripting languages work find without them.

#4 patsch

patsch

    Silver Member


  • Advanced user
  • 785 posts
  •  
    Germany

Posted 14 March 2010 - 10:00 AM

I'm writing a lot in latex ... from that point of view escape sequences are well known to me :cheers:
but:
when an apostrophe is allowed, why not a comma?
how is a string stored within winbuilder that it could causes problems?
are there parser that have problems in distinguish between comma as a string and coma as a command?
In my opinion, in a string every literal should be allowed and not be represented by its escape sequence or other placeholders

#5 Galapo

Galapo

    Platinum Member


  • .script developer
  • 3841 posts
  •  
    Australia

Posted 14 March 2010 - 10:18 AM

For years it seemed clear to me that a comma inside quotes is OK and this was used several 100 times in my projects...

That's how it's been in the past. But Peter's plan, already beginning to be implemented, is for the removal of quotes: http://www.boot-land...?...ost&p=94253.

Nuno, here's another example:

Acceptable syntax Galapo and Lancelot want:
[Process]

Set,MacroTest,"Exec,%scriptfile%,test",PERMANENT

MacroTest



[test]

Message,got here!,INFORAMTION

Default WB development wants:
[Process]

Set,MacroTest,Exec#$c%scriptfile%#$ctest,PERMANENT

MacroTest



[test]

Message,got here!,INFORAMTION

Now, Lancelot and I aren't against the second option per se, just that it shouldn't be at the expense of the first option. The first option should be catered for and accepted as acceptable syntax and if one wants "speed of processing" for more complex scripts, then the script developer could use Peter's preferred option. All Lancelot and I want to see is that more common sense syntax should not be removed or supported by WB as Peter wants to see happen.

Regards,
Galapo.

#6 Wonko the Sane

Wonko the Sane

    The Finder


  • Advanced user
  • 13749 posts
  • Location:The Outside of the Asylum (gate is closed)
  •  
    Italy

Posted 14 March 2010 - 10:33 AM

How this:

echo,"Hello, I'm here!"

or this:

echo,"Hello#$c I'm here!"


Would be written in batch:
echo Hello, I'm here!

in Basic:
20 PRINT "Hello, I'm here!"

in C :cheers:
int main() 

 {

		printf("Hello, I'm here!");

		return 0;

 }

in B :cheers:
main( ) {

  extrn a, b, c;

  putchar(a); putchar(b); putchar(c); putchar(d);

}

a 'Hell';

b 'o, I';

c ''m h';

c 'ere!';

More:
http://www.roesler-a...lfram/hello.htm

Out of the 428 examples listed, once excluded all assembler langaguages and machine code examples, this is the one most similar (at the level of readability) to Winbuilder:
http://helloworldsit....htm#Whitespace

;)

Wonko

#7 Galapo

Galapo

    Platinum Member


  • .script developer
  • 3841 posts
  •  
    Australia

Posted 14 March 2010 - 10:47 AM

OR do we use:

echo,"Hello#$c I'm here!"

Nuno, your examples tell me that you still haven't completely understood the issues concerned. You've used quotes in this example and under Peter's new syntax regime this is what he's wanting to remove! See particurly his lastest statement to this effect: http://www.boot-land...?...ost&p=94253.

Real examples, then. Peter wants to force us into using (notice no quotes!):
Echo,Hello#$c I'm here!

Lancelot and myself want new users to still be able to use the following without any negative effects (eg Peter's plan he's written about only having his new functions to be available to scripts sticking to his no-quote syntax as above):
Echo,"Hello, I'm here!"

Regards,
Galapo

#8 dera

dera

    Gold Member


  • .script developer
  • 1335 posts
  •  
    Hungary

Posted 14 March 2010 - 11:19 AM

Peter wants to force us into using (notice no quotes!):

Echo,Hello#$c I'm here!

not exactly

as i can see finally psc wants to force this:
Echo,Hello#$c#$sI'm#$shere!
Nuno, cannot you see the nonsesnse here?

#9 MedEvil

MedEvil

    Platinum Member


  • .script developer
  • 7771 posts

Posted 14 March 2010 - 11:20 AM

Real examples, then. Peter wants to force us into using (notice no quotes!):

Echo,Hello#$c I'm here!

Also wrong!
This would be right.
Echo,Hello#$c#$sI'm#$shere!
Though i would prefer the stupid escape sequences gone or at least replaced by some more intuitive and better readable ones, i could also settle for Peters new way.
What i'm absolutely against are syntax exceptions. There should always be one way and only one way, how something can be written, independant from the place it is used in the command.

:cheers:

#10 Galapo

Galapo

    Platinum Member


  • .script developer
  • 3841 posts
  •  
    Australia

Posted 14 March 2010 - 11:23 AM

Also wrong!
This would be right.

Echo,Hello#$c#$sI'm#$shere!

Well, not exactly. Peter's plan is to have to use of #$s optional in this regard. WB will automatically alter the space to #$s when processing the line.

Regards,
Galapo.

#11 Wonko the Sane

Wonko the Sane

    The Finder


  • Advanced user
  • 13749 posts
  • Location:The Outside of the Asylum (gate is closed)
  •  
    Italy

Posted 14 March 2010 - 11:30 AM

What i'm absolutely against are syntax exceptions. There should always be one way and only one way, how something can be written, independant from the place it is used in the command.

It's incredible, I find myself agreeing with Medevil! :cheers: I'm definitely getting old. ;)

What about the preceding comma ?

Echo#$cHello#$c#$sI'm#$shere!

I mean, this way one could write the thing in "human readable format" and then search and replace any occurrence of "," (comma) with "#$c" and all spaces with "#$s", let's call it pre-compiling.

But what about the single quote and the exclamation mark? :cheers:

Echo#$cHello#$c#$sI#$zm#$shere#$e


Only alphanumeric characters A-Z, a-z, 0-9 accepted as plain, and all the rest with escape sequences?

Wouldn't this be more logical?

:lol:

Wonko

#12 MedEvil

MedEvil

    Platinum Member


  • .script developer
  • 7771 posts

Posted 14 March 2010 - 11:37 AM

Well, not exactly. Peter's plan is to have to use of #$s optional in this regard. WB will automatically alter the space to #$s when processing the line.

When spaces are optional, everything else should be optional as well. :cheers:
This is exactly the kind of nonsense, that should be under no circumstances allowed!

:lol:

#13 MedEvil

MedEvil

    Platinum Member


  • .script developer
  • 7771 posts

Posted 14 March 2010 - 11:40 AM

It's incredible, I find myself agreeing with Medevil! ;)

OMG! Isn't that one of the signs of the pending apocalypse? :cheers:

:lol:

#14 TheK

TheK

    Frequent Member


  • Advanced user
  • 141 posts
  • Location:Germany (BW)
  •  
    Germany

Posted 14 March 2010 - 12:12 PM

What i'm absolutely against are syntax exceptions. There should always be one way and only one way, how something can be written, independant from the place it is used in the command.


I agree. Everything else just leads to more confusion about the proper syntax!

#15 pscEx

pscEx

    Platinum Member




  • Amount:

    Team Reboot
  • 12688 posts
  • Location:Korschenbroich, Germany
  • Interests:What somebody else cannot do.
  •  
    European Union

Posted 14 March 2010 - 12:30 PM

That's how it's been in the past. But Peter's plan, already beginning to be implemented, is for the removal of quotes: http://www.boot-land...?...ost&p=94253.

Nuno, here's another example:

Acceptable syntax Galapo and Lancelot want:

[Process]

Set,MacroTest,"Exec,%scriptfile%,test",PERMANENT

MacroTest



[test]

Message,got here!,INFORAMTION

Default WB development wants:
[Process]

Set,MacroTest,Exec#$c%scriptfile%#$ctest,PERMANENT

MacroTest



[test]

Message,got here!,INFORAMTION

Now, Lancelot and I aren't against the second option per se, just that it shouldn't be at the expense of the first option. The first option should be catered for and accepted as acceptable syntax and if one wants "speed of processing" for more complex scripts, then the script developer could use Peter's preferred option. All Lancelot and I want to see is that more common sense syntax should not be removed or supported by WB as Peter wants to see happen.

Regards,
Galapo.

Exactly! :lol:

Your code works in the current alpha and will continue work with the future default "Weak" option which is nothing else like using the current engine.

But to use the optional "Strict" parser which is running much faster, there are stronger rules. And every .script developer can decide voluntarily for the faster method.

Peter

#16 Wonko the Sane

Wonko the Sane

    The Finder


  • Advanced user
  • 13749 posts
  • Location:The Outside of the Asylum (gate is closed)
  •  
    Italy

Posted 14 March 2010 - 01:11 PM

Your code works in the current alpha and will continue work with the future default "Weak" option which is nothing else like using the current engine.

But to use the optional "Strict" parser which is running much faster, there are stronger rules. And every .script developer can decide voluntarily for the faster method.


Exactly! ;)

Which points out the utter futility of the present thread. :cheers:

Decisions have been made, they are not subject to/will be influenced by .script developer's opinions/suggestions, they are not subject to/will be influenced by passer-by's opinions/suggestions, which is a good thing as it is unlikely that the engineer that doesn't listen to the ones that actually use his engine will change anything in it, this way we will have a completely WRONG :cheers: approach, but a stable one :cheers:, the latter being the only important thing. :lol:

Only, Nuno, please, stop asking for opinions, votes, polls or whatever, they are meaningless.

:cheers:

Wonko

#17 cdob

cdob

    Gold Member


  • Expert
  • 1343 posts

Posted 14 March 2010 - 01:30 PM

I prefer a
echo,"Hello, I'm here!"
Make a source code readable by humans.
This should be the default setting, not a option.
Escape sequences are difficult to read. Use a escape sequence at a emergency only.
It's ridicilous to require a escape sequence inside a quote.

future default "Weak" option

Thanks for clarify.
Is this "Weak" parser supported and adjusted in future still?

Contrary winbuilder CPU resource and runtime is disappointing currently .

the optional "Strict" parser which is running much faster

Any idea, how much faster is the new parser?
May be it's tempting to use the new parser.

#18 MedEvil

MedEvil

    Platinum Member


  • .script developer
  • 7771 posts

Posted 14 March 2010 - 01:54 PM

And every .script developer can decide voluntarily for the faster method.

Please please, can i have my very own syntax too, daddy? :cheers:
:lol:

#19 pscEx

pscEx

    Platinum Member




  • Amount:

    Team Reboot
  • 12688 posts
  • Location:Korschenbroich, Germany
  • Interests:What somebody else cannot do.
  •  
    European Union

Posted 14 March 2010 - 02:14 PM

Please please, can i have my very own syntax too, daddy? :cheers:
;)

Make a description of the syntax and write into Wishlist!

Peter :lol:

#20 Wonko the Sane

Wonko the Sane

    The Finder


  • Advanced user
  • 13749 posts
  • Location:The Outside of the Asylum (gate is closed)
  •  
    Italy

Posted 14 March 2010 - 02:48 PM

Please please, can i have my very own syntax too, daddy? ;)
:cheers:


NO :cheers:, unless you start behaving and asking things as you should, (letter to Santa, proper address and ZIP code for North Pole, etc., etc.).

You should also learn this by heart and repeat whenever people is visiting your home :lol::

My Daddy Is The Greatest


My daddy is the greatest;
The best dad there ever was.
He always brings me lots of joy;
He’s my very own Santa Claus.

My daddy can do anything;
He’s smart as smart can be.
I love to walk and hold his hand
To show he belongs to me.


I love my daddy!


:cheers:

Wonko

#21 Nuno Brito

Nuno Brito

    Platinum Member


  • Team Reboot
  • 10452 posts
  • Location:boot.wim
  • Interests:I'm just a quiet simple person with a very quiet simple life living one day at a time..
  •  
    European Union

Posted 14 March 2010 - 03:51 PM

Only, Nuno, please, stop asking for opinions, votes, polls or whatever, they are meaningless.

It was you, Lancelot and Galapo that requested this topic to be made available: http://www.boot-land...?...ost&p=94488

After so many replies in such short time and off-topic discussions going yesterday, I guess this is a matter that will have to be solved so that we can proceed with development.

It's easy to close our eyes and ears against contrary opinions, this is a fair chance and the appropriate place to properly discuss this matter for the future.

So far I'm seeing that we need both commas and non-commas to coexist.

#22 Wonko the Sane

Wonko the Sane

    The Finder


  • Advanced user
  • 13749 posts
  • Location:The Outside of the Asylum (gate is closed)
  •  
    Italy

Posted 14 March 2010 - 04:24 PM

It was you, Lancelot and Galapo that requested this topic to be made available: http://www.boot-land...?...ost&p=94488

Absolutely NOT. :cheers:

Either you or Galapo should create a new topic with a proper title and properly explaining your opinion.

.....
If we want a proper discussion to occur, let's lay out the facts and reasons. Possibly even a poll to see what other folks think.


Why?

If you are interested in popularity of choices rather than quality of final product, start it yourself.


Done!



You suggested us to make such an unneeded thing, and since we would not, you did it.

You are very, very lucky that I am currently in "fun mode" and you can get away with a simple Posted Image.

If I were serious, what you posted would have been pointed out as a FALSE STATEMENT :lol: (as it is :cheers:), and you would have experience my fury:

No, you unnatural hags,
I will have such revenges on you both,
That all the world shall--I will do such things,--
What they are, yet I know not: but they shall be
The terrors of the earth.



So far I'm seeing that we need both commas and non-commas to coexist.

We need some logics to coexist with development of winbuilder, mind you NO MATTER which kind of logics, as long as it is defined, though obviously Vulcan logics is superior to anyone else's Posted Image
and definitely to the one you are currently using, that is UNDOUBTEDLY derived from the Ferengi's Posted Image ;) .

\\//

Wonko

#23 MedEvil

MedEvil

    Platinum Member


  • .script developer
  • 7771 posts

Posted 14 March 2010 - 04:49 PM

I love polls at Boot-land.

Poll: Do you want a red button or a blue button?
All - We want a red button.

I made it a blue button, red looked ugly.

:cheers:


:lol:

#24 Nuno Brito

Nuno Brito

    Platinum Member


  • Team Reboot
  • 10452 posts
  • Location:boot.wim
  • Interests:I'm just a quiet simple person with a very quiet simple life living one day at a time..
  •  
    European Union

Posted 14 March 2010 - 05:05 PM

Poll: Do you want a red button or a blue button?
All - We want a red button.

I made it a blue button, red looked ugly.

Did we now turned into democrats as well? :lol:

Can we please get back on track?

---------------------------------------------------

What I'm trying to understand here are the specific cases where not using commas is absolutely essential. We've been using the human readable format mixed with escape characters whenever necessary but I'm actually interested in knowing more opinions.

I see the example with the Macro provided by Galapo:

Set,MacroTest,"Exec,%scriptfile%,test",PERMANENT

and

Set,MacroTest,Exec#$c%scriptfile%#$ctest,PERMANENT


And understand better that this is is the type of coding that drives the syntax to create exceptions. If SET is originally coded to expect a given number of parameters, adding commas on the run is like opening a pandora's box. We never know when the command ends since it could have plenty of commas along the way.

If we can't with live without commas and if we also can't live with them, what other solutions do you propose to recognize this code portion:

"Exec,%scriptfile%,test"


Using < and > in HTML/XML style?

#25 MedEvil

MedEvil

    Platinum Member


  • .script developer
  • 7771 posts

Posted 14 March 2010 - 05:07 PM

Make a description of the syntax and write into Wishlist!

Just for the record, i've already talked about this 2 months ago.
The relevant postings are in postings 13 to 17.

:lol:




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users