Conventions and Coding Style #49

taai opened this Issue Jul 31, 2012 · 6 comments


None yet

2 participants

taai commented Jul 31, 2012

It would be great if we stick to Kohana's Conventions and Coding Style:


The reason the project slightly doesn't conform to all of Kohana's style and coding conventions is because we internally have different style and coding conventions that we follow, but we have tried to write the project as close them as possible for the community's sake.

taai commented Aug 3, 2012

Ok, no bracket's in separate lines. And always update the version date. What else? Otherways you're spending time to fix my code. :)


At the moment, here is a list of the style differences between Kohana and Leap:

  1. Use the Compact Control Readability Style.
  2. Always use brackets with single line if/else statements.
  3. When creating an instance of a class, always use parentheses even if you're not passing something to the constructor (e.g. $db = new Database();).
  4. Put spaces around the concatenation operator (e.g. $str = 'one' . $var . 'two';).
  5. Use && and || for Boolean comparisons, except use OR on line 1 of the class file.
  6. Use else if.
taai commented Aug 6, 2012

Wow, that's almost opposite from Kohana's style! Well, I'll try to keep this in mind.


Here are a few other style differences between Kohana and Leap:

  1. Protected and private variables are NOT preceded by an underscore.
  2. Protected and private functions/methods are NOT preceded by an underscore.
@bluesnowman bluesnowman pushed a commit that referenced this issue Aug 16, 2012
Matthew A Mattson Changing && to AND and || to OR (Issues #3 and #49). e55fb56

For this module, we have decided to change bullet point 5 (above) to read:

  • Use AND and OR for Boolean comparisons.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment