Bolas 5 #1 October 6, 2004 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: QuotePing %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 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. Quote Share this post Link to post Share on other sites
davedlg 0 #2 October 6, 2004 I used to program a lot and yeah, I'd do that kind of stuff all the time. I think you have to do it to stay sane when you are looking at code for hours at a time. Quote Share this post Link to post Share on other sites
Clownburner 0 #3 October 6, 2004 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 Quote Share this post Link to post Share on other sites
unformed 0 #4 October 6, 2004 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. Quote Share this post Link to post Share on other sites
champu 1 #5 October 6, 2004 I do stuff like this all the time... Quote switch($some_user_input) { ... default : //while fascinating, user's input is useless ... } Quote Share this post Link to post Share on other sites
Meathorse 0 #6 October 6, 2004 Hmmmm got a couple odd things here... public JUnitCustomerBroker(String freak) { super(freak); //she's super freaky } ---------- String executableSQLStringWithAnUnreasonablyLongNameAndStuff; Quote Share this post Link to post Share on other sites
JohnRich 4 #7 October 6, 2004 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. Quote Share this post Link to post Share on other sites
teamhypoxia 0 #8 October 6, 2004 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. Quote Share this post Link to post Share on other sites
weegegirl 2 #9 October 6, 2004 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. My coworkers loved it. Quote Share this post Link to post Share on other sites
tfelber 0 #10 October 6, 2004 F@#$ comments... Quote Share this post Link to post Share on other sites
tweak 0 #11 October 6, 2004 Second that one!!! Comments are too close to being documentation for me.... I usually have to have the coding done yesterday, so I don't have time to comment (well that's my story anyway). Quote Share this post Link to post Share on other sites
mailin 0 #12 October 6, 2004 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. JenArianna Frances Quote Share this post Link to post Share on other sites
tweak 0 #13 October 6, 2004 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 Quote Share this post Link to post Share on other sites
tfelber 0 #14 October 6, 2004 Quote Then you will find many programmers will have difficulty working on your programs after you It's job security baby...just kidding We're ISO9001 "So it's written, so we do" Quote Share this post Link to post Share on other sites
flyingferret 0 #15 October 7, 2004 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. Quote Share this post Link to post Share on other sites
tweak 0 #16 October 7, 2004 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. Quote Share this post Link to post Share on other sites
flyingferret 0 #17 October 7, 2004 forgot link http://micro.magnet.fsu.edu/creatures/ /puts tard helmet back on-- All the flaming and trolls of wreck dot with a pretty GUI. Quote Share this post Link to post Share on other sites
yoink 321 #18 October 7, 2004 hidden flash buttons are cool... I blatently stole that idea from Strongbad... Quote Share this post Link to post Share on other sites
MikeMcLean 0 #19 October 8, 2004 My favorite is # including the work fuck here because someone is going to grep for it eventuallyIt wouldn't hurt you to think like a fucking serial killer every once in a while - just for the sake of prevention Quote Share this post Link to post Share on other sites