Vanilla 1 is no longer supported or maintained. If you need a copy, you can get it here.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.
Naming Conventions for Vanilla 2?
Mark
Vanilla Staff
Hello Everyone!
I've finally left the drawing board for Vanilla 2 and started doing some programming tests to see if many of my ideas will pan out or not.
Since I'm basically starting from scratch, I've got some pretty basic questions that need answering. One of them is about naming conventions. I've written a blog entry about it and I'd love it if you guys took a look and shared your thoughts:
http://markosullivan.ca/blog/?p=43
I've finally left the drawing board for Vanilla 2 and started doing some programming tests to see if many of my ideas will pan out or not.
Since I'm basically starting from scratch, I've got some pretty basic questions that need answering. One of them is about naming conventions. I've written a blog entry about it and I'd love it if you guys took a look and shared your thoughts:
http://markosullivan.ca/blog/?p=43
0
This discussion has been closed.
Comments
If anything I would vote to stay with the same conventions you've got. I much prefer it. It also helps to separate core PHP functions from user-defined ones.
It also allows scope to make underscores more important (e.g. for prefixing extension functions to avoid namespace clashes).
I would also recommend reading about Hungarian Notation. It looks a bit like camelCase, which I hate but it could also be combined with your current notation and an underscore for some extra clarity: i.e. $uv_Name = ForceIncomingString('Name', ''); Would refer to an unsafe, unvalidated form string.
The initial capital for Class seems a good convention to me.
Exactly what you suggested in your blog in fact.
There's a difference between readability and comfort, and I think when many people mention the former, they mean the latter.
ExtensionName_FunctionName() {}
ExtensionName_ClassName {}
I don't know if there's ever been any clashes between extensions using functions/classes with the same name before, but requiring something like the above should prevent any clashes in the future.
Including the extension name in the variable name would be nice for important variables, but probably isn't necessary for all.
Regardless, I definitely agree with timfire up above about leaning on extension authors to prevent the inevitable method or class name collision. Really, unless you have some technical hurdle which will prevent upper case characters in variable/method names, I'd say keep it as-is. The effort to convert at this point seems borderline obsessive.
There's nothing to convert. I'm starting from scratch.
I'm all for Vanilla 2 being PHP5, and will even help support Vanilla 1.x in PHP4 land.