Mathematica 9 is now available
Services & Resources / Wolfram Forums / MathGroup Archive
-----

MathGroup Archive 2010

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Function and object naming conventions

  • To: mathgroup at smc.vnet.net
  • Subject: [mg106755] Re: [mg106701] Function and object naming conventions
  • From: "David Park" <djmpark at comcast.net>
  • Date: Fri, 22 Jan 2010 05:42:07 -0500 (EST)
  • References: <21622849.1264068058488.JavaMail.root@n11>

There aren't any restrictions other than using letters and numbers and
starting with a letter.

But for most work it is strongly recommend that you start with a small case
letter to avoid any possible conflict with present or future Mathematica
built-in names. In packages you might want to start names with caps because
users expect that. But there is a risk.

Stephen Wolfram also followed the practice of almost always using longer
descriptive names. I think that is a good idea. Nor does it introduce much
of a burden if you use the command completion feature of Mathematica. Using
longer descriptive names also reduces the chances of conflict with other
names - WRI names or other package names. They also make it easier to read
the code.


David Park
djmpark at comcast.net
http://home.comcast.net/~djmpark/  
 

From: Canopus56 [mailto:canopus56 at yahoo.com] 

In the VBA-Access world, there are generally accepted sets of naming
conventions for functions, variables and objects, e.g. the Leszynski naming
conventions for MS-Access (and MS-SQL) and the Reddick VBA (RVBA) for VBA. 

Are there a similar set of generally accepted naming conventions for
Mathematica scripts? 

I have seen one general recommendation to use all-lower-case for functions,
since Mathematica proprietary functions use initial caps. 

Thanks - Kurt 



      




  • Prev by Date: Re: How To invert ColorFunction
  • Next by Date: Re: NotebookGet/Read/EvaluateSelection Issues
  • Previous by thread: Re: Function and object naming conventions
  • Next by thread: Re: Re: Function and object naming conventions