[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: constants or readonly variables
From: |
Maynard Wright |
Subject: |
Re: constants or readonly variables |
Date: |
Sat, 07 Nov 2015 05:52:46 -0800 |
User-agent: |
KMail/4.13.3 (Linux/3.16.0-30-generic; KDE/4.13.3; i686; ; ) |
On Saturday, November 07, 2015 11:51:48 AM Francesco Potortì wrote:
> >this is more of a style issue, but be aware that "e" in octave is a
> >built-in
> >
> >octave:1> e
> >ans = 2.7183
> >
> >which you have just overwritten ...
> >It could potentially result in some hard to debug problem.
> >The same goes for "i" "j" (or "pi").
> >I suggest to use "ee" or "ii" or "jj" var names instead.
>
> Which makes me think of something. What you describe is in fact an
> annoying trap when programming in Octave. A useful feature would be to
> have the possibility to mark a variable as constant, or readonly.
Good advice. When I want to use any term that might, however remotely
possible, create any conflict, I add an "h" in some early location that usually
won't change (much) the pronunciation or the meaning of the word. If I would
like to use "integer, " for instance, I use "ihnteger." Just a personal
attempt to keep myself out of trouble.