Welcome Guest, Not a member yet? Register   Sign In
A question about the future coding style guide
#21

Personally, I went as far as setting up a project in SublimeText3 to check out CI4 with settings to:
- configure SublimeCodeIntel, SublimeLinter, and Phpcs to use php7, and
- set a custom ruleset for Phpcs which I've slowly been putting together to work with the style guide as it evolves.

(I don't remember exactly why I use both Phpcs and SublimeLinter; at this point, I just don't want to mess up a configuration that's working for me.)

Meanwhile, I have a separate project setup to use PSR-2 and PHP5.6 when I'm working on my own site and/or Bonfire.

I don't like everything in PSR-2, and I don't like everything in CI's style guide, but neither is going to make my life difficult.
Reply
#22

PSR is very helpful in case you have multiple developers working on the project, and with everyone having their own style, you can pull in impartial styling guide without anyone getting upset as rules are not personal to lets say "your boss", and everyone have to change a little bit, instead of completely change their way.

(01-04-2016, 11:30 PM)jlp Wrote: There is nothing to prevent you from following PSR2 or PSR37 inside your application, if that makes it easier for you to work with Smile

There is one corner case I can think of right now - controller methods. PSR expects camel case, and CI3 converts methods from dashes to underscores.

I have not checked CI code, but maybe this should either auto-detect if URL my-method-name is my_method_name or myMethodName or it could be explicitly set in config what naming convention devs use in controllers.
Reply
#23

(03-17-2016, 03:15 AM)Pertti Wrote: PSR is very helpful in case you have multiple developers working on the project, and with everyone having their own style, you can pull in impartial styling guide without anyone getting upset as rules are not personal to lets say "your boss", and everyone have to change a little bit, instead of completely change their way.

And in the same way, so is any other styleguide.
That still has nothing to do with CI.
Reply
#24

(03-17-2016, 04:00 AM)Narf Wrote: And in the same way, so is any other styleguide.
That still has nothing to do with CI.

Indeed you are right that any style-guide really does not have nothing to do with CI, and you never know when one goes out of fashion and next gets hyped, I was just thinking out loud why someone would care about it.

Said that we've decided in office to mute all space v tabs warnings and go with tabs anyway Angel
Reply




Theme © iAndrew 2016 - Forum software by © MyBB