[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-devel
Subject: Re: Re-layout
From: Martijn Klingens <mklingens () yahoo ! com>
Date: 2001-09-16 14:26:30
[Download RAW message or body]
On Sunday 16 September 2001 15:46, Tim Jansen wrote:
> On Sunday 16 September 2001 01:11, Martijn Klingens wrote:
> > Yup. But this serves another purpose. When reading the code you can
> > instantly see whether you are dealing with a local variable in the
> > function (or even a global variable) or a class data member instead.
>
> Other people would argue that if you need this to find out whether a
> variable is local or not then the naming is not your problem but your
> function.
The problem IMO is not the "finding out" in itself, which is often not that
hard. But why would I need to find it out in the first place if a naming
convention would make it instantly clear?
Something that starts with a capital letter in KDE is a class or an enum
member. If it is all capitals then it is a #define or other macro. If it
starts with m_ then it is a class data member and in all other cases it is a
local variable. Easy, isn't it?
Besides, like I said, this mostly helps _others_ who read your code. If code
is not written by yourself, then _any_ piece of consistency helps you
understanding the code quicker.
Martijn
>> Visit http://mail.kde.org/mailman/listinfo/kde-devel#unsub to unsubscribe <<
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic