Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Post
  • Reply
No Safe Word
Feb 26, 2005

Thermopyle posted:

Am I the only one who had to look this up?

No, I assumed it was just the name of the restaurant that I lived across the street from which also comprises like the first page of Google results. Now it makes a little more sense :eng101:

Adbot
ADBOT LOVES YOU

seiken
Feb 7, 2005

hah ha ha

Thermopyle posted:

Am I the only one who had to look this up?

You're not, it's also my new favourite word. Thanks Scaramouche!

dc3k
Feb 18, 2003

what.

geonetix posted:

Just ran into something that's always pretty sad (it's coldfusion, but the comments make it worse):

code:
// If the thread is still running.
if (redactedThread.status == 'RUNNING') {
	// Trace a message.
	trace(text="Waiting for redacted");
}
Every single line of code in this file has a comment. It wasn't there some revisions ago. Somebody actually spent time adding it.

x++; //increment the x variable

Coffee Mugshot
Jun 26, 2010

by Lowtax

Scaramouche posted:

I'm not going to post code because it would just be a nested series of statements, but I've inherited a farrago of snakes

Modz pls rename me farrago of snakes

Amarkov
Jun 21, 2010
So there was a piece of debugging information that was printed to System.out for some reason. Whatever, it's a graphical program, it should be fairly easy to find something in the terminal output.

code:
Param type: String
Param type: String
Param type: String
Param type: String
Param type: String
Param type: String
Param type: String
Param type: String
Param type: List<String>
Param type: String
Param type: String
Param type: String
Param type: List<String>
Param type: List<String>
Param type: List<String>
Param type: String
Param type: Class<Object>
Param type: String
Param type: String
Param type: String

[etc.]

geonetix
Mar 6, 2011


status posted:

x++; //increment the x variable

I like it even better when it's overcommented and wrong. Example from same file:

code:
// Join the Redacted thread with the current one with a maximum timeout of 5 seconds.
threadjoin("thread1,thread2", 7000);
I deleted the comment when I saw it, but it came back after a feature-branch merge. :sigh:

senrath
Nov 4, 2009

Look Professor, a destruct switch!


status posted:

x++; //increment the x variable

I had a professor in an intro to CS course dock me points for not doing that. :downs:

TheresaJayne
Jul 1, 2011

geonetix posted:

Just ran into something that's always pretty sad (it's coldfusion, but the comments make it worse):

code:
// If the thread is still running.
if (redactedThread.status == 'RUNNING') {
	// Trace a message.
	trace(text="Waiting for redacted");
}
Every single line of code in this file has a comment. It wasn't there some revisions ago. Somebody actually spent time adding it.

Actually some programmers have a habit of writing the logic as a series of comments then adding the code, but usually once complete the comments are removed. ie.
code:
//Get the input string
//check if it starts with an expletive
//check if it ends with an expletive
//check if there is an expletive in the string
//if there is no expletive, 
//reject post on 4chan
//and allow post on SomethingAwful
//else
//allow post on 4chan
//and reject post on SomethingAwful
that would then be replaced by code doing said logic.

note: sorry about the expletive stuff, but just been implementing expletive check on the work site...

Goat Bastard
Oct 20, 2004

TheresaJayne posted:

note: sorry about the expletive stuff, but just been implementing expletive check on the work site...

I'm sure you didn't make the requirement, but this is as close as I've ever gotten to talking to someone who has: What is the possible business justification for this? If someone is goofing off on the internet instead of doing their job then blocking sites based on swear words isn't going to help that, it's a management issue not an IT issue.

On the other hand if (for example) a user is trying to read a relevant forum thread with a swear word in it, or a user is trying to download a library with an author who's name looks a bit like an English swear word, or a user is trying to download an actual English language dictionary then all that the swear word filter has accomplished is to prevent them from doing the job that they are paid for.

Seriously, swear filters are the stupidest things.

geonetix
Mar 6, 2011


TheresaJayne posted:

Actually some programmers have a habit of writing the logic as a series of comments then adding the code, but usually once complete the comments are removed. ie.

that would then be replaced by code doing said logic.

note: sorry about the expletive stuff, but just been implementing expletive check on the work site...

Yep, but he added the comments some commits after the code was written.

TheresaJayne
Jul 1, 2011

Goat Bastard posted:

I'm sure you didn't make the requirement, but this is as close as I've ever gotten to talking to someone who has: What is the possible business justification for this? If someone is goofing off on the internet instead of doing their job then blocking sites based on swear words isn't going to help that, it's a management issue not an IT issue.

On the other hand if (for example) a user is trying to read a relevant forum thread with a swear word in it, or a user is trying to download a library with an author who's name looks a bit like an English swear word, or a user is trying to download an actual English language dictionary then all that the swear word filter has accomplished is to prevent them from doing the job that they are paid for.

Seriously, swear filters are the stupidest things.

These are to prevent people putting unpleasant words on the site we have written,
Someone entered a job description (without the 1337 5p33k and non alphabetic characters)as:

"A Fu*&ing Cr4p job where you sit around and do Sh17 all day except getting p1553d and high on wacky backy"

Goat Bastard
Oct 20, 2004

This job is bad I got high all the time and did no work

Saved the day!

e: I am bitter because every example I gave is something I have had to work around within the last month

second edit: your own post demonstrates the pointlessness of naive swear word filters

Goat Bastard fucked around with this message at 13:03 on Jul 25, 2013

Volmarias
Dec 31, 2002

EMAIL... THE INTERNET... SEARCH ENGINES...

TheresaJayne posted:

These are to prevent people putting unpleasant words on the site we have written,
Someone entered a job description (without the 1337 5p33k and non alphabetic characters)as:

"A Fu*&ing Cr4p job where you sit around and do Sh17 all day except getting p1553d and high on wacky backy"

And after being admonished for naughty language, they'll just change characters around enough to break the filter.

Marta Velasquez
Mar 9, 2013

Good thing I was feeling suicidal this morning...
Fallen Rib

Goat Bastard posted:

I'm sure you didn't make the requirement, but this is as close as I've ever gotten to talking to someone who has: What is the possible business justification for this? If someone is goofing off on the internet instead of doing their job then blocking sites based on swear words isn't going to help that, it's a management issue not an IT issue.

On the other hand if (for example) a user is trying to read a relevant forum thread with a swear word in it, or a user is trying to download a library with an author who's name looks a bit like an English swear word, or a user is trying to download an actual English language dictionary then all that the swear word filter has accomplished is to prevent them from doing the job that they are paid for.

Seriously, swear filters are the stupidest things.

Years ago in middle school, NetNanny was installed on all the computers at school. When we had to type reports up, we had to write a heading that included our name, subject, date, and title of the assignment.

When the title of a science paper was "Demonstrating [something]", every single computer locked because we had all just typed the word "demon." The next day, literally every computer in the district had a Post-It note attached to the monitor with the NetNanny password on it, put there by the faculty.

edit:
I don't know if it was a default password, but I still remember that the password was "~frontdoor"

kitten smoothie
Dec 29, 2001

contrapants posted:

Years ago in middle school, NetNanny was installed on all the computers at school. When we had to type reports up, we had to write a heading that included our name, subject, date, and title of the assignment.

When the title of a science paper was "Demonstrating [something]", every single computer locked because we had all just typed the word "demon." The next day, literally every computer in the district had a Post-It note attached to the monitor with the NetNanny password on it, put there by the faculty.

edit:
I don't know if it was a default password, but I still remember that the password was "~frontdoor"

Could've been worse, you could've had to write a paper on JFK and have to say he was "buttbuttinated" or else the filter would keep triggering on "rear end."

http://en.wikipedia.org/wiki/Scunthorpe_problem

BigRedDot
Mar 6, 2008

status posted:

x++; //increment the x variable

To be fair, someone might have overloaded operator++() to decrement the variable; you gotta be clear about these things.

Jabor
Jul 16, 2010

#1 Loser at SpaceChem

BigRedDot posted:

To be fair, someone might have overloaded operator++() to decrement the variable; you gotta be clear about these things.

That's just silly, your comment is going to be all out of date once someone does change ++ to decrement the variable. And we all know outdated comments are worse than no comments at all.

code:
x++; //invoke the ++ operator on x
Much better.

Munkeymon
Aug 14, 2003

Motherfucker's got an
armor-piercing crowbar! Rigoddamndicu𝜆ous.



Goat Bastard posted:

Seriously, swear filters are the stupidest things.

Age checks. Especially on liquor or beer company websites because children might find out alcohol exists from the internet instead of TV! or some other bullshitty Lovejoy-esque reason.

Jewel
May 2, 2009

Jabor posted:

That's just silly, your comment is going to be all out of date once someone does change ++ to decrement the variable. And we all know outdated comments are worse than no comments at all.

code:
x++; //invoke the ++ operator on x
Much better.

Ah but that comment is vague you have to specify which operator you're calling!

code:
x++; //invoke the postfix ++ operator on x

That Turkey Story
Mar 30, 2003

Jewel posted:

Ah but that comment is vague you have to specify which operator you're calling!

code:
x++; //invoke the postfix ++ operator on x

That's almost as bad as coding in Cobol.

Lumpy
Apr 26, 2002

La! La! La! Laaaa!



College Slice

Jewel posted:

Ah but that comment is vague you have to specify which operator you're calling!

code:
x++; //invoke the postfix ++ operator on x

What if that operator is removed at some point from the language?

code:
x++; // the 'x' character, followed by two(2) instances of the '+' character with a ';' character at the end

Sereri
Sep 30, 2008

awwwrigami

You guys are making this far too confusing
code:
x = x + 1 ; //increment x by one
There, much better

Jewel posted:

postfix
Suffix, you terrible, terrible person


vvvvvv well they're wrong :colbert:

Sereri fucked around with this message at 16:31 on Jul 25, 2013

Posting Principle
Dec 10, 2011

by Ralp
Die

Sereri posted:

Suffix, you terrible, terrible person

C++ Standard 5.2.1 "postfix-expression ++"

Java Language Spec 15.14.2 Postfix Increment Operator ++

fritz
Jul 26, 2003

What if we might want to increment x by something else later, you guys have hard-coded in that value.

Volmarias
Dec 31, 2002

EMAIL... THE INTERNET... SEARCH ENGINES...
The code that contractors are writing for me as part of the phone screen process of their interview.

This is the code that makes me cry.

Reality
Sep 26, 2010
I inherited a rather voluminous JavaScript code base. There were tons of functions called "set_up_[thing]". I kept spelling setup correctly and I was always wrong.

seiken
Feb 7, 2005

hah ha ha

Reality posted:

I inherited a rather voluminous JavaScript code base. There were tons of functions called "set_up_[thing]". I kept spelling setup correctly and I was always wrong.

I have a Python codebase where almost every class has a method like that except it's called either "SetUpX" or "SetupX" completely at random.

QuarkJets
Sep 8, 2008

seiken posted:

I have a Python codebase where almost every class has a method like that except it's called either "SetUpX" or "SetupX" completely at random.

It's even worse when you have something like this in MATLAB, where each function belongs to one file of the same name, and fixing all of the lovely discrepancies becomes a huge pain (on a Windows system with no scripting languages installed -- just having something like Python or even cygwin would have made it okay, but nooooooooo).

Posting Principle
Dec 10, 2011

by Ralp

seiken posted:

I have a Python codebase where almost every class has a method like that except it's called either "SetUpX" or "SetupX" completely at random.

They're just following the "name it whatever you feel like today" convention set by Python's standard library.

Freakus
Oct 21, 2000
I see swear filters more as a cover-your-rear end thing: it looks like you're putting forth the effort so offended parties are more forgiving.

Scaramouche
Mar 26, 2001

SPACE FACE! SPACE FACE!

Thermopyle posted:

Am I the only one who had to look this up?

Man I can't believe you guys aren't down with your latin selves. I thought every programmer was classically educated.

JawnV6
Jul 4, 2004

So hot ...
nah just Class educated

Strong Sauce
Jul 2, 2003

You know I am not really your father.





Munkeymon posted:

Age checks. Especially on liquor or beer company websites because children might find out alcohol exists from the internet instead of TV! or some other bullshitty Lovejoy-esque reason.

They're required to put them in by law I believe. So not really their fault.

Lumpy
Apr 26, 2002

La! La! La! Laaaa!



College Slice

Strong Sauce posted:

They're required to put them in by law I believe. So not really their fault.

As someone who does a lot of work for the booze industry, yes. They have to be there because The Man says so.

The Man says so for those awful reasons pointed out earlier, but the companies themselves would love to get rid of those stupid things.

xarph
Jun 18, 2001


senrath posted:

I had a professor in an intro to CS course dock me points for not doing that. :downs:

I had a professor dock me for adding --help and a manpage to my assignment because it wasn't in the spec.

He was fired from Oracle before becoming a computer teacher so

Volte
Oct 4, 2004

woosh woosh
I had a TA dock me because the comments in my printed-out code (the only way that we submitted assignments in that class) were not green

Bunny Cuddlin
Dec 12, 2004

xarph posted:

I had a professor dock me for adding --help and a manpage to my assignment because it wasn't in the spec.

lol nerd

Thermopyle
Jul 1, 2003

...the stupid are cocksure while the intelligent are full of doubt. —Bertrand Russell

Volte posted:

I had a TA dock me because the comments in my printed-out code (the only way that we submitted assignments in that class) were not green

What kind of heathen doesn't have green comments?

senrath
Nov 4, 2009

Look Professor, a destruct switch!


Thermopyle posted:

What kind of heathen doesn't have green comments?

The kind who printed out in black and white rather than color, I assume.

Adbot
ADBOT LOVES YOU

Volte
Oct 4, 2004

woosh woosh
Here is a picture of that assignment I found. It was so ridiculous I just had to take a photo (sorry it was from before I owned a phone with a decent camera). The assignment was to take an integer and print the word representation of it, which I did by recursively breaking the number up into three digit groups. The correct way was a massive case statement. When I confronted him about it he babbled something about not understanding my code and that he couldn't read the comments because they weren't green and so he couldn't tell where the comments stopped and the code began. I failed this assignment, other people got 100% even if their code didn't compile or make sense.

  • 1
  • 2
  • 3
  • 4
  • 5
  • Post
  • Reply