AS2 variable type

Out of context: Reply #10

  • Started
  • Last post
  • 13 Responses
  • skel0

    I have to weigh in on the other camp on this one. It bugs me to no end to see variables suffixed with an underscore and then the variable type.

    Of the advocates the stronger argument would be that it makes code more readable. I would counter that not only does it not add to readability, it makes it more tedious to type in, and encourages generic names for variables. If need be, I admit that I'm biased because I prefer camel, i.e. "myBtn" but I try to be more specific with my variable names.

    The weaker of these is the statement that you might code up as if something were a string when it was really an array, etc. But that's what the ":String" does for you without the underscore riffraff - you're compiler will fail because you've strong typed during its instantiation.

    And then there's those folks that love the underscore so much they prefix private vars with them... and *then* there's the folks that put *two* underscores before...

    grr

View thread