Hacker News new | past | comments | ask | show | jobs | submit login
Good coders borrow, great coders steal (stackoverflow.blog)
146 points by dougskinner 12 days ago | hide | past | web | favorite | 53 comments





I like how the west is worried about copying/pasting some code and whether that would lead to some obscure licensing issue in the future where lawyers battle it out for 4 years, costing $3M in attorney fees; while some engineer in Shenzhen going off and copying stuff without any worries and infact openly teaching others in his team to learn how to cook some copy pasta.

IMO software licensing and patent litigations, all this nonsense of patenting a concept or workflow or some stupid idea someone had, hampers society tremendously.

David Beazley did an amazing and entertaining talk about software licensing litigations and what kind of things happen during this process: https://www.youtube.com/watch?v=RZ4Sn-Y7AP8

When I write any code, I take 2 options: 1) Don't share it publicly or 2) Completely release it as public domain. No need for MIT license or any of that crap. Here, just take the code and go win the world, I don't need any credit. Ask yourself how you've benefited from someone crediting you if at all it comes back to you. The world is a large place and just let it go. I am gonna die in 40 years and whatever I do will be totally irrelevant - if my name appears in COPYRIGHT 2020 MR. FERMI ENRICO. YOU MUST CREDIT ME. in some notice that a lawyer with thick glasses is scanning through after I am dead. What an amazing legacy that I am leaving behind.

Furthermore, we need have some respect for people that want to keep code private. Not everyone is interested in open sourcing their work - but somehow that's looked down upon. Why!? It is their work and respect it, there are so many people with pitch fork entitlement. Closed source is OK. They deserve it and hope they can be financially rewarded for the hard work. I see the open-source ecosystem as a double sword edge - we got some cool stuff out of it and everyone shares that base to build off of. But then there is also socialism of code - no one wants to improve it because its not their job, then the open source volunteers are blamed for the quality of their library where these guys are just doing it for fun in their free time - literally no right to get angry at them. Now, everyone is sharing the same shitty unmaintainable library 8 layers deep in their package.json file. The devs are overloaded, issues are piling up on Github and the dude in Shenzhen has already finished the project and his gadget is in prod.

We gotta be more agile lol.


> Not everyone is interested in open sourcing their work - but somehow that's looked down upon. Why!? It is their work and respect it, there are so many people with pitch fork entitlement.

The pitchfork entitlement, to my observation, is reactionary to the force of law backing something that should be an individual's responsibility if they want to keep it secret but not supported by the threat of government-sanctioned violence.

Contrast another industry where secrecy is key. A magician never reveals their secrets, and there's material value in being able to pull off a trick that nobody else can. But what's the ramification if somebody figures a trick out and publishes it? It certainly isn't a crime. The worst of person might face is sanction from a magician's guild.

Given that we have a world where somebody can be sued for taking apart a physical artifact that they own and discovering secrets of its implementation, sharing those secrets, and modifying the thing based on knowledge of those secrets, the pitchforks are somewhat understandable.


Interesting point, I would say "Well done reverse engineering my foo.bin, that's a fine job. You wanna work for us?" or "Great, they've reverse engineered our IP. Time for us to put boosters on and out compete them by sheer hard work, more IP and see if they catch up."

Often times reverse engineering is harder than building the damn thing in the first place.


> But what's the ramification if somebody figures a trick out and publishes it? It certainly isn't a crime.

Um, actually it can be. Many magic tricks can be both copyrighted and patented.

https://www.hollywoodreporter.com/thr-esq/teller-wins-lawsui...


As the article points out, magic tricks per se are not copyrightable. What are copyrightable are performative works, that may include magic tricks.

The distinction is subtle - it means you're perfectly free to "steal" an (unpatented) method, provided you use it in a different act.


Funny enough Teller, from Penn & Teller fame is attempting to use copyright to prevent his tricks from being revealed.

That's a slightly different case. It's not the stealing of the method that Teller objects to - it's the stealing of the act. The aesthetic, the script of the performance. Which I think is fair - it's an exceptionally artistic act, and performing it as one's own is rather like performing a song written by someone else without crediting them.

I don't think magical methods can be copyright. At best, they can be patented. It's not even clear that the copycat act uses the same method! But that's besides the point completely.


> When I write any code, I take 2 options: 1) Don't share it publicly or 2) Completely release it as public domain. No need for MIT license or any of that crap. Here, just take the code and go win the world, I don't need any credit. Ask yourself how you've benefited from someone crediting you if at all it comes back to you.

I had a similar philosophy in my youth, and it still resonates with me. Hanging around Slashdot and doing oss development, I learned enough about IP law to understand that it's not as simple as we'd like.

There's actually a risk that your unlicensed code will be picked up by somebody in a jurisdiction with different IP laws than you're familiar with. They can copyright the code (did you say "free for any use or modification?), and issue C&D to anybody hosting your code online. You could find yourself in a very awkward position where you published it first but they've done so in a legally defensible manner. CC0 and MIT are prudent licenses -- not to ensure that you get credit, but to cover your own ass.


I can get behind CYA license use. I think all of them have some kind of a clause - “You have no rights to sue me and no implied warranty” sounds logical.

I use MIT for everything. I don't like coercive licenses, but that CYA is important.

America is the Land of the [Lawyers'] Fee. I can't remember the site, but someone has a site, dedicated to all the stupid, ridiculous, double-facepalm lawsuits the US "enjoys."

It is quite common for people to be [successfully] sued for trying to help someone else.

I remember taking a CPR class, where we were told that, if we gave CPR, we could be sued.

So there's actually a reason why someone might stand back, and watch you die...


+1 We gotta get this lawyer gig economy shutdown. What a waste of human talent.

Hrm... I wouldn’t really glorify what Chinese software companies do. Tencent literally has Github repos that are existing open source projects, iterated on a little bit, with all of the copyright notices and license replaced. (Or, at least one of them is this, anyway. I kind of don’t want to specify which to avoid drama for the specific developer, but if you google names of repos you’ll eventually find one library that, under the exact same name, already existed, with some oddly identical code.)

Will this lead to huge, science-fiction-like conglomerates? Within a company, there are no licensing restrictions. So copying code, or other media like videos or pictures, stops being an issue.

Option 2 specifically public domain isn’t an option for people form some countries like Australia or Germany. They cannot put anything public domain. So please license things and go with MIT or Unlicence if you want it as free as possible.

How do you completely public domain without a license, seeing as things are considered copyrighted by default?

It interesting though, but AFAIK you there is a certain incompatibility between UK law and Public Domain license. I think you cannot revoke your own rights on the code, according to their law.

Something I realized working on a large internal codebase at a company: any line of code you write is liable to be copied-and-pasted at some point in the future.

And that's good! Consistency is a very valuable quality of large codebases worked on by many engineers.

If I want to figure out how to write a unit test for a service call, find an existing example of that pattern and copy that. Resist the temptation to invent a new, very slightly better way of doing that.

There's a big corollary to this: if you find yourself doing something for the very first time in that particular codebase, take the time to do it well. Because everyone else will be copying your code for the future lifetime of the project.


I work at a FAANG with a monorepo (or nearly so). For anything that’s not blue-sky R&D, stalking around the codebase for working examples and patterns is a big part of the job.

I’ve felt that there is a potentially a role missing here: a kind of free-floating code librarian who is not attached to any particular team and could be called upon to perform basic research of existing patterns. Part of this role could be to maintain the kind of newbie-friendly documentation that tends to fall between the gaps of tool/infra/product teams. Maybe the job title could be “software informatician”.


> a kind of free-floating code librarian who is not attached to any particular team and could be called upon to perform basic research of existing patterns

I'm on board with this idea, as long as I don't have to learn Dewey Decimal Classification.


This is usually called an "area tech lead" in FAANGs and "software architect" in more old-line software companies.

I’m thinking of a more junior supporting role, separate from development and architectural design. The librarian doesn’t write the books.

I've never worked on FAANG scale monorepos, but in normal-sizer project, that would be one team leader.

I introduced a new way of doing unit tests at a client recently, and, sure enough, my unit tests were basically treated as a template. Everybody added their own spin to it, but the basic structure was the same. I was quite glad that I had suspected this beforehand and accounted for it.

Making a copy of an example someone has publicly posted to help people and modifying that copy to properly integrate it isn’t “stealing”. It was offered freely and the original author isn’t deprived of the benefits of their original work.

This article just wants to sound edgy.


It's not trying to be edgy, it's riffing on a famous aphorism that is often attributed to Pablo Picasso.

https://quoteinvestigator.com/2013/03/06/artists-steal/


TLDR; it's probably T.S. Elliot and Stravinsky that deserve the credit.

That's one case where QI was weirdly noncommittal. It's obviously Eliot's line ("Immature poets imitate; mature poets steal"), with a couple words replaced. The Stravinsky reference came decades later and was second-hand anyhow.

It was Steve Jobs

/s


The article explicitly addresses it close to the end:

> To steal, however, is to make that idea your own. Taking credit for someone else’s idea is borrowing; understanding an idea and weaving it into your own work, that’s what he meant by theft.


Content on Stack Overflow isn’t technically offered freely. It’s offered under a specific license with specific conditions.

If you're working with more than a couple of people it can be worth running an audit on your code, including the libraries you're using. Even if the libraries themselves have permissive licenses, they may inadvertently include bits of SO code.

know of any good tools to help identify those instances?

Sorry no, only that it was done by a third party prior to a funding round.


Wow..that seems much more restrictive than it should be.

They're seriously saying closed source software companies can't use content on Stackoverflow? What if I write a piece of closed source software while consulting SO, is that my own work or a transformed version of the work on SO?


I don't know if that license would really stand up in court, I think a good attorney would have some interesting attack possibilities given the origin of some code you see on Stackoverflow anyway. Not to mention that license is not readily apparent to people, on a social site where you are sharing answers between people does every person in the conversation know what license they are entering in to? How is stackoverflow marketed to people, is that marketing at odds with the assumed license?

I often incorporate snippets; some from SO, some from SomeRandomDudesMessyBlog.io

I have a rule, though: I never add code, unless I understand it 100%, and I often make tweaks to adjust it to my immediate needs.

One of my best thefts was a simple FIFO queue, from this book: https://www.objc.io/books/advanced-swift/

This is my adaptation: https://github.com/RiftValleySoftware/RVS_Generic_Swift_Tool...

I really had to do almost nothing to improve it. I think I just extended its utility a bit.

Of course, these weren't your usual SO "academic sample" dudes.


I think I might have a few hundred copies of:

```

# From https://stackoverflow.com/a/246128

DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"

```


I think shell is the most plagiarized code in existence.

So many sysadmins have rudimentary skills and simply copy what works.

I have seen some folks with huge repos of code snippets like that


For sure, and the funny thing is that it can be replaced often by replaced by the simpler and more readable

    DIR=$(dirname $(readlink -f $0))
However OS X doesn't have readlink, so the longer BASH_SOURCE thing makes sense there.

I started using the longer one, and then I gave up on shell scripting on OS X for other reasons, and didn't go back. So yeah there is a lot of random cargo culting.

In Oil I hope to provide an even simpler method that's built in (and it also has readlink builtin to support this)

https://github.com/oilshell/oil/issues/587


I think I actually eventually solved this by installing `coreutils` on OS X and using `realpath`.

What is this article actually saying? Sometimes programmers copy-paste things, and that's ok except when it isn't, and something something Van Gogh? Is there more to it that I missed?

There is a really good point that I found where it talks about the difference between "borrowing" (bad) and "stealing" (good).

> A borrowed object still belongs to someone else; you copy a style and it still belongs to someone else. To steal, however, is to make that idea your own. Taking credit for someone else’s idea is borrowing; understanding an idea and weaving it into your own work, that’s what he meant by theft.

So the point is when you 'lift' some code from somewhere and use it, use it fully, own it, have mastery of it. Only then have you 'stolen' it and become yours.


This is probably just stackoverflow's mediocre content strategy, they're trying to get some distance between all of their gaffes (the unilateral re-licensing of content, the monica celio mod debacle, etc.)

I read this article on vice gaming earlier about giving credit to creators for assets used in development that I thought was interesting...

https://www.vice.com/en_us/article/qj4pzd/how-we-assign-cred...

For me it just comes down to the license, I’d probably credit an artist for their work if I used it in a game but if the license doesn’t say that then there’s no onus to right?

If I like the stuff enough to use it in my project then The creator deserves some recognition, is there a reason not to?


This would be a great title for an article about Rust lifetimes.

If you're working on a JavaScript project, do you prefer copying from SO or installing a (micro-) package that solves your problem?

I seem to prefer the former.


To be completely honest, if you're smart, and focused on shipping product you really don't care and will find a way to steal while at the same time obfuscate to the point where no one will notice or care. I get there's a moral dilemma for some, and credit etc. comes into play, but I can assure you the people that are solely focused on getting $#!t shipped really don't care, and by the time they have to they will have either sank or have enough resources to handle it.

To add to this, I don't think there's any function really that I haven't had to customize/make my own... I mean add a few params, change or transform the output or even convert js to php or python.

I think I can maybe count on 1 hand the times I've literally copied/pasted and left it as is. Usually it's copying some config file for a laravel package or something because there were some changes and I'm combining them on an upgrade or something.


This applies to ops as well. Most problems we look at have been solved before so it's a case of identifying and integrating (aka opinioinating) the solution not necessarily creating something from scratch.

This should be a real book!

It is important -- vital even -- to know how to find the right code, how to understand and test it, how to modify it.

And not just from stack overflow, but also from colleagues and even yourself.

If this were real, I would buy it.


Yet one cannot borrow or steal which is not created in the first place. So Great coders are the ones who create or write first.

parallels between coders and poets?



Guidelines | FAQ | Support | API | Security | Lists | Bookmarklet | Legal | Apply to YC | Contact

Search: