If you add line feeds, the readability result is the similar.

if ($foo){
    doFoo();

} elseif ($bar){
    doBar();

} else {
    doSomethingElse();

}

Doing this each structure becomes its own compound sentence or stanza in a 
poem, as opposed to reading like a run-on sentence:

if ($foo){
    doFoo();
} elseif ($bar){
    doBar();
} else {
    doSomethingElse();
}

Or from the Java-like example, like odd placement of punctuation meant more for 
a computer, not a human:

Hello
,
my name is Josh
.
I’m new to this conversation and group
;
so
,
I apologize in advance for any any social faux pas I commit
.
And am open to gentle assistance on that score
.

Cheers,
Josh Bruce




> On Apr 21, 2019, at 8:36 AM, Ben Ramsey <b...@benramsey.com> wrote:
> 
> 
> On Apr 21, 2019, at 04:51, alexey.bor...@gmail.com 
> <mailto:alexey.bor...@gmail.com> wrote:
> 
>> Hi Alexander,
>> 
>> Well, maybe. It's widely used in Java so I've got used to it years ago.
>> 
>> Well, I had a wrong assumption that coding standards are there to help with 
>> code readability and code understanding. Thanks for explaining in great 
>> detail that they are in fact a means to enshrine personal idiosyncrasies and 
>> state "we always do it that way, just because".
> 
> 
> Readability is one reason. Consistency is another. IMO, consistency trumps 
> readability. If people can’t agree on what’s readable, they should be able to 
> agree on what’s consistent. Consistency often leads to readability as you get 
> used to reading the code.
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "PHP Framework Interoperability Group" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to php-fig+unsubscr...@googlegroups.com 
> <mailto:php-fig+unsubscr...@googlegroups.com>.
> To post to this group, send email to php-fig@googlegroups.com 
> <mailto:php-fig@googlegroups.com>.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/php-fig/534A3ADC-2A7C-43A1-A6B5-22BDA54DFA69%40benramsey.com
>  
> <https://groups.google.com/d/msgid/php-fig/534A3ADC-2A7C-43A1-A6B5-22BDA54DFA69%40benramsey.com?utm_medium=email&utm_source=footer>.
> For more options, visit https://groups.google.com/d/optout 
> <https://groups.google.com/d/optout>.

-- 
You received this message because you are subscribed to the Google Groups "PHP 
Framework Interoperability Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to php-fig+unsubscr...@googlegroups.com.
To post to this group, send email to php-fig@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/php-fig/9B7CC110-DCE2-4C2C-89E2-D5328D7F4EFA%408fold.pro.
For more options, visit https://groups.google.com/d/optout.

Reply via email to