Php 我认为这是因为他们不懂语言。我通常不会尝试为不懂我所写语言的人定制我的代码。这就是说,如果在特定情况下,它变得不那么可读,那些专家可能仍然有困难。 if (condition) { /* do something */ } else { /* do som
Php 我认为这是因为他们不懂语言。我通常不会尝试为不懂我所写语言的人定制我的代码。这就是说,如果在特定情况下,它变得不那么可读,那些专家可能仍然有困难。 if (condition) { /* do something */ } else { /* do som,php,c,coding-style,Php,C,Coding Style,我认为这是因为他们不懂语言。我通常不会尝试为不懂我所写语言的人定制我的代码。这就是说,如果在特定情况下,它变得不那么可读,那些专家可能仍然有困难。 if (condition) { /* do something */ } else { /* do something */ } if (condition) /* do something */ else /* do something */ //before if(something) statement; //a
我认为这是因为他们不懂语言。我通常不会尝试为不懂我所写语言的人定制我的代码。这就是说,如果在特定情况下,它变得不那么可读,那些专家可能仍然有困难。
if (condition) { /* do something */ }
else { /* do something */ }
if (condition)
/* do something */
else
/* do something */
//before
if(something)
statement;
//after
if(something)
statement;
addedstatement;
if (last_item) print ", and " else print ", "
if (last_iem)
{
print ", and "
}
else
{
print ", "
}
if (condition) {
// code
} else {
// code
}
// ... or ...
if (condition)
{
// code
}
else
{
// code
}
// ... or ...
if (condition) { /* short code */ } else { /* short code */ }
// ... or ...
condition ? /* short code */ : /* short code */;
if (condition)
// code A
else
// code B
// code C (added by another programmer)
if(...)
{
statement 1;
statement 2;
}
else
{
statement 1;
statement 2;
}
if(...)
{
statement 1;
}
else
{
statement 1;
}
if ($_GET["asdf"]==1):
/* do something */
else:
/* do something */
endif;
if(){}
else (){}
if(checkSomething)
{
//dosomething
}
else
{
//doanotherthing
}
if (x == 0)
x = 2;
else
print("x is: %d", x); // debugging!
x = 4;
/* Warning: bogus C code! */
if (some condition)
if (another condition)
do_something(fancy);
else
this_sucks(badluck);