iGiveInTo CamelCase

June 10th, 2008

Its a sad sad day for me but I have finally conceded and am going back to camel case. I got lots of good feedback from my original post on CamelCase vs Underscore but the fact remains. The entire ActionScript language is written in CamelCase. Now that I am open sourcing lots of my code I also feel compelled to revert back and help make my code follow suit with what everyone else is doing.

I have used underscores for over 3 years now but as AS 3 becomes more of a “grown up” language I feel the need to follow the language standard and go back. Maybe one day things will change but I highly doubt it. To anyone I have inspired to fight the standard and break the rules I am sorry. May you continue the fight and at heart I will always be an underscore person. To help ease the transition I will continue to follow the same variable prefix convention I have always held onto:

  • publicVarName For public vars I just state them.
  • _privateVarName For private, and protected vars I use a single underscore.
  • __staticVarName For Static vars I use a double underscore.
  • CONSTANT_VAR_NAME For constants I use all caps with underscores since camel case will not work here (I wonder why?).

For functions I never put any underscores for private, protected or static function names. I just find that silly and a pain to type out. And so marks the end of a 3 year tradition. I hope there will be someone else to carry the touch but I am done, for now.

Feel free to rant, flame, agree or whatever in the comments.

3 Responses to “iGiveInTo CamelCase”

  1. Kris Says:

    Oh thats a disappointing that you no longer advocate the underscore case in your own code.

    On a recent project I was attempting the underscore convention but gave up because i kept forgetting to use it. :-)

  2. Myles Says:

    I knew you would come around :). Your next battle will be to put all braces on the following line, make no method more than 5 lines, and don’t use any conditionals. Nerds gone wild! Flash Player 10 stuff looks cool too btw.

  3. pmarsh Says:

    That is a shame. You can always start coding in Ruby if you feel the need to go back to the best naming convention.

Leave a Reply