«« Next » « Previous
«« Next » « Previous

Link Details

Apathy is the suck. Login and vote now.
Link 79078 thumbnail

By carango@gmail.com
via refactorama.blogspot.com
Published: May 04 2008 / 10:32

Have you seen code examples from JavaFX script? The language is very interesting. It contains many new features that may revolutionize the way people create user interfaces in Swing, such as triggers and binding. But one thing that always bothers me about the code examples that I have seen is the insane amount of curly braces that they have to use.
  • 5
  • 3
  • 1391
  • 438

Comments

Add your comment
User 275343 avatar

signal9 replied ago:

0 votes Vote down Vote up Reply

I see what they were trying to do with the language. I am a fan of Erlang where the use of tuples {} and lists [] are heavily used. to be honest once you get the style down pat it becomes easy to learn.

The problem with the code you posted is that each new attribute is on a new line. this is what makes it difficult to understand.

For instance:


[ form,
{type, MyFormType},
{event, {onexit, MyFunc}}
]

is alot easier to understand than:


[ form,
{
type, MyFormType
},
{
event,
{onexit, MyFunc
}
}
]


Indentation can be a problem especially when its coupled with syntax that is supposed to group values. However indentation alone can also get confusing, especially when you are "n" levels deep:


form,
type, MyFormType,
event,
onexit, MyFunc


Just my two cents.
,

User 168451 avatar

aalmiray replied ago:

0 votes Vote down Vote up Reply

The problem is not exactly in the language per se, but that the examples shown so far promote bad programming, same as it happened in the earlier days of Swing (to this day people still run lengthy operations in the EDT). Sure you can use smarter indentation, question is why do people showing JFX do not use it?

Add your comment


Html tags not supported. Reply is editable for 5 minutes. Use [code lang="java|ruby|sql|css|xml"][/code] to post code snippets.

Voters For This Link (5)



Voters Against This Link (3)