0
Bolas

Silly Comments in your Programming/scripting?

Recommended Posts

I'm not a programmer, but I do alot of scripting for my job. I try to make it easy to follow for me and others by including lots of comments, but I sometimes put in something silly or stupid. I was looking for a piece of a script I wrote to reuse and came across this I wrote a while back:

Quote

Ping %computername% -n 1 | find "Reply" > ip.txt
:: -n 1 for One ping only (Imagine Sean Connery in Hunt for Red October for the right effect)
:: remove the colon (Just like Katie Couric)
change ip.txt :



If it's not completely obvious, the lines that start with a :: are comment lines and are skipped by the computer :P

Anybody else do this?
Stupidity if left untreated is self-correcting
If ya can't be good, look good, if that fails, make 'em laugh.

Share this post


Link to post
Share on other sites
My company developed a master/slave protocol that allowed for remote configuration of servers where the master would take over the slaves without warning - we called it "Pimping over SSL" and the roles were "Pimp" and "Ho" - the operation for a pimp to control a remote ho was known as a 'Bitch slap.'

That's about as silly as we get, I think...
7CP#1 | BTR#2 | Payaso en fuego Rodriguez
"I want hot chicks in my boobies!"- McBeth

Share this post


Link to post
Share on other sites
In an error message that should have never come up, I had it display to the user "The gnomes have landed. Run for your lives." ....

Of course, somebody changed something, implemented a bug, and the message came up ...

good thing in the code right next to it, it said "this should never happen." because they were wondering the hell that came from.
This ad space for sale.

Share this post


Link to post
Share on other sites
In paper documentation for government stuff, I used to see:
This page is intentionally blank.
I guess someone was afraid that a reader would think that something was missing, because of a blank page.

So I started putting this comment into the documentation I wrote:
This page would have been intentionally blank, if not for this statement, which by its very presence, renders the page non-blank.

Share this post


Link to post
Share on other sites
I do mechanical design work in Autocad and will sometimes put some picture or text into a drawing at a scale so small noone will ever see it. Usually some comment about the damn engineer on the job.
I've heard that some computer microchips contain microscopic pictures that the chip designer threw in for giggles.

Share this post


Link to post
Share on other sites
Sometimes when I design in Flash, I will have a hidden button that does something completely retarded. I made some animated soccer training once where when you clicked on a certain part of the screen, one of the characters would moon you. :D:P My coworkers loved it.

Share this post


Link to post
Share on other sites
Then you will find many programmers will have difficulty working on your programs after you.

With the way many programmers (especially those around since the late 70s/80s) initialize variables comments are definitely needed


int a vs. int a //for account number

makes a huge difference!

Documentation makes modular programming easier to work with. Its bad enough you get sh!tty design like many of M$ products, but to get it without the proper documentation - ha! you might as well through it in the trash. Your only shooting yourself in the foot without comments/documentation.

Jen
Arianna Frances

Share this post


Link to post
Share on other sites
Not really! I've been writing code for over 15 years, many people have had to come behind me and make modifications... I have only had compliments about my code and how easy it is to follow the logic in what I was doing. I have a *very* strict coding style.

Also, I'd never write:
int a;
for and account number, probably something more like:
int acctNbr=0;

-Trey ;)

Share this post


Link to post
Share on other sites
Practical named variable make a very large difference. I think even more so than documentation, because you have an easier time following them through calls, returns, etc.

I usually commented if it was particularly different. The average stuff should be obvious. Now funny comments are a different story. The linux kernel is loaded with them; cannot seem to find a good link right now.

I used to add stuff referring to why it should never be needed. I like naming variables obnoxiously as well, like IdiotEntryCnt, etc


Link to silicon art mentioned [url]http://micro.magnet.fsu.edu/creatures/index.html[url]
--
All the flaming and trolls of wreck dot with a pretty GUI.

Share this post


Link to post
Share on other sites
Quote



I usually commented if it was particularly different. The average stuff should be obvious. Now funny comments are a different story. The linux kernel is loaded with them; cannot seem to find a good link right now.



I agree with you there....

I find that usually I can write the code in a very simplistic manner that anyone should be able to follow it easily, but there are occasions when there is a block of code that gets pretty hairy. Then I will add a comment above describing what's going on.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

0