Welcome Guest, Not a member yet? Register   Sign In
Question about Single Dot Concatenation
#1

Hello,
I have read the PHP Coding Style Guide page. I have a question:

Why single dot concatenation must not be separated from their subjects?
As I understand, the single dot concatenation, like other 2-ary operation, should be separated from their subjects by one space per side (excluding alignment). I think it is more pretty, more clean. Please tell my why is this convention applied?

Thanks for explanation.
If you change, everything will change for you.
Reply
#2

Like any other coding standard, it was a preference of the person who wrote the style guide. All methods have pros and cons, and the style guide only applies to the framework itself, not your code, so if you prefer to put spaces around it - go for it!
Reply
#3

(07-17-2018, 06:11 AM)kilishan Wrote: Like any other coding standard, it was a preference of the person who wrote the style guide. All methods have pros and cons, and the style guide only applies to the framework itself, not your code, so if you prefer to put spaces around it - go for it!

We actually went with spaces around dots in the CodeIgniter4-Standard for PHP Codesniffer. The style guides a little out of date/(TBC)
Reply
#4

On most occasions, I am my own style guide (unless you're the one paying me and say to do it your way).
Reply




Theme © iAndrew 2016 - Forum software by © MyBB