Welcome to Dream.In.Code
Become an Expert!

Join 149,515 Programmers for FREE! Get instant access to thousands of experts, tutorials, code snippets, and more! There are 1,343 people online right now. Registration is fast and FREE... Join Now!




Your Commenting & Debugging Best (and Worst) Practices?

 
Reply to this topicStart new topic

Your Commenting & Debugging Best (and Worst) Practices?, Google has a little fun

skyhawk133
15 Jun, 2007 - 09:14 AM
Post #1

Head DIC Head
Group Icon

Joined: 17 Mar, 2001
Posts: 15,262



Thanked: 61 times
Dream Kudos: 1650
Expert In: Web Development

My Contributions
Found this article today talking about some code found in the flash debugger at YouTube.com. Not only are there some really good links for anyone needing to do flash debugging, but the hilarious part are the comments in the code like we got meta fuck yeh!.

Here's a screen shot:
IPB Image


So the question arises, do you ever put fun comments in your code? Do you ever release your code live with these comments still there? Have you ever found funny comments in other people's code?
User is online!Profile CardPM
+Quote Post

Kayne
RE: Your Commenting & Debugging Best (and Worst) Practices?
15 Jun, 2007 - 09:28 AM
Post #2

D.I.C Head
**

Joined: 15 Mar, 2007
Posts: 62


My Contributions
Nope. I never use any comments anyway, except maybe to mark some very small part of code that I may need to find later. Other then that, I'll remember anything that you;d put in a comment and no one else has to read it, so theres no point in puting them in.

But its a whole different story with my variable names.........
(of course within reason and not in anything to importaint)

This post has been edited by Kayne: 15 Jun, 2007 - 09:32 AM
User is offlineProfile CardPM
+Quote Post

no2pencil
RE: Your Commenting & Debugging Best (and Worst) Practices?
15 Jun, 2007 - 09:40 AM
Post #3

My fridge be runnin OH NOEZ!
Group Icon

Joined: 10 May, 2007
Posts: 7,122



Thanked: 76 times
Dream Kudos: 2425
Expert In: Goofing Off

My Contributions
I do this kind of stuff all the time. In particular, I remember I was working on an assembly project that was well over 1500 lines of code, so I would use some choice four letter words at specific points in a comment. I could easily jump to those sections of code using the search feature.

I've also seen a site that had some nudi-ascii art in a comment section of the html.

When I get back to the house, I'll see what else in my code I can find.
User is online!Profile CardPM
+Quote Post

William_Wilson
RE: Your Commenting & Debugging Best (and Worst) Practices?
15 Jun, 2007 - 09:46 AM
Post #4

lost in compilation
Group Icon

Joined: 23 Dec, 2005
Posts: 4,101



Thanked: 25 times
Dream Kudos: 3275
Expert In: Java, C, Javascript

My Contributions
i've tried to keep with real comments in java, since learning javadoc style a couple of years ago. Other languages i'm fairly inconsistent, sparatic notes to myself, sometimes pointing out the obvious, but rarely ever anything "funny". Besides the fact that no one sees 90% of the code i write, and i usually edit what is seen.
User is offlineProfile CardPM
+Quote Post

Nova Dragoon
RE: Your Commenting & Debugging Best (and Worst) Practices?
15 Jun, 2007 - 09:47 AM
Post #5

The Innocent Shall Suffer, Big Time
Group Icon

Joined: 16 Aug, 2001
Posts: 6,145



Thanked: 8 times
Dream Kudos: 515
Expert In: Python, Linux

My Contributions
I was working on fixing MoinMoin wiki's Docbook export utility to make it export docs that validate agaist the schema. No disrespect to the dev cause this formatter is awesome, but I found some # FIXME: This is quite crappy # I don't understand this code .

I comment at the start of methods telling about what is does, and around code if it does something insane.


I've also been looking into literate programming:
http://en.wikipedia.org/wiki/Literate_programming
More specifically Lightweight version
http://infohost.nmt.edu/~shipman/soft/litprog/homepage.html
User is offlineProfile CardPM
+Quote Post

Amadeus
RE: Your Commenting & Debugging Best (and Worst) Practices?
15 Jun, 2007 - 10:01 AM
Post #6

g++ -o drink whiskey.cpp
Group Icon

Joined: 12 Jul, 2002
Posts: 12,349



Thanked: 51 times
Dream Kudos: 25
My Contributions
QUOTE(Kayne @ 15 Jun, 2007 - 01:28 PM) *

Nope. I never use any comments anyway, except maybe to mark some very small part of code that I may need to find later. Other then that, I'll remember anything that you;d put in a comment and no one else has to read it, so theres no point in puting them in.

I expect you'll find that harder to do when you begin to write and release large scale applications.
User is online!Profile CardPM
+Quote Post

dragon-slayer
RE: Your Commenting & Debugging Best (and Worst) Practices?
15 Jun, 2007 - 10:38 AM
Post #7

D.I.C Head
Group Icon

Joined: 6 May, 2007
Posts: 69


Dream Kudos: 100
My Contributions
I sometimes add little smiles to my comments,and that's as far as I go:/,Not that I comment much in the first place



This post has been edited by dragon-slayer: 15 Jun, 2007 - 10:38 AM
User is offlineProfile CardPM
+Quote Post

salindor
RE: Your Commenting & Debugging Best (and Worst) Practices?
15 Jun, 2007 - 04:49 PM
Post #8

D.I.C Head
Group Icon

Joined: 10 Nov, 2006
Posts: 156



Thanked: 4 times
Dream Kudos: 50
My Contributions
I am so forgetful i have to write comments.

But personally I believe code should be written in such away that the code without comments should explain itself.

Then when the code changes, it will still describe itself hopefully. Then I try and intersperce comments everywhere, with the hope that if I had completely forgetton about the project or someone else was looking at the code they can just look at my code and understand what I was thinking (well that might be too much to hope for).

I really like the post about literate programming, but in many ways I feel that may be too restrictive.

But on the other hand, I really believe the code I write is a form of art. I have written code and been so disappointed in the way it looked, I had to keep working on it, till the code looked right.

I never place foul commments in my code, its kind of like going out to a wonderful concert and everything being rather beautiful, and having some let a chain of curse words out. Just lowers your expectation of the source... plus it always has a way of coming up in the most embarassing way.

Salindor
User is offlineProfile CardPM
+Quote Post

ajaymatrix
RE: Your Commenting & Debugging Best (and Worst) Practices?
16 Jun, 2007 - 02:03 AM
Post #9

D.I.C Regular
Group Icon

Joined: 15 May, 2007
Posts: 395



Thanked: 1 times
Dream Kudos: 100
My Contributions
sometimes I put weird file names for my programs ,but my code is well commented most of the time
User is offlineProfile CardPM
+Quote Post

born2c0de
RE: Your Commenting & Debugging Best (and Worst) Practices?
16 Jun, 2007 - 09:59 AM
Post #10

printf("I'm a %XR",195936478);
Group Icon

Joined: 26 Nov, 2004
Posts: 4,026



Thanked: 38 times
Dream Kudos: 2800
Expert In: 80x86 Assembly, C/C++, VB6, VB.NET, C#, J2SE, Win32 API, Reversing

My Contributions
I've never written any industry-level apps before, but I've been having fun commenting right from school.

In Examinations I would write comments like:" Why such a lengthy paper?" or "There's not much time now so I'm not writing this function" wink2.gif

I've also noticed that when I use the Program FileMon (from SysInternals) I do see a few Debug Messages saying: "Opened/Closed the Fucking Connection"
User is offlineProfile CardPM
+Quote Post

spullen
RE: Your Commenting & Debugging Best (and Worst) Practices?
16 Jun, 2007 - 10:01 PM
Post #11

D.I.C Regular
Group Icon

Joined: 22 Mar, 2007
Posts: 330



Thanked: 1 times
Dream Kudos: 50
My Contributions
I comment my code, I think it is habit b/c they force us to do it for my classes. But I think it is good to comment code, at least confusing code so you can remember what it does, or someone else can understand it.
User is offlineProfile CardPM
+Quote Post

NickDMax
RE: Your Commenting & Debugging Best (and Worst) Practices?
16 Jun, 2007 - 11:06 PM
Post #12

2B||!2B
Group Icon

Joined: 18 Feb, 2007
Posts: 2,867



Thanked: 53 times
Dream Kudos: 550
My Contributions
Normally I am pretty boring in my commenting. I have gone so far as to use ASCII art to enter state charts/class diagrams/data chats etc. but never added in anything really fancy, but I have seen some really fancy ASCII art commenting... for some reason I am always impressed at how well one can draw porn in ascii art.

I do tend to comment other peoples code/comments with rather colorful notes when I am really not impressed with the code or its commenting. Usually this does not pass my the occasional "WTF" or "This guy's a frickin genius" but from time to time I let loose some honest to god 4-letter words strung together to express my frustration.
User is offlineProfile CardPM
+Quote Post

Fast ReplyReply to this topicStart new topic
Time is now: 1/7/09 07:58PM

Be Social

Dream.In.Code RSS Feed Dream.In.Code LinkedIn Group Follow Us On Twitter

Live Help!

Tutorials

Programming

Web Development

Reference Sheets

Code Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month