Question about Single Dot Concatenation - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: CodeIgniter 4 (https://forum.codeigniter.com/forumdisplay.php?fid=28) +--- Forum: CodeIgniter 4 Discussion (https://forum.codeigniter.com/forumdisplay.php?fid=31) +--- Thread: Question about Single Dot Concatenation (/showthread.php?tid=71184) |
Question about Single Dot Concatenation - thanhtunguet - 07-17-2018 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. RE: Question about Single Dot Concatenation - kilishan - 07-17-2018 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! RE: Question about Single Dot Concatenation - louisl - 08-08-2018 (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) RE: Question about Single Dot Concatenation - skunkbad - 08-08-2018 On most occasions, I am my own style guide (unless you're the one paying me and say to do it your way). |