JavaFX Source formatting suggestions

  2 posts   Feedicon  
Replies: 1 - Last Post: June 05, 2009 16:49
by: rbair
showing 1 - 2 of 2
 
Posted: June 05, 2009 16:45 by rbair
Hey guys,

I'm trying out the Eclipse JavaFX support. One problem I've had is I can't figure out the auto-import command, is it implemented?

But anyway, the purpose of this post is to mention that the recommended code style for object literals uses the <property>: <value> as opposed to <property> : <value> as shown below.

Foo { bar: 1234 }

as opposed to

Foo { bar : 1234 }

We don't have an official code style document yet, but we've sort of formed a bunch of conventions in the SDK after long use Smile

Sometimes we do a single line like above, sometimes on multiple lines, just depending on the complexity of the literal.

Thanks
Richard
 
Posted: June 05, 2009 16:49 by rbair
Just found another issue:

scene: Scene {
width : width;
height : height;
fill : fill;
content : content;
}


There shouldn't be semi-colons following the object literal line. It isn't a syntax error, but we don't ever do it (and I wish the language didn't allow it, but hey). We use comma separators when used in a single line, but just use nothing when declared on multiple lines.
Replies: 1 - Last Post: June 05, 2009 16:49
by: rbair
  • Mysql
  • Glassfish
  • Jruby
  • Rails
  • Nblogo
Terms of Use; Privacy Policy;
© 2010, Oracle Corporation and/or its affiliates
(revision 20120127.ac94057)
 
 
Close
loading
Please Confirm
Close