Skip to main content

javaFX cryptic mixed syntax, why?

5 replies [Last post]
levancho
Offline
Joined: 2008-06-23
Points: 0

I wonder what is the motivation behind to change the way object notation used to work :
(comma delimited )

<br />
 component:<br />
            Slider {<br />
              minimum: 0,<br />
              maximum: 400,<br />
              preferredSize: bind [stageRef.width - 80, 20],<br />
              value: bind cModel.diameter with inverse<br />
            }<br />

into this ("linefeend carriage return" delimited ??? ) :
<br />
 component:<br />
            Slider {<br />
              minimum: 0<br />
              maximum: 400<br />
              preferredSize: bind [stageRef.width - 80, 20]<br />
              value: bind cModel.diameter with inverse<br />
            }<br />

especially if comma delimited syntax is still used and this mixed type of syntax is not really documented anywhere.

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
shagus
Offline
Joined: 2007-05-10
Points: 0

Here is the “motivation”:

Robert Field added a comment - Jul, 25 2008 12:31 PM

We don't look at new lines at all currently -- all white space is just a separator.

the comma or semicolon is just plain optional:

name COLON boundExpression (COMMA | SEMI)?

They are only there if you want to use them for clarity or convention.

So, you want to leave both comma and semicolon as options. And overrides at the bottom only.

Yes?

TAG

Brian Goetz added a comment - Jul, 25 2008 12:36 PM
Yes. Tag.

levancho
Offline
Joined: 2008-06-23
Points: 0

that does not make sense , why would you add extra unnecessary overhead to language to deal with these "optional separators" for no particular reason ?
what was wrong with well adopted (,) way of doing it?
anyways thanks for reply.

moses70
Offline
Joined: 2007-06-21
Points: 0

most modern script languages have optional separators. JavaScript, Groovy, ...
Don't ask why, it just is.

levancho
Offline
Joined: 2008-06-23
Points: 0

not completely true, javascript (JSON) does not allow spaces, it only accepts commas and javafx syntax looks much like it, minus the comma enforcement.

athanazio
Offline
Joined: 2003-11-13
Points: 0

I believe that having both (with or without commas) is a good way to avoid common syntax errors from the beginners.