2 registered members (AndrewAMD, juanex),
1,247
guests, and 6
spiders. |
Key:
Admin,
Global Mod,
Mod
|
|
|
Coding practices - Arghh
#281402
07/27/09 05:09
07/27/09 05:09
|
Joined: Dec 2006
Posts: 434 UK,Terra, SolarSystem, Milky W...
pararealist
OP
Senior Member
|
OP
Senior Member
Joined: Dec 2006
Posts: 434
UK,Terra, SolarSystem, Milky W...
|
This i hate:
void SomeFunction() {
...bla bla
}
I would like to meet the person who came up with that and the reason for it. But then again i am an old timer used to void SomeFunction() {
...bla bla
} Dont know why, but it is one of these (little) things that drive me MAD. Sorry for the ranting, but are there any other "Normal" people out there?
Last edited by pararealist; 07/27/09 05:10.
A8.3x Commercial, AcknexWrapper and VS 2010 Express ○pararealist now.
|
|
|
Re: Coding practices - Arghh
[Re: pararealist]
#281405
07/27/09 05:46
07/27/09 05:46
|
Joined: Feb 2008
Posts: 3,232 Australia
EvilSOB
Expert
|
Expert
Joined: Feb 2008
Posts: 3,232
Australia
|
Me too, but some say I have even worse habits.
...
if(something)
{ blah;
if(something)
{ blah;
if(something)
{ blah;
while(1)
{
blah...
} } } }
"There is no fate but what WE make." - CEO Cyberdyne Systems Corp. A8.30.5 Commercial
|
|
|
Re: Coding practices - Arghh
[Re: DJBMASTER]
#281512
07/27/09 15:15
07/27/09 15:15
|
Joined: Aug 2003
Posts: 7,439 Red Dwarf
Michael_Schwarz
Senior Expert
|
Senior Expert
Joined: Aug 2003
Posts: 7,439
Red Dwarf
|
whoa, finally some sane people here! I really hate those two things too. I really have to a agree with Damocles. Indention is a ABSOLUTE MUST! What drives me crazy, when comparisons have no spaces in between.. umm... well just see (assuming it's a short, one liner): for me it _MUST_ look clean and neat like this: you can see my coding style if you take a peek at my code snippets you can find in my blog *cough**shameless self-advertising**cough*
"Sometimes JCL reminds me of Notch, but more competent" ~ Kiyaku
|
|
|
Re: Coding practices - Arghh
[Re: ventilator]
#281523
07/27/09 16:07
07/27/09 16:07
|
Joined: Feb 2006
Posts: 2,185
mpdeveloper_B
Expert
|
Expert
Joined: Feb 2006
Posts: 2,185
|
I agree with pararealist to a point, but I also agree with Michael. My general code is:
function blahblah()
{
if (blah >= blahblah)
{
//insert alot of code
}
}
but, if it can be a one-liner, I go this way:
function exit_() { while(key_any) { wait(1); ) exit; }
I generally don't put alot of ifs as one liners, but whiles i do and functions i do. It's just a pet peeve. I just go for organization...I can't stand out of place code and brackets that are put right after the function name. There's nothing wrong with people who do it that way, but I don't and I think it looks tacky.... edit: I also normally use a Tab indention, I don't like a 5 space like i have in my examples. edit: yes evilSOB....that's a reaaaaaaaly bad habit.....
Last edited by mpdeveloper_B; 07/27/09 16:11.
- aka Manslayer101
|
|
|
Re: Coding practices - Arghh
[Re: mpdeveloper_B]
#281566
07/27/09 18:22
07/27/09 18:22
|
Joined: Oct 2004
Posts: 4,134 Netherlands
Joozey
Expert
|
Expert
Joined: Oct 2004
Posts: 4,134
Netherlands
|
This is my style, shiver already:
void test( int arg ) { <- I can't stand code without space between parameter and brackets
displayNumber( arg, 14, 23 );
if( arg < 10 ) {
arg = test( arg + 1 );
}
else if( arg == -1 ||
arg == -3 ||
arg == -5 ) {
return -1;
}
else { return 0; }
}
Last edited by Joozey; 07/27/09 18:25.
Click and join the 3dgs irc community! Room: #3dgs
|
|
|
|