K&R or read all of Thantos' posts!
K&R or read all of Thantos' posts!
╔╗╔══╦╗
║║║╔╗║║
║╚╣╚╝║╚╗
╚═╩══╩═╝
C programming resources:
GNU C Function and Macro Index -- glibc reference manual
The C Book -- nice online learner guide
Current ISO draft standard
CCAN -- new CPAN like open source library repository
3 (different) GNU debugger tutorials: #1 -- #2 -- #3
cpwiki -- our wiki on sourceforge
Wel, I use Allman style if it's some long code block, like a whole class or something with a bunch of code, otherwise I use the other one. The one which looks like this:
Code:void SayHi(){ std::cout<< "Hi!" <<std::endl; }
Currently research OpenGL
Gawd! So much freedom given to the C/C++ programmer. How would you feel about coding in Python, where consistent indentation is actually part of the required syntax?
I programmed a while in Python before I started with C and I still find the freedom a little disconcerting. Logically I'm drawn toward the Allman style, which visually seems more suitable for my neurotic mind. I'm the kind of person who can't concentrate if there's a book on the desk that's sitting at an angle. In the local library as a kid I'd walk up and down the shelves making sure every book was pushed back as far as it would go. When I'm walking the dog if I look down and one of his ears is turned inside out it drives me crazy - I have to stop and flip it back over. That kind of thing.
I think anyone with this kind of mental illness will be drawn to the Allman style. It's Feng Shui, man!
Feng Shui for dim-wits, I think you mean. A sort of false Feng Shui, aka anal retentiveness -- you are much closer to the truth when you call it neurotic.
I studied perl before C and had the exact opposite experience re: formatting and indentation. Not that I did not systematically indent and format my code, I just did in a somewhat more concise manner. The perl issue around "use strict" (pretty much settled by now) might be a parallel since it involves scoping, but in a syntactically meaningful way.
However, I am gradually enjoying more widespace as I mature. But I would never go allman unless forced to.
C programming resources:
GNU C Function and Macro Index -- glibc reference manual
The C Book -- nice online learner guide
Current ISO draft standard
CCAN -- new CPAN like open source library repository
3 (different) GNU debugger tutorials: #1 -- #2 -- #3
cpwiki -- our wiki on sourceforge
"I am probably the laziest programmer on the planet, a fact with which anyone who has ever seen my code will agree." - esbo, 11/15/2008
"the internet is a scary place to be thats why i dont use it much." - billet, 03/17/2010
However, if you make a "high quality code" mentioned on "Code Complete" book, using PDL you'll definetly prefer the #1 style.
instead of..Code://whenever the current element's value is more than the next element's if(element[i] > element[i+1]) { //then swap the current element to the next one swap(element[i], element[i+1]); }
Code://whenever the current element's value is more than the next element's if(element[i] > element[i+1]) { //then swap the current element to the next one swap(element[i], element[i+1]); }
Just GET it OFF out my mind!!
>if you make a "high quality code" mentioned on "Code Complete"
>book, using PDL you'll definetly prefer the #1 style.
I don't see any meaningful difference. Could you point out why the #1 style is so preferred over the #2 style when using PDL?
My best code is written with the delete key.
What is PDL?
Look up a C++ Reference and learn How To Ask Questions The Smart WayOriginally Posted by Bjarne Stroustrup (2000-10-14)
Elysia: Did I say styles absolutely does something to quality?
Prelude: Did you try it?
Just GET it OFF out my mind!!
I'm in the terrible position of having a family member with severe obsessive compulsive disorder. Needing to have things at just such an angle is not even remotely close to the horrors. I don't want to get into the depressing details, but it's not about quirkiness. It's a complete inability to function in the real world.
Have you seen Jack Nicholson in the movie "As Good As It Gets?" That doesn't even remotely come close. It's a debilitating, terrible, awful, disease that not only ruins your own life but that of everybody around you who cares about you.
Jeez.
Code://try //{ if (a) do { f( b); } while(1); else do { f(!b); } while(1); //}