Rockbox.org home
release
dev builds
extras
themes manual
wiki
device status forums
mailing lists
IRC bugs
patches
dev guide
translations



Rockbox mail archive

Subject: Re: Hungarian Notation (was: [patch] peakmeter)

Re: Hungarian Notation (was: [patch] peakmeter)

From: George Styles <george_at_ripnet.co.uk>
Date: Fri, 8 Nov 2002 10:38:10 -0000

I find the biggest advantage is when you want to distinguish your local
variables from global / class / system defined variables/functions, for
example in Delphi, there is a system function 'now' - if I just called my
variable 'now' it would cause problems when I meant to call the function
'now' (well OK you can qualify a variable/symbol name, but its a PITA)

If I call it bolNow then there is no confusion.

g

----- Original Message -----
From: "Daniel Stenberg" <daniel_at_haxx.se>
To: "Rockbox" <rockbox_at_cool.haxx.se>
Sent: Friday, November 08, 2002 10:26 AM
Subject: RE: Hungarian Notation (was: [patch] peakmeter)


> On Fri, 8 Nov 2002, Stuart Tedford wrote:
>
> > > I've fixed a number of bugs where someone accessed member variables
> > > thinking they were local ones. Using m_ prefix makes it very hard to
> > > mistake these.
>
> > Yes, I haven't done any commercial c++ development yet, but I can see
that
> > this "m" prefix would be valuable.
>
> Yes, for C++ or Java, that kind of naming might have a point. Fortunately,
> we don't use any of those in Rockbox! ;-)
>
> > I guess it's important to have coding conventions that help us, not
simply
> > for conventions sake. The best convention is one that applies only the
> > useful parts from other conventions.
>
> I can't but agree to this. We can't sheepishly assume that strict
conventions
> improve the situation for all of us. After all, the people who write the
code
> should probably have a lot to say about this, and so far in this game, I
> can't think of a single problem introduced in the code due to the lack of
> prefixes to variable names.
>
> I dislike prefixes a lot. I think they make reading the code a lot harder
and
> they're annoying when you decide to change type of variables. You've read
> Björn saying the same. I believe Linus is on the same playing field.
>
> The importance of prefixes to variable names is mostly overstated and
IMHO,
> is targeted for environments where lots of programmers are newbies or
general
> losers (read: in the big bad commercial world we all live and work in on
our
> real-life jobs).
>
> Lots of *HUGE* and very successful projects have no prefix conventions at
> all.
>
> --
> Daniel "Bagder" Stenberg -- http://rockbox.haxx.se/
>
>
Received on 2002-11-08

Page template was last modified "Tue Sep 7 00:00:02 2021" The Rockbox Crew -- Privacy Policy