Quote:
Originally Posted by oo_jazz_oo
Actually, having single like script blocks within if() or loops is common.
The problem in this case is he was asking about a function without brackets.
PHP Code:
function onCreated() { if (foo == bar) return true; } function onPlayerEnters() { for (pl:players) pl.chat = "Welcome!"; }
Both of which are used commonly. At that point, I think its a matter of preference whether you include brackets for 1 line codes.
|
Please don't teach people to exclude braces for one-line statements
. It's a hard habit to break, and it just makes it a pain when you try to change code later.