Love Fuel?    Donate

FuelPHP Forums

Ask your question about FuelPHP in the appropriate forum, or help others by answering their questions.
Coding Standards
  • I deeply disagree with some of the coding standards.
    at least with one point in particular :)
    Before releasing the stable version I propose the following changes: the curly braces inline:
    function foo() {
        $this->bar();
    }
    

    this is the de facto standard in php as well as many other languages and makes sense.
    it improves readability and is adapted in many of the big frameworks as well (like cakephp). and you already do so for the classes. it would only be logic to do this for functions as well as namespaces...
    besides this major disagreement from my site, I think, the public dir with the assets should not be on the same level as the "fuel" dir (and therefore outside of the app folder - where it actually belongs, obviously).
    besides that it looks really promising.
    PS: and you got a bug - this forum double escapes the text, like quotation marks^^
  • my PS only seems to be valid for the preview box, though
  • This was decided before I got on the team, but I know it's the coding style preference of both Phil & Dan. To be honest I personally don't care, as long as we're conistent. A lot of us, the 4 main devs in particular, come from CI and our coding standards are in many ways the same as theirs.
    I don't get why you included namespaces though: they don't use brackets now, and I see no use in starting to use them. On the default dir structure: we feel it's best to keep your PHP code outside of your webroot and we push our users in that direction by this setup. If you disagree: it's easily configured in the index.php. Neither of these defaults is likely to change, and if you don't like it: it's not enforced, so you can format your own code in any way you like and move the folders around.
  • There is no standard to how PHP code is written, but many style guides. We follow Allman style, but of course you can code in whatever style you like. You don't have to look at the core. :)

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion