The great comments in code

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

User avatar
patrikG
DevNet Master
Posts: 4235
Joined: Thu Aug 15, 2002 5:53 am
Location: Sussex, UK

Post by patrikG »

Can't see anyone having a go at MS source code. It was used as an example, but that's hardly the MS-bashing you're referring to.
User avatar
Buddha443556
Forum Regular
Posts: 873
Joined: Fri Mar 19, 2004 1:51 pm

Post by Buddha443556 »

malcolmboston wrote:the last few posts about microsofts source code etc....

It is absolutely ridiculious to be 'having a go' for there source code, windows 2000 alone is said to be around 30m lines of code, in C++ (a much harder programming language than PHP) of course its going to have hacks, odd flawed areas etc. most of the guys here are used to writing a few hundred lines. some of us are used to developing full-fledged application which can run to quite large but not on the same scale (my work project is curently upto 17k) there is a major difference in 17k + 30m, i have plenty of flawed area's in my design and its not even a fraction of that, couple that with hundred / thousands of people colloborating, its only gonna cause problems.

Its a pretty lame argument tbh
Obviously I offended you with my little jest, I apologize.
User avatar
artexercise
Forum Commoner
Posts: 33
Joined: Thu Nov 20, 2003 9:38 am
Location: Raleigh, NC

Post by artexercise »

A good rule of thumb to avoid humor in your comments is:

If the person checking your work has no sense of humor, don't include any.

True Story.

JOE--
User avatar
patrikG
DevNet Master
Posts: 4235
Joined: Thu Aug 15, 2002 5:53 am
Location: Sussex, UK

Post by patrikG »

It would be a sad world, however, if we'd have to have a child-protection policy disclaimer in every bit of code we write...
User avatar
artexercise
Forum Commoner
Posts: 33
Joined: Thu Nov 20, 2003 9:38 am
Location: Raleigh, NC

Post by artexercise »

very true. I don't think anyone should be advocating malacious comments in their code or anyone elses. I prefer to see a bit of intelligent humor inserted in places.

For instance, after assigning a whole mess of variable at the beginning of a block of code adding

Code: Select all

// * $not_actually_using_this_variable = 'pricelss';
is rather refreshing.

JOE--
User avatar
patrikG
DevNet Master
Posts: 4235
Joined: Thu Aug 15, 2002 5:53 am
Location: Sussex, UK

Post by patrikG »

artexercise wrote:

Code: Select all

// * $not_actually_using_this_variable = 'pricelss';
:lol: :lol: :D
User avatar
Weirdan
Moderator
Posts: 5978
Joined: Mon Nov 03, 2003 6:13 pm
Location: Odessa, Ukraine

Post by Weirdan »

artexercise wrote:A good rule of thumb to avoid humor in your comments is:

If the person checking your work has no sense of humor, don't include any.

True Story.
Agreed.
User avatar
nigma
DevNet Resident
Posts: 1094
Joined: Sat Jan 25, 2003 1:49 am

Post by nigma »

why in gods name would you want to do so (that is, integrate "humor") in the first place!?! I say get the job done and get the hell outta there...
User avatar
artexercise
Forum Commoner
Posts: 33
Joined: Thu Nov 20, 2003 9:38 am
Location: Raleigh, NC

Post by artexercise »

If I were working by contract and knew that my code would definately be passed on to someone who needed to know the essense of the code then perhaps I would be as dry bland and to the point as possible, however...

I can be resonably certain that I'm stuck here (my job) for another 24 years and being the only person who has more than a lick of knowledge about PHP in this place, I need to find something to entertain myself from time to time.

JOE--
Roja
Tutorials Group
Posts: 2692
Joined: Sun Jan 04, 2004 10:30 pm

Post by Roja »

nigma wrote:why in gods name would you want to do so (that is, integrate "humor") in the first place!?! I say get the job done and get the hell outta there...
Because not all of us code only for our day job. Me personally, I work on multiple opensource projects, and let me tell you, I love humor.

Finding an error message that ended output with: "BLERG!" absolutely floored me for several minutes. Thats when I knew I found code and coders that would be a blast to work with. Three years later, I have no regrets. :)

That said, at my day job, I'm pretty much the same as you said: Code that does the job, comments that explain it, and not much else.

Of course, I do sneak in the occasional amusing hidden image, project name, or other easy-to-overlook gag that few would get. (Like the infamous error #42).
Post Reply