check out a comment i wrote in my code the other day....

Ye' old general discussion board. Basically, for everything that isn't covered elsewhere. Come here to shoot the breeze, shoot your mouth off, or whatever suits your fancy.
This forum is not for asking programming related questions.

Moderator: General Moderators

Charles256
DevNet Resident
Posts: 1375
Joined: Fri Sep 16, 2005 9:06 pm

check out a comment i wrote in my code the other day....

Post by Charles256 »

Code: Select all

// the paticularly long while statement dynamically generates the navigation menu
			// since theoretically we don't know how many carts there are in the system
			// we need some way to handle it dynamically. it loops the different gk types
			// and then matches this information to the gk type in the actual
			// kart table. this is a n-n relationship;)
			// either way we also have the addition that if no kart is listed
			// under a certian type then it doesn't display their name as a header
			// because if it has no go-karts then what is the point.
			// we may even later add a clause so that it ensures the gk has parts
			// listed before it does anything.
			// the next thing noteworthy is the expand variable. if expand is not set
			// for the paticular group (Which is also dynamically named)
			// then we don't show the actual go karts.
			// rather we wait for the user to select which one he wants to look at
			// before we display anything.
			// the below code might be slightly complex but just remember it's trying to handle
			// all the navigation without actually knowing anything.
			// pretty nifty if i say so myself.
			// for future reference always start at counting at 0, stupid math has
			// peolpe starting at 1...
anyone got anything longer than thaT? I wrote my life story...LOL...sorry.was just browsing over it and started laughing at myself.
User avatar
Ambush Commander
DevNet Master
Posts: 3698
Joined: Mon Oct 25, 2004 9:29 pm
Location: New Jersey, US

Post by Ambush Commander »

You should have used /* */ ;)

You may want to break it up and put the comments in the corresponding code locations. That will help prevent comment rot.
Charles256
DevNet Resident
Posts: 1375
Joined: Fri Sep 16, 2005 9:06 pm

Post by Charles256 »

lol.i love how you just commented on my comment. lol. good stuff:-D

edit : i'm easily amused today.
Roja
Tutorials Group
Posts: 2692
Joined: Sun Jan 04, 2004 10:30 pm

Post by Roja »

I prefer my version:

Code: Select all

// Magic here. Don't touch unless you can conjure larger demons than I can.
Last edited by Roja on Tue Nov 22, 2005 3:06 pm, edited 1 time in total.
User avatar
onion2k
Jedi Mod
Posts: 5263
Joined: Tue Dec 21, 2004 5:03 pm
Location: usrlab.com

Post by onion2k »

I hate comments like that.
Charles256
DevNet Resident
Posts: 1375
Joined: Fri Sep 16, 2005 9:06 pm

Post by Charles256 »

onion,who ya talking too?me or Roja?
Roja, awsome comment. that's probably what I should have done. that loop went like...erm..5 levels deep or somethign like that...let's loop through the loop which loops through the array which has been passed by reference from a class on page 2 of 75....hehe..not quite but you get the idea:-D
User avatar
John Cartwright
Site Admin
Posts: 11470
Joined: Tue Dec 23, 2003 2:10 am
Location: Toronto
Contact:

Post by John Cartwright »

Roja wrote:I prefer my version:

Code: Select all

// Magic here. Don't touch unless you can conjure larger demons than I can.

I just may use this... better than my traditional

Code: Select all

// Don't touch anything here unless you want to be spanked.
Grim...
DevNet Resident
Posts: 1445
Joined: Tue May 18, 2004 5:32 am
Location: London, UK

Re: check out a comment i wrote in my code the other day....

Post by Grim... »

Charles256 wrote:

Code: Select all

// pretty nifty if i say so myself.
:lol:
Charles256
DevNet Resident
Posts: 1375
Joined: Fri Sep 16, 2005 9:06 pm

Post by Charles256 »

what can I say? i get proud of myself occasionally.....now if I could figure out the loop I'm working on now there would be much rejoicing....
Roja
Tutorials Group
Posts: 2692
Joined: Sun Jan 04, 2004 10:30 pm

Post by Roja »

Jcart wrote:I just may use this...
The really cool thing is that I actually had a developer send me an email...

"So I finally have a reason to ask. Just how large a demon can you conjure?"

Which was *exactly* the intent. I don't mind if it changes, I just want considerable thought to go into it.

As it turned out, my ever-so-magical code was reduced to a smoking pile of embers by his much more powerful Demon of Optimization +7. ~70 lines became *20*. Harsh. But thats what happens when Demons battle over code.
Charles256
DevNet Resident
Posts: 1375
Joined: Fri Sep 16, 2005 9:06 pm

Post by Charles256 »

damn! owned!!!! sorry..heh...I've had it happen to me too..I got a snippet of code floating out there I'm certian I could cut in half..I just don't feel like it:-D
User avatar
Burrito
Spockulator
Posts: 4715
Joined: Wed Feb 04, 2004 8:15 pm
Location: Eden, Utah

Post by Burrito »

here is one I dug up from some code I did a while back...

Code: Select all

// I am commenting out the below code because I guarantee the stupidassbeotch will want to go back to what it is now in less than a week...burrito
Roja
Tutorials Group
Posts: 2692
Joined: Sun Jan 04, 2004 10:30 pm

Post by Roja »

Burrito wrote:here is one I dug up from some code I did a while back...

Code: Select all

// I am commenting out the below code because I guarantee the stupidassbeotch will want to go back to what it is now in less than a week...burrito
Smells .. bitter.
User avatar
Burrito
Spockulator
Posts: 4715
Joined: Wed Feb 04, 2004 8:15 pm
Location: Eden, Utah

Post by Burrito »

Roja wrote:Smells .. bitter.
more than you'll ever know...and that's not my nature...but GRRR!!
d3ad1ysp0rk
Forum Donator
Posts: 1661
Joined: Mon Oct 20, 2003 8:31 pm
Location: Maine, USA

Post by d3ad1ysp0rk »

Charles256 wrote: that loop went like...erm..5 levels deep or somethign like that...let's loop through the loop which loops through the array which has been passed by reference from a class on page 2 of 75....hehe..not quite but you get the idea:-D
Refactoring instead of over-commenting anyone? ;)
Post Reply