![]() |
A space or not?
OK, maybe it's just me, but I'm sick of people not adding a space after their if/else/while/etc. keywords. It really annoys me, it's not a function, so add a bloody space!
Just curious, where does everyone stand on this issue? I'm expecting to be a minority here, it seems everywhere I look people are omitting those spaces. Example: PHP Code:
PHP Code:
|
Personally I used to not add a space but in recent months I've decided it makes the code look a lot tidier and more conventional. It doesn't bother me if people don't, but I think it always looks nicer if people do.
|
PHP Code:
|
You're twisting things, short! :-) I don't often put a space, but then again I don't pay much attention to the possibility of a space there. Zend actually gives me a space automatically if I press tab on the autocomplete list, but I tend to type them all myself and keep well away from the tab.
|
It seems once again I've committed an error haha, I'll make sure to keep the space in mind from now on.
|
It is just personal preference... I like to style my if's like below:
PHP Code:
|
Yeh there is no right or wrong way, I just like to rant. Although, of course, I would say my way is the right way :-)
|
Also, I like adding the space, as it's more flowing. You don't do: (Well, most don't do:)
PHP Code:
|
I personally hate space after language constructs. I use this style:
PHP Code:
|
always done it without the space, strange. It annoys me when things arent lined up (and really make things less usable to make them look nicer....) But that has never bugged me, strange that!
|
Quote:
|
I generally (note: not always as there are exceptions!) follow the idea of adding a space between language construct and opening parenthesis, and no space between function name and opening parenthesis. That's always true for functions, but I commonly neglect the space for isset/unset/empty and probably some others that my mind doesn't want to conjure up at this moment.
Back to the original poll question, I always add a space after if, else, while and for. (Note: if you ever see code from me without that space, don't shoot me. It's likely just a typing mistake.) |
No, I find it easier to read with no space.
|
| All times are GMT. The time now is 09:11 AM. |
Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0