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
Zombywuf
Mar 29, 2008

Doctor w-rw-rw- posted:

Men also tend to forgive social dysfunction when results are produced more easily than many women*. So while "Ever wanted to make sed or grep worse? <link>" might be arguable, he was an rear end in a top hat about it. It's likely that he doesn't discriminate against women, but the practice of being an rear end in a top hat about it certainly favors the kind of people more willing to be confrontational about things.

Great, and while we're offering a hugbox to people writing terrible things the ops team is slowly drinking themselves to death because people offered support to terrible software by deploying it.

p.s. the rest of the stuff she writes looks p. awesome BTW. Machine learning and web design, together at last! (no really)

Adbot
ADBOT LOVES YOU

ToxicFrog
Apr 26, 2008


^^ You can refuse to support bad code and point out exactly why it's bad without being an rear end in a top hat about it.

Granted, this thread is often entirely about being an rear end in a top hat about it, but we also aren't sending copies of this thread to the original developer in lieu of bug reports.

..btt posted:

Me neither to be honest. I checked on one guy's justification and it was basically "sed already does this". But as she states, the syntax is not the best, and it doesn't list the changes it makes (I assume this is true, I don't know sed well); also, it's a pain to set up on some platforms (e.g. Windows).

You can make it print the changes it makes, but if you're just using s/find/replace/ it won't; you need to actually learn some sed command language to get that behaviour.

"Like sed s///, but with a simpler UI and using JS regexes" is not in and of itself a bad idea; the horrors here are (a) the fact that it overwrites the files in-place, so if something goes wrong you could easily lose most of a file, and (b) that the community reaction to (a) was to poo poo all over the programmer rather than point out the actual problem or maybe submit a patch.

Zombywuf
Mar 29, 2008

ToxicFrog posted:

(b) that the community reaction to (a) was to poo poo all over the programmer rather than point out the actual problem or maybe submit a patch.

Seriously, what is this "the community"? Some bunch of folks we're supposed to know?

EDIT:

quote:

^^ You can refuse to support bad code and point out exactly why it's bad without being an rear end in a top hat about it.

Oh to have that luxury.

Zombywuf fucked around with this message at 17:51 on Jan 25, 2013

Doctor w-rw-rw-
Jun 24, 2008

Zombywuf posted:

Seriously, what is this "the community"? Some bunch of folks we're supposed to know?

Javascript community I'd wager. She develops for Mozilla.

Zombywuf posted:

Oh to have that luxury.
Not being an rear end in a top hat isn't a luxury, except for assholes. I think you misread "refuse to support" as "be unwilling to work on bad code" vs "not be in support of using code which is bad" because sometimes refusing to support bad code simply isn't possible. But being an rear end in a top hat about it still isn't necessary.

vvvvv

Volte posted:

People who write and release bad software should be publicly made to feel bad. I don't see what's so hard to understand about this.
If serious, then this is the why you are a part of the problem. People who write and release bad software should learn to write and release better software. Public shaming isn't an end, it's a means, and definitely not the best one.

Doctor w-rw-rw- fucked around with this message at 18:03 on Jan 25, 2013

Volte
Oct 4, 2004

woosh woosh
People who write and release bad software should be publicly made to feel bad. I don't see what's so hard to understand about this.

Blotto Skorzany
Nov 7, 2008

He's a PSoC, loose and runnin'
came the whisper from each lip
And he's here to do some business with
the bad ADC on his chip
bad ADC on his chiiiiip

Doctor w-rw-rw- posted:

Side note: is there a way to mark forum members privately? I'd like to make a note of certain people who seem to offset legitimately impressive technical knowledge with a really awful personality.

bool is_avenging_dentist;

ChickenOfTomorrow
Nov 11, 2012

god damn it, you've got to be kind

^^

There's probably a GM script for that (there's one for MeFi). If there isn't, make one.

Thermopyle
Jul 1, 2003

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

Volte posted:

People who write and release bad software should be publicly made to feel bad.

Why?

Doctor w-rw-rw- posted:

Side note: is there a way to mark forum members privately? I'd like to make a note of certain people who seem to offset legitimately impressive technical knowledge with a really awful personality.

I think the SALR (written by forum user Ferg) userscript does that.

Strong Sauce
Jul 2, 2003

You know I am not really your father.





Volte posted:

People who write and release bad software should be publicly made to feel bad. I don't see what's so hard to understand about this.

But is it bad code? (people start searching for stuff to nitpick)

It's not like she was promoting the tool or saying it should replace unix tools. Just a bunch of unixbeards who hate JavaScript having to feel superior.

Not saying people dont deserve ridicule sometimes but if you're going to call people out have a better argument than "its not sed"

Strong Sauce
Jul 2, 2003

You know I am not really your father.





ChickenOfTomorrow posted:

^^

There's probably a GM script for that (there's one for MeFi). If there isn't, make one.

Just so people can poo poo all over it man? No thanks.

Blotto Skorzany
Nov 7, 2008

He's a PSoC, loose and runnin'
came the whisper from each lip
And he's here to do some business with
the bad ADC on his chip
bad ADC on his chiiiiip

Strong Sauce posted:

It's not like she was promoting the tool or saying it should replace unix tools. Just a bunch of unixbeards who hate JavaScript having to feel superior.

Rails 'stars' are not unixbeards

Zombywuf
Mar 29, 2008

Strong Sauce posted:

But is it bad code? (people start searching for stuff to nitpick)

Yes, I already pointed out one piece of bad.


When a tool that presents itself as a useful command to search and replace in files can simply poo poo all over your filesystem, the author should feel as bad as the person who is now hoping their backups work.

Zamujasa
Oct 27, 2010



Bread Liar

Volte posted:

People who write and release bad software should be publicly made to feel bad. I don't see what's so hard to understand about this.

:jerkbag:



No code available this time, but a horror I recently fixed involved part of an awfully-written file that inserted a new row while toggling the value of certain similar rows. Basically, all but one row for a given `foreign_id` should be marked as deleted. `internal_index` is some internal poo poo that isn't a key anywhere else, and tends to be repeated a lot. (It has a purpose, but not in this pseudocode).

Pretend this is buried with no newlines in a huge mess of code. Fill the newlines with a bunch of extra garbage for effect:
code:
query("UPDATE `table` SET `row_deleted` = NOW() WHERE `name` LIKE '%$fragment_of_new_name_to_insert%'");

// TODO: now that we're inserting fid, use it instead of text search

query("INSERT INTO `table` SET `name` = '$new_name', `internal_index` = '$iidx', `foreign_id` = '$fid'");
This was the old version (I had to look it up to see how it worked there, since the "fix" was broken). Then the manager got his hands on it:

code:
query("UPDATE `table` SET `row_deleted` = NOW() WHERE `name` LIKE '%$fragment_of_new_name_to_insert%'");

// TODO: now that we're inserting fid, use it instead of text search

query("UPDATE `table` SET `row_deleted` = NOW() WHERE `internal_index` = '$iidx'");

query("INSERT INTO `table` SET `name` = '$new_name', `internal_index` = '$iidx', `foreign_id` = '$fid'");
So this didn't solve the problem and actually made a lot of things worse, since it was now corrupting random entries that just happened to share the same internal (non-unique!) index.

The correct solution was, of course:
code:
query("UPDATE `table` SET `row_deleted` = NOW() WHERE `foreign_id` = '$fid");

query("INSERT INTO `table` SET `name` = '$new_name', `internal_index` = '$iidx', `foreign_id` = '$fid'");
It turns out that the comments, which are almost always wrong or utterly useless, where actually correct this time. Probably the only time one of the original comments in this piece of poo poo has been useful.

Why it was never fixed in the original system is beyond me, though. Clearly it was written after it was possible to do... but then again this is the same person who stores important file metadata in the filenames. :sigh:

Bunny Cuddlin
Dec 12, 2004
lmao you people, I cannot believe that you're posting this kind of poo poo IN THIS THREAD. How is what they said on twitter any different than the hundred worse things that have been posted in this thread? Is it somehow better because there's less chance of the original author finding them here? It's certainly possible, this is a public forum. How is this thread any different from what those people posted on twitter? Is this a designated Mean Area of the internet?

Strong Sauce
Jul 2, 2003

You know I am not really your father.





Zombywuf posted:

Yes, I already pointed out one piece of bad.


When a tool that presents itself as a useful command to search and replace in files can simply poo poo all over your filesystem, the author should feel as bad as the person who is now hoping their backups work.

I am not sure what is wrong with the code?

Zombywuf
Mar 29, 2008

Bunny Cuddlin posted:

lmao you people, I cannot believe that you're posting this kind of poo poo IN THIS THREAD. How is what they said on twitter any different than the hundred worse things that have been posted in this thread? Is it somehow better because there's less chance of the original author finding them here? It's certainly possible, this is a public forum. How is this thread any different from what those people posted on twitter? Is this a designated Mean Area of the internet?

Twitter is a *safe space* apparently.

Strong Sauce posted:

I am not sure what is wrong with the code?

Python code:
fh = open(fh, "rb")
text = fh.read()
fh.close()

mangle(text)

fh = open(fh, "wb")
fh.write(text)
fh.close()
Do you know what is wrong with this code? Do you know what happens when C-c is pressed while fh.write(text) is happening?

Can you guess what happens when the code is running in async mode and runs out of filehandles?

shrughes
Oct 11, 2008

(call/cc call/cc)
Apparently one of the people (Corey Haines) was fired twice for behaving this way to coworkers. Source: http://news.ycombinator.com/item?id=5107945

Also, gently caress anybody that has a deliberately designed social media presence, with their blog with some theme title and their photo next to it smiling with just the right angle to show what a dynamic personality they have.

Doctor w-rw-rw- posted:

Side note: is there a way to mark forum members privately? I'd like to make a note of certain people who seem to offset legitimately impressive technical knowledge with a really awful personality.

In the cases you're thinking of, it's awful horror-littered technical knowledge multiplied by a really awful personality.

shrughes fucked around with this message at 19:13 on Jan 25, 2013

McGlockenshire
Dec 16, 2005

GOLLOCKS!

Bunny Cuddlin posted:

lmao you people, I cannot believe that you're posting this kind of poo poo IN THIS THREAD. How is what they said on twitter any different than the hundred worse things that have been posted in this thread? Is it somehow better because there's less chance of the original author finding them here? It's certainly possible, this is a public forum. How is this thread any different from what those people posted on twitter? Is this a designated Mean Area of the internet?

Most of the examples in this thread don't attribute bad code to specific people.

Calling an entire project crap because it's written in a joke of a language for the purpose and needlessly reimplements a tool is stupid. In this case, it's doubly stupid because the criticism was directly about the quality of the code when the people doing the criticizing never actually looked at the code. One even published a complete retraction after reviewing the code and not finding it anywhere near as horrible as was originally expected.

It's still broken code because of the lack of atomic locking/renaming/etc... and criticizing that is totally valid because it can be constructive.

shrughes
Oct 11, 2008

(call/cc call/cc)
Bullshit, it's not constructive. It's just somebody's little utility script. And they put it on github. You don't have to worry about that poo poo in utility scripts. The computer's not going to suddenly crash on you.

Bunny Cuddlin
Dec 12, 2004

McGlockenshire posted:

Most of the examples in this thread don't attribute bad code to specific people.

Calling an entire project crap because it's written in a joke of a language for the purpose and needlessly reimplements a tool is stupid. In this case, it's doubly stupid because the criticism was directly about the quality of the code when the people doing the criticizing never actually looked at the code. One even published a complete retraction after reviewing the code and not finding it anywhere near as horrible as was originally expected.

It's still broken code because of the lack of atomic locking/renaming/etc... and criticizing that is totally valid because it can be constructive.

I'm not sure how not attributing the code to specific people makes it any better if this is about the tone and timber of discourse in software development. Won't it still be "counterproductive" if they stumble across it here and get discouraged or whatever?

Anyway, I don't really care about the criticism or whether it was justified or not, I was making fun of the response (which was a blog post whining about the damage done to someone's brand by mean words on the internet and fishing for apologies in public).

Zombywuf
Mar 29, 2008

McGlockenshire posted:

Calling an entire project crap because it's written in a joke of a language for the purpose and needlessly reimplements a tool is stupid.

Can I call it crap because of
code:
find dir | (while read F; do mkdir -p "$(dirname "new/$F")"; sed -e 's/foo/bar/g' "$F" > "new/$F"; done)
Is that allowed?

Zamujasa
Oct 27, 2010



Bread Liar

shrughes posted:

Bullshit, it's not constructive. It's just somebody's little utility script. And they put it on github. You don't have to worry about that poo poo in utility scripts. The computer's not going to suddenly crash on you.

It can be constructive in that it will at least make that person aware of that pitfall in the future. It's in a small script now, sure, but it's entirely possible that similar code may be used by that person later in a bigger project, where it can cause a serious problem. :shobon:

1337JiveTurkey
Feb 17, 2005

Bunny Cuddlin posted:

lmao you people, I cannot believe that you're posting this kind of poo poo IN THIS THREAD. How is what they said on twitter any different than the hundred worse things that have been posted in this thread? Is it somehow better because there's less chance of the original author finding them here? It's certainly possible, this is a public forum. How is this thread any different from what those people posted on twitter? Is this a designated Mean Area of the internet?

This thread keeps things anonymous for the most part. I think that makes it significantly different from posting something that identifies the author in a public manner. Even if she does improve her coding style the comments will still be there which is unfair to her if potential employers google her in the future.

JawnV6
Jul 4, 2004

So hot ...

1337JiveTurkey posted:

This thread keeps things anonymous for the most part. I think that makes it significantly different from posting something that identifies the author in a public manner. Even if she does improve her coding style the comments will still be there which is unfair to her if potential employers google her in the future.

The response blog seems much more brand-damaging than the square peg haters.

1337JiveTurkey
Feb 17, 2005

JawnV6 posted:

The response blog seems much more brand-damaging than the square peg haters.

She can at least delete that herself.

Volte
Oct 4, 2004

woosh woosh

shrughes posted:

Bullshit, it's not constructive. It's just somebody's little utility script. And they put it on github. You don't have to worry about that poo poo in utility scripts. The computer's not going to suddenly crash on you.
Bad code on the internet is harmful. Stop its proliferation by any means necessary.

Cocoa Crispies
Jul 20, 2001

Vehicular Manslaughter!

Pillbug

Volte posted:

Bad code on the internet is harmful. Stop its proliferation by any means necessary.

I'm going to hand you a complete copy of all the code you've ever written and a revolver with a single bullet. We'll let you be responsible for any future bad code you proliferate.

fritz
Jul 26, 2003

Otto Skorzeny posted:

Rails 'stars' are not unixbeards

Isn't the rails community full of assholes from top to bottom? I mean, even more than usual for this industry?

b0lt
Apr 29, 2005

fritz posted:

Isn't the rails community full of assholes from top to bottom? I mean, even more than usual for this industry?

rails is ~omakase~

Volte
Oct 4, 2004

woosh woosh

Cocoa Crispies posted:

I'm going to hand you a complete copy of all the code you've ever written and a revolver with a single bullet. We'll let you be responsible for any future bad code you proliferate.
I haven't put any of the code I've ever written on the internet.

New Yorp New Yorp
Jul 18, 2003

Only in Kenya.
Pillbug

fritz posted:

Isn't the rails community full of assholes from top to bottom? I mean, even more than usual for this industry?

In my experience, the Ruby world has a very high concentration of pretentious pricks.

[edit] My experience comes from attending conferences and going to talks on Ruby, since it's on my backlog of "languages to actually learn well"

No Safe Word
Feb 26, 2005

Apparently that replace thing has made the rounds a few times over by now: http://www.hanselman.com/blog/YouAreNotYourCode.aspx

Cocoa Crispies
Jul 20, 2001

Vehicular Manslaughter!

Pillbug

Volte posted:

I haven't put any of the code I've ever written on the internet.

It's fun to write code, putting it online is easy, and if it bothers you that some people are putting code up that you won't like, that's your problem.

Dirty Frank
Jul 8, 2004

Volte posted:

I haven't put any of the code I've ever written on the internet.

What do you do with your code, delete it as soon as written?

Janitor Prime
Jan 22, 2004

PC LOAD LETTER

What da fuck does that mean

Fun Shoe

Zombywuf posted:

Twitter is a *safe space* apparently.


Python code:
fh = open(fh, "rb")
text = fh.read()
fh.close()

mangle(text)

fh = open(fh, "wb")
fh.write(text)
fh.close()
Do you know what is wrong with this code? Do you know what happens when C-c is pressed while fh.write(text) is happening?

Can you guess what happens when the code is running in async mode and runs out of filehandles?
1. The file is left in a corrupted state and the since the file isn't closed it leaks file handles.

2. It can't open any more files and shits itself?

Janitor Prime
Jan 22, 2004

PC LOAD LETTER

What da fuck does that mean

Fun Shoe

Dirty Frank posted:

What do you do with your code, delete it as soon as written?

I'm sure he means publish the source code somewhere public

Dirty Frank
Jul 8, 2004

Hard NOP Life posted:

I'm sure he means publish the source code somewhere public

And my point is that someone uses his code, and so he's either a hypocrite or a wanker. Better to be a wanker really...

ymgve
Jan 2, 2004


:dukedog:
Offensive Clock

Hard NOP Life posted:

1. The file is left in a corrupted state and the since the file isn't closed it leaks file handles.

Unless you are on some especially braindead operating system, the OS should take care of any unclosed file handles and other resources the program used.

(Note that "take care of" is said here in the Mafia sense. Whatever file that handle pointed to is possibly toast.)

Thermopyle
Jul 1, 2003

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

Zombywuf posted:

When a tool that presents itself as a useful command to search and replace in files can simply poo poo all over your filesystem, the author should feel as bad as the person who is now hoping their backups work.

Why is ridiculing with no context an effective way of making this happen? (Assuming the intention is to limit the amount of such code out there rather than just inflating your own ego)

Adbot
ADBOT LOVES YOU

Bunny Cuddlin
Dec 12, 2004

No Safe Word posted:

Apparently that replace thing has made the rounds a few times over by now: http://www.hanselman.com/blog/YouAreNotYourCode.aspx

that was posted yesterday

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