One thing I like about GS2 that Java doesn't have (but I would not want Java to have; would makes things incredibly complicated.
You can do something like this in GS2:
PHP Code:
function onFoo()
{
if ( isFooing )
{
return;
}
echo( "No, you are not fooing ..." );
}
Whereas in Java you would need to do something like this to get out of a function easily:
PHP Code:
public boolean onFoo()
{
if ( isFooing )
{
return false;
}
System.err.println( "You are not fooing ..." );
return false;
}
Makes it much easier to leave functions when you don't need to specify everything.
Also, when comparing strings you CAN use ==.
PHP Code:
if ( foo == no )
{
echo( "not foo" );
}
vs.
PHP Code:
if ( foo.equals( no ) )
{
System.err.println( "not foo" );
}
Also, I find it nice that you can handle conversions much easier- the system does it for you! What I mean is that an int is a double is a float, etc, where in Java you need to do conversions int.readDouble() ...
Just a few things that are different in Java vs GS2