Menu
Can we ban this syntax from the forum?
[code=php]if(statement):
# …
elseif(statement):
# …
else:
# …
endif;
Why do you despise it to such a degree?[/QUOTE]Well it is a remenant left over from before PHP3, its not as clear to read, it contains alien syntax (colons) and it can only serve to make the code harder to read by the majority (more than 99%) that learn the prefered C++ syntax.
I think it's unnecessary to ban use of completely valid syntax just because of it's unfamiliarity[/QUOTE]Well I used the word "ban" more for a joke to get people to read the thread, I didn't mean it literally, I just thought it would be interesting to know other people's views on this.
[code=php]if($something==$somethingelse){
do this
}[/code]
[code=php]if($something==$somethingelse)
{
do this
}[/code]
Personally, I'd like to ban the practice of putting the opening curly braces on the same line as the statement[/QUOTE]Personally I agree but things are not so simple. Many programers have to format their code in a particular style because their employer's legislation dictates it.
because their employer's legislation dictates it[/QUOTE]
Personally I agree but things are not so simple. Many programers have to format their code in a particular style because their employer's legislation dictates it.[/QUOTE]
Personally, I'd like to ban the practice of putting the opening curly braces on the same line as the statement...
[code=php]if($something==$somethingelse){
do this
}[/code]
is WAY harder to read and debug than
[code=php]if($something==$somethingelse)
{
do this
}[/code]
CTB[/QUOTE]
[code=html]<table>
<tr>
<td>Something</td>
</tr>
</table>[/code]
[code=html]<table>
<tr>
<td>Something</td>
</tr>
</table>[/code]
[code=html]<table><tr>
<td>Something</td>
</tr>
</table>[/code]
So.......... some REAL help with how the syntax for a FUNCTION should be laid out would help me tremendously since you are all so bored, lol.[/QUOTE]
[code=php]
function MyFunction($arg1, $arg2, etc.)
{
...etc...
return $some_value;
}[/code]
0.1.9 — BETA 5.14