Skip to contentSkip to conversation

Coding style - a non-issue

DISCUSSION RaúlNúñez de Arenas Coronado 4 participants 4 messages Nov 30, 2001 – Dec 4, 2001

lore
Share & tools
lore
#0 lore raw

Hi Jeff and Paul :)

Quoted 9 lines
Quoted 4 lines · Paul G. Allen

IMEO, there is but one source as reference for coding style: A book by the name of "Code Complete". (Sorry, I can't remember the author and I no longer have a copy. Maybe my Brother will chime in here and fill in the blanks since he still has his copy.)

Hungarian notation???
That was developed by programmers with apparently no skill to see/remember how a variable is defined. IMHO in the Linux community it's widely considered one of the worst coding styles possible.

Not at all... Hungarian notation is not so bad, except it is only
understood by people from hungary. So the name }:))) I just use it when I write code for Hungary or secret code that no one should read...

Quoted 5 lines
Quoted 2 lines

- Short variable/function names that someone thinks is descriptive but
really isn't.

not all variable names need their purpose obvious to complete newbies. sometimes it takes time to understand the code's purpose, in which case the variable names become incredibly descriptive.

Here you are right. The code can be seen really as a book: you
can start reading at the middle and yet understand some of the story, but it's far better when you start at the beginning ;))) Moreover, most of the variable and function names in the kernel code are quite descriptive, IMHO.

Of course, more comments and more descriptive names doesn't harm,
but some times they bloat the code...

Ra�l

#1 lore raw
Quoted 10 lines · Raúl Núñez de Arenas Coronado
Quoted 5 lines

Hungarian notation???
That was developed by programmers with apparently no skill to see/remember how a variable is defined. IMHO in the Linux community it's widely considered one of the worst coding styles possible.

Not at all... Hungarian notation is not so bad, except it is only
understood by people from hungary. So the name }:))) I just use it when I write code for Hungary or secret code that no one should read...

I prefer Pig Latin myself. ;)

Quoted 7 lines
Quoted 6 lines
Quoted 3 lines

- Short variable/function names that someone thinks is descriptive but
really isn't.

not all variable names need their purpose obvious to complete newbies. sometimes it takes time to understand the code's purpose, in which case the variable names become incredibly descriptive.

Quoted 6 lines

Here you are right. The code can be seen really as a book: you
can start reading at the middle and yet understand some of the story, but it's far better when you start at the beginning ;))) Moreover, most of the variable and function names in the kernel code are quite descriptive, IMHO.

There's no way on earth I would ever start reading at the beginning of 3 million lines of code just so I can understand bobsdriver.o, which is only 10,000 lines. I should not have to start at the beginning of bobsdrvier.o either if I only needed to solve one problem in one function somewhere near the end of it.

I have worked on several large projects and have rarely known how every piece of any of them worked. I didn't have to. I only needed to know about the portion(s) I was responsible for. I was able to do that with the better projects because they were commented correctly and were rather self documenting.

Quoted 3 lines

Of course, more comments and more descriptive names doesn't harm,
but some times they bloat the code...

Actually it bloats the source (we all know C++ bloats the resulting code ;), but what's wrong with that? At least a person can understand what's going on and get to coding, instead of deciphering.

PGA

Signature · 4 lines
Paul G. Allen
UNIX Admin II ('til Dec. 3)/FlUnKy At LaRgE (forever!)
Akamai Technologies, Inc.
www.akamai.com
#2 lore raw
Quoted 7 lines
Quoted 3 lines

Of course, more comments and more descriptive names doesn't harm,
but some times they bloat the code...

Actually it bloats the source (we all know C++ bloats the resulting code ;), but what's wrong with that? At least a person can understand what's going on and get to coding, instead of deciphering.

I'd happily download 50 MB kernel tarballs, if the extra 25 MB were ACCURATE and UP TO DATE comments.

#3 lore raw
In reply to RaúlNúñez de Arenas Coronado
Quoted 3 lines · Paul G. Allen

Actually it bloats the source (we all know C++ bloats the resulting code ;), but what's wrong with that? At least a person can understand what's going on and get to coding, instead of deciphering.

Yes, I do see the smiley, but since its not clear to me on whether its meant as a "j/k" or not, and being tried of listening the same shit for years, I'll have to add that C++ does not bloat code.

Signature · 4 lines
____/|  Ragnar Højland      Freedom - Linux - OpenGL |    Brainbench MVP
\ o.O|  PGP94C4B2F0D27DE025BE2302C104B78C56 B72F0822 | for Unix Programming
 =(_)=  "Thou shalt not follow the NULL pointer for  | (www.brainbench.com)
   U     chaos and madness await thee at its end."