• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Variable and function name space
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Variable and function name space


  • Subject: Variable and function name space
  • From: Adrian Nier <email@hidden>
  • Date: Tue, 31 May 2011 09:48:01 +0200

Is it normal for a programming language to have variables and functions in the same name space?

There were some hard to catch bugs for me over the years that involved a variable and a function having the same name. To never run into this problem again I decided to put underscores before variable names. This also allows me to use names such as _class or _date which might otherwise be reserved keywords.



set doINeedToPutUnderscoresBeforeVariableNames to "Maybe"

try
	return doINeedToPutUnderscoresBeforeVariableNames()
on error
	return "You should start variable names with an underscore."
end try


on doINeedToPutUnderscoresBeforeVariableNames()

	return "You don’t need to put underscore before variable names."

end doINeedToPutUnderscoresBeforeVariableNames _______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users

This email sent to email@hidden

  • Follow-Ups:
    • Re: Variable and function name space
      • From: Axel Luttgens <email@hidden>
    • Re: Variable and function name space
      • From: Thomas Fischer <email@hidden>
  • Prev by Date: Re: tell app, name in string var
  • Next by Date: Re: Filmier to ical
  • Previous by thread: Applescript and VueScan
  • Next by thread: Re: Variable and function name space
  • Index(es):
    • Date
    • Thread