[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

SV: Sv: C/C++ layering in PFile

>>>Not like functions (the () are missing - that's really clear), and they
>>Sometimes, when the address of a function is taken, there isn't a ().
>Rare enough.

>>>also can't be misinterpreted as classes because that's obvious from the
>>If one has to take the context into account, then it will tak one longer
>>quick-read the code.
>With context I mean that classes are types while locals are variables. And
>types occur only in 2 places within a function - in a variable declaration
>(mixing up the type and variable while reading a declaration is, well, very
>stupid) and template instantiation (here it's completely clear until
>template parameters come into play - and we don't have these).
Well, its not a matter of being ABLE to read the code. Its a matter of how
much consciousness is nessecary to do that.

>>>What do you mean with the "start with a capital" sentence? As opposed to
>>>startWithSmallButAllElseCapped or everything_small_and_underscores
>>>or something else?
>That generates some real weirdos:
>openMode /* just weird */
How so?

What's wrong?

What's wrong?

>file     /* is that startSmall or all_small ? */
startSmall. See below.

>URL      /* or more correct uRL ? */
That's bad nomatter what. It looks like a preprocessor symbol. Perhaps it
should be url.

>I think you get it.
Actually, I don't, or... kind of...

I think the reason that this is perfect for me is that all the different
quirks of my personal coding convention supports each other, so as to make
something that is greater than the sum of its parts. When taking apart and
mixed with other conventions, it's not that great.

Like prefixing p to pointers and placing * as if it was part of the type
(well, it is):

char                         *name

Now, looking at the type, I don't know this is a pointer (this is a real

char*                         name

Now, looking at the name, I don't know this is a pointer

char*                         pName

Nomatter where I look, I know what I'm looking at. Its only when the two
conventions are combined there there is a benefit. With only one of them,
they are just stupid or redundant, repectively.

As for seeing wheter the variable "name" is startSmall or all_small... Well,
I don't use all_small...

Also, my convention is also based on putting as much information into the
variable name, as long as it is without drawbacks, suchs as the prefixes
"m_" and "p". They make it unnessecary to use your memory, you just have to
look at the screen, which you are doing anyway, so its faster. Its easier
for me, anyway... :)

Anyway, I don't think there's much point discussing this. You do your thing,
and I'll do my thing.

That looks awfully like I throw all my arguments, then try to close the
discussion... Well, I didn't meant it that way.