2 Replies Latest reply on Mar 15, 2010 7:59 AM by AdrianWiecek

    Function/Variable naming...

    SpaghettiCoder Level 3

      This may seem like a silly question but is there any negative drawbacks to naming your variables/functions with somewhat longer than normal names?

       

      processTourTabComingSoon():void

      {

       

      }

       

      does it make the app bigger?

       

      does it make the app slower?

       

      Are there any negatives for doing so, or does it simply make your code easier to read?

        • 1. Re: Function/Variable naming...
          Matt Le Fevre Level 4

          It'll make the app larger marginally due to the longer names, but other than that i don't think there are any other noticeable changes.

           

          In the long run i think the benefits such as:

           

          - code that is easier to read by others

          - more intuitive code

          - easier to maintain


          easily outweight the slight negatives.

           

           

           

          so yeah, never skimp on that kind of stuff in my opinion. Like i said the file size will be a tiny bit bigger, and app speed may be a tiny bit slower, but we're taking bytes and barely microseconds here.

          • 2. Re: Function/Variable naming...
            AdrianWiecek Level 3

            Hi,

             

            I prefer longer but more descriptive names in my code. Yes your source files will get a little bigger but that's not a problem unless you have some constraints(like banners) and I think it has nothing to do with performance.

            Generally I put code readability in the first place because it's easier to maintain well written code. Performance issues are usually considerated in later stages of development. As Donald Knuth said: "Premature optimization is the root of all evil".

             

            Regards,

            Adrian Wiecek