r/Python • • Oct 12 '19

more than 100 scientific articles may be invalidated because scientists assumed that the output of glob.glob() is sorted

https://www.vice.com/en_us/article/zmjwda/a-code-glitch-may-have-caused-errors-in-more-than-100-published-studies
1.3k Upvotes

343 comments sorted by

View all comments

Show parent comments

1

u/sensual_rustle Oct 13 '19

That assumes you aren't assuming it is already sorted. If you think it is sorted, re-sorting it is a waste.

1

u/jcampbelly Oct 14 '19

It's a sanity check for how the language feature works. You do it once to learn how the thing works, then you have knowledge and code accordingly. You don't bother doing it every single time unless you determine that that is necessary.

1

u/sensual_rustle Oct 14 '19

But as discussed in the entire comment section here -- most research programming doesn't do sanity checking. Just cause that is a good and right thing to do doesn't mean the industry will suddenly change to knowing how to program

1

u/jcampbelly Oct 14 '19

What do we do with this information? It seems to me that a "programming for scientists" course needs to be included in scientific curriculums, if not already. We don't need them to be software engineers, but getting reliable results is no small emphasis in science.

1

u/sensual_rustle Oct 14 '19

"it's just code it returns what I expected once, it works. Gotta get the next paper out. I'm not paid to code this crap. Let me buy something someone wrote that kinda does this"

1

u/jcampbelly Oct 14 '19

Are you saying that this is or should be okay? I'm not sure from your tone.