Skip to Content.
Sympa Menu

sm-grimoire - Re: [SM-Grimoire] Variable names always use {} - was - Please look at my chrony spell

sm-grimoire AT lists.ibiblio.org

Subject: Discussion of Spells and Grimoire items

List archive

Chronological Thread  
  • From: "Sergey A. Lipnevich" <sergeyli AT pisem.net>
  • To: Mark Andrews <msasgl AT msa-enterprises.com>
  • Cc: sm-grimoire AT lists.ibiblio.org
  • Subject: Re: [SM-Grimoire] Variable names always use {} - was - Please look at my chrony spell
  • Date: Fri, 20 Dec 2002 15:10:15 -0500


Mark Andrews wrote:

2) Include { and } around your variables i.e.: ${SPELL}-${VERSION}.tar.gz --
probably the cure to your frustration


SAL> I disagree. {} is used for complicated operations. Why use it for simple SAL> ones, like getting a value of a variable?

To save Eric having to explain about this again, it's for a number of
reasons:

1) It helps newbies by showing variables more clearly.

$ is clear enough, that's what it's for. Besides, as an IT instructor who taught tens of people how to program, I seriously doubt it helps newbies.

2) It helps prevent bugs such as $SPELL-$VERSIONb.tar.gz

Test the spells before submitting, this will prevent this and many other bugs. Also run `gaze spider'

3) It helps readability and consistancy of the code.

That's very subjective and I wouldn't impose it on anyone. This way, there could be too many requirements. Like, for instance, why all variable assignments are not enclosed in quotes? There may be a space or tab and the correct value is lost


There might be more, but it's a while since this was covered on the
lists and I can't remember the full details, and despite knowing it's
there I can't find the original thread in my archives. <shrug> It's
probably not under an obvious thread - as like this time it was
brought up as a sub topic.

Thanks to your heads up about checking subjects though, I fixed it on
this one so it stands a chance of being found in future ;-)







Archive powered by MHonArc 2.6.24.

Top of Page