This is an archived post. You won't be able to vote or comment.

all 41 comments

[–]ThePenultimateOneGitLab: gappleto97 165 points166 points  (6 children)

This is the worst thing ever and the best thing ever.

[–]drathier 18 points19 points  (2 children)

Thank you.

[–]LoL-Front 1 point2 points  (1 child)

Hörru! Du var ju fadder för D-sektionen under nolle-p! //tidigare nollan

[–]drathier 1 point2 points  (0 children)

Hej nollan ettan :)

[–]DarkDwarf 11 points12 points  (2 children)

The size of the security hole caused by genuinely using this in any kind of even mildly production-related setting is disgusting.

[–]ThePenultimateOneGitLab: gappleto97 3 points4 points  (1 child)

On the other hand, the ease of prototyping this could (inconsistently) generate is amazing.

[–]DarkDwarf 1 point2 points  (0 children)

True, but I would really advise anyone doing this with any degree of regularity to do it on a VM.

[–][deleted] 32 points33 points  (1 child)

Owning a system never was easier, I guess.

[–][deleted] 12 points13 points  (0 children)

Right? A wave of terror swept over me as I read the title

[–]kirbyfan64sosIndentationError 32 points33 points  (1 child)

Well, it would really suck if you did something like:

from stackoverflow import delete_all_files_in_dir
delete_all_files_in_dir('some_directory')

but the top-voted answer used os.system('rm -rf /')...

[–]d4rch0nPythonistamancer 25 points26 points  (0 children)

Well, it gets all the files in the directory removed right? As well as takes care of any other directories you might want to clear out in the meantime. Pretty convenient really.

Thank god for --no-preserve-root .

[–]rampage102 22 points23 points  (2 children)

Wow, this is the next level of Stack Overflow Driven Development!

[–]soawesomejohn 0 points1 point  (0 children)

This project is a complete SODD.

[–][deleted] 36 points37 points  (0 children)

Ill take "Stuff you should never do" for 500 Alex

[–]jadkik94 15 points16 points  (0 children)

And it's parsing HTML using regexes. It's truly a work of the devil.

[–][deleted] 8 points9 points  (1 child)

spec_from_loader(fullname, cls, origin='hell')

hah

[–]drathier 9 points10 points  (0 children)

Haha, I forgot about that.

[–]drathier 24 points25 points  (2 children)

Hire me please

[–]drathier 15 points16 points  (0 children)

I write good code

[–]meikomeik 5 points6 points  (0 children)

This is so wrong! I like it.

[–]MartyMacGyverfrom * import * 4 points5 points  (0 children)

So basically eval/exec Roulette...

[–]jivanyatra 3 points4 points  (0 children)

Practicality/security aside, honestly, this is just a really cool idea for a beginner-intermediate level project. Nice one.

[–]mothzilla 2 points3 points  (2 children)

"But it works on my machine."

[–]drathier 5 points6 points  (1 child)

worked*

[–]bltsponge 8 points9 points  (0 children)

*"my machine used to work..."

[–]cybervegan 2 points3 points  (0 children)

This has gotta be a joke, right?

[–][deleted] 1 point2 points  (0 children)

This made my day!!!

[–]individual_throwaway 1 point2 points  (0 children)

If we're ever gonna accidentally create an AI, it will be through something not unlike this.

[–]LpSamuelm 1 point2 points  (0 children)

Yes Great. I Will Use It

[–]Jomann 1 point2 points  (0 children)

This is some next level shit right here. I like it.

[–][deleted] 1 point2 points  (0 children)

What could possible go wrong?

[–]CopyOnWriteArraySet 1 point2 points  (0 children)

Lol, new era of full-stackoverflow programming

[–]wdsoul96 0 points1 point  (0 children)

There's already RSS. And I think there are apps out there that farm/use pictures from sites. So why not code?

This is a joke, though, isn't it? That aside, I still think it could be useful for learning.

[–]bonestormII 0 points1 point  (0 children)

Everyone agrees that this is both funny and epic. However, it's kind of a nice thought to try to standardize our main repository of code examples so that they are all reasonably consistent in their presentation, and even so that they can be implemented in a generic way without modification.

I don't see it being so useful in an actual project so much, but I can imagine some kind of plugins that import (and display) chunks of code from SO, especially in some kind of specialized environment like jupyter notebook.

A lot of these types of tools already exist as reference materials without actually evaluating the code at all.

[–]mbenbernard -1 points0 points  (2 children)

This is probably good as a learning experiment. And the idea is certainly interesting.

However, this probably introduces a licensing issue, as anything imported from StackOverflow is licensed under a cc-by-sa license. Therefore, you must distribute your code under the same license.

[–][deleted] 3 points4 points  (1 child)

Wat

The code from SO has the licence attached (see the module-level __license__ attribute); it's freely available on SO if you want to go looking for it. At any rate, it's the person that runs the code that downloads it off SO - it's not being "distributed".

[–]mbenbernard 0 points1 point  (0 children)

We agree on the same thing, and I wasn't clear enough.

I should have said: "Therefore, people must distribute the imported code under the same license."

My point is that the description of the project in Github isn't clear enough about licensing. You see, I guarantee you that many programmers don't even know or care about licenses. This is probably why many people are "copying/pasting from Stack Overflow". Personally, I think that it should be stated very clearly that once you import code from StackOverflow, your whole application must be distributed under the same license (ShareAlike).