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!
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:
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?
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
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.
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.
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.
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.
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.
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.
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.