Subject: RE: [hackers-il] Sash

From: Chen Shapira <[email-masked]>
Date: Thu, 6 Jul 2000 17:47:53 +0200

> Why not
> 
> const int PIE = 4;
> 
> (that removes the temptation to change PIE)

you are not debating the case of my letters, are you? there must be a subtle
point here that I missed.
Ofcourse I'll use standard conventions when coding. I'll may even go as far
as const int iPIE = 4, if my coworkers are Hugarian and ask me very very
nicely.
But that wasn't the point of the question. the point was #define vs. const.

---

From: Oleg Goldshmidt <[email-masked]>
Date: 06 Jul 2000 21:06:38 +0300

> > (that removes the temptation to change PIE)

You temptations will be cut short by the compiler, though I see your
stylistic point.

> you are not debating the case of my letters, are you? 

He is debating the case of my letters ;-)

> there must be a subtle point here that I missed.

Capitalized PIE will look like conventional macro and will stand out
in the code, and you'll see your constants clearly. Decide for
yourself if it is important or not.

> as const int iPIE = 4, if my coworkers are Hugarian and ask me very very

Refuse. I firmly believe that the Hungarian convention is bad. It's a
lot of visual garbage on top of (hopefully) meaningful identifiers,
and when you decide that int iPIE has to become long int iPIE you will
have to track all the occurrences of iPIE in all of your code and
change them.

More importantly. If you maintain any code written by your Hungarian
(or Ukrainian) co-workers, maintain whatever conventions they happened
to be using. Even if it is Hungarian.

> But that wasn't the point of the question. the point was #define

Just once again: const.

-- 
Oleg Goldshmidt <[email-masked]> 
"... We work but wit, and not by witchcraft;
 And wit depends on dilatory time." [Shakespeare]

---

From: Moshe Zadka <[email-masked]>
Date: Thu, 6 Jul 2000 21:25:36 +0300 (IDT)

> point here that I missed.

No, there isn't. It's just that this helps people who read the code itself
(rather then the definition of PIE/pie) understand that it's a constant.
Those people don't give a flying f**k whether it's a #define or a const,
or just an int -- they want to know what the hell it is doing in your
code, and that is best documented by case.

--
Moshe Zadka <[email-masked]>
There is no GOD but Python, and HTTP is its prophet.

---

From: Omer Mussaev <[email-masked]>
Date: Sun, 09 Jul 2000 10:47:59 +0300

> to be using. Even if it is Hungarian.

Can't be expressed better :)

for example, I do not use upper-case for consts. This does not mattter
much, since I believe that consitstency is above canon.

> ------------------------------------------------------------------------
> Free Conference Calling with Firetalk!
> Click Here!
> http://click.egroups.com/1/5480/12/_/_/_/962906737/
> ------------------------------------------------------------------------
>
> To unsubscribe from this group, send an email to:
> [email-masked]

--
Omer Mussaev    051-308-214   mailto:[email-masked]
systems programmer, Mercury Interactive/RND/Conduct/core