jackxiao / jslibs

Automatically exported from code.google.com/p/jslibs
0 stars 0 forks source link

Lower Camel Case #66

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Nice JavaScript library, but using upper camel case for functions is wrong.
Sorry. :( When using code and referencing code can be confusing (e.g. can't
tell the difference between objects and functions). I don't know why you
use upper camel case (maybe the developers are from Microsoft ASPNET C#,
another worse thing can't tell the difference between namespaces and
classes without relying on their IDE Intellisense).

Original issue reported on code.google.com by diehardboss@gmail.com on 20 Oct 2008 at 1:41

GoogleCodeExporter commented 9 years ago
Agreed; lowercase function names are pretty standard across the board. The only
reason C# uses uppercase function/"property" (getter/setter) names is to avoid
collisions with private members. Excellent work, otherwise.

Original comment by eplawl...@gmail.com on 21 Oct 2008 at 5:24

GoogleCodeExporter commented 9 years ago
Hi,
ok, it seems that the naming conversion I used is big issue for people.
My only wish was to make my classes clearer because, of course, a JS property 
can
hole any kind of values including functions.
I thought that starting function names with an uppercase and a property with a 
lower
case make code reading easier.
The current problem is that changing function name could break existing users 
code.

Original comment by sou...@gmail.com on 21 Oct 2008 at 9:14

GoogleCodeExporter commented 9 years ago
The following patch un-camel the name of all jslibs functions at runtime.
My idea is to apply this patch before the release of jslibs 1.0.
The behavior will be based on a global boolean flag like 
_functionsAreUpperCamelCase.
After the 1.0 release, I will use lowerCamelCase by default and I will use this 
flag
to allow re-camel function names at runtime.
This will ensure a smooth transition between the two different function naming.

Original comment by sou...@gmail.com on 19 Feb 2009 at 10:47

Attachments:

GoogleCodeExporter commented 9 years ago
see r2253

Original comment by sou...@gmail.com on 27 Feb 2009 at 4:02

GoogleCodeExporter commented 9 years ago
Now jslibs uses lowerCamelCase by default.

Original comment by sou...@gmail.com on 21 Feb 2012 at 8:39