Hacker News new | past | comments | ask | show | jobs | submit login

Isn’t “rewrite the example code in your own style” accepted best practice for human coders, when working from an example that does what you need?

I’m not sure what would be acceptable output for a code generation tool if rewriting the examples isn’t ok and reimplementing something that performs the same function still isn’t ok. Are we automatically granting de-facto code patents on all published code now?




The point here is that this isn't some example from a textbook or even stack overflow, but licensed pieces of work with all the legal complications that come with that. This is about the potential use of this code in proprietary code (or code otherwise incompatible with the original licenses), and I really don't think anyone would say it is "accepted best practice" to copy out someone else's work you find online, licenses be damned, in a professional setting.


> this isn't some example from a textbook or even stack overflow, but licensed pieces of work with all the legal complications that come with that

I understand why these might feel different to you, but textbooks and stack overflow are also proprietary, licensed pieces of work. I don’t see why there would be much of a legal distinction.


No, you're missing the point.

There are two worlds.

In one, everytime someone publishes code with a license attached, they've taken a chunk out of the set of valid lines of software capable of being permissibly written without license encumberance. This is the world the poster you are replying to is imagining we're headed toward, and this case basically does a fantastic job of laying a test case/precedent for.

The other world, is one where everyone accepts all programming code is math, and copyrighting things is like erecting artificial barriers to facilitate information asymmetry. I.e. trying to own 2 + 2. In this second hypothetical world, we summarily reject IP as a thing.

The 2nd world is what I'd rather live in, as the first truly feels more and more like hell to me. However, given the first one is the world we're in, I'd like to see the mental gymnastics employed to undermine Microsoft's original software philosophy.

EDIT: Voir dire will be a hoot. Any wagers on how many software people make it onto the jury if any?


> In one, everytime someone publishes code with a license attached, they've taken a chunk out of the set of valid lines of software capable of being permissibly written without license encumberance.

If this were true of copyright, we would’ve run out of permissible novels a long time ago. There’s plenty to complain about with how software IP works, but copyright seems pretty sane. The alternative of protecting IP via trade secret is not a world I want to live in. That seems bad for open source.


Code is a more restrictive space than prose. Prose has to be grammatical and meaningful, but code has to compile and efficiently serve a useful specification.

The central idea of programming languages is that the grammar is very restrictive compared to natural languages. It's quite likely that, with the exception of variable names and whitespace, some function you wrote to implement a circular buffer is coincidentally identical to code that exists in Sony's or Lockheed Martin's codebases.

Plus there's the birthday problem -- coincidences can happen way more than you expect. And even with prose, constraints like non-fiction can narrow things down quickly. If everyone on HN had to write a theee-sentence summary of, say, how a bicycle works, there would probably be coincidentally identical summaries.


Three sentence summaries probably wouldn’t qualify for copyright protection. The same should be true of code - if we think the standard for copyright protection is too low, we should raise the bar on complexity requirements, not throw out copyright.

Even if a programming grammar is more restrictive, there’s some length where things become almost certainly unique.


ReactOS actually got sued by Microsoft for stealing code and one of their proofs was a piece of code (can’t remember exactly what it did) that basically matched the same function Windows code with a few things changed.

It was ASM code I think, and their defense was that there was basically one way to write a function that does this.


I think you're misremembering here; as far as I know (and as far as I can tell from searching just now) MS has never sued ReactOS. There was a claim made back in 2006 on the mailing list that a portion of syscall.S was copied, and this caused ReactOS to do their own audit:

https://en.wikipedia.org/wiki/ReactOS#Internal_audit


It raises an interesting question though.

Aside from obligatory syntactic bits, what is the most common line of code across all software ever developed?

It'll probably be C or Java. HTML doesn't count.

And it's probably something boring like:

  i++;


I'm don't think this dichotomy is at all fair. Just because someone makes a piece of software public does not mean they want it freely copied, and I think that can be a completely reasonable stance to have. I'm struggling to make sense of your argument unless you believe either:

- Code is not intellectual property; I don't see this as easily defensible. It takes time, effort, and in some cases seriously heavy resources to come up with some of the tech companies rely on. Should all private companies rescind copyright on literally everything their staff write?

- Intellectual property is a nonsense concept altogether; in this case, I don't think you're ever going to get your way in the court of public opinion.



in many cases a snip;routine;proc...whatever you work with, is rote procedure. such as device access. ie retrieving a directory listing.

code that reverts to a conserved sequence of bytes interchanged ,no functional variations.

code that is so common knowledge it has become street graffiti, belongs in world 2

versus code that creates a functionality not available by direct command, is innovative and should be attributed. this sounds like what 1st world should be.


That’s not actually how it works. Purely functional code, such as code that it written in a certain way to achieve maximum performance, is not deemed expressive and therefore not covered by copyright. This code would be covered by patent.


i think we are actually talking about the same thing.

in simpl terms:

mov bax eax ; an obvious function; no IP

mov eax eax ; seems useless unless you know what de-referencing is. probably IP

this is of course example not considering granularities at level of patents on a language, or macro directives


"Isn’t “rewrite the example code in your own style” accepted best practice [...]?"

Why would it be? If a function performs the data transform I need you better believe i'm copy pasting that sucker with a hyperlink to where I found it

But then again, I'm not trying to win in court.


what would happen without that hyperlink? the overall issue seems to be a lack of attribution to the originator.


That depends a lot on the license - some require attribution, some don't, some care not a bit (in that they don't permit copying).


proper attribution to the writer seems to be a big part of this. there is also suggestion ms knows, all about it but passes the liability buck to the end user of copilot suggestions.

[Lawyer and developer Matthew Butterick announced last month that he'd teamed up with the Joseph Saveri Law Firm to investigate Copilot. They wanted to know if and how the software infringed upon the legal rights of coders by scraping and emitting their work without proper attribution under current open-source licenses.]

https://www.theregister.com/2022/11/07/in_brief_ai/

https://www.theregister.com/2022/10/19/github_copilot_copyri...


Mitigating copyright issues by “rewriting in your own style” arguably only applies to humans doing the rewriting as a creative task, because copyright only applies to human creative works.


I can't recall a single time that's been common advice given to programmers. It's usually either don't reinvent the wheel (therefore use the source while adhering to license), or come up with your own solution.

Don't know how you would even write code in your own style. As soon as you start altering it, the result is different. It's more/less efficient.


this comment really hits hard for me -- its like there is a place to buy food where every menu item is clearly shown, with a large color picture and a printed price.. and the person talking has only every purchased food in that way.. as if there are no alternatives that "really exist"

there really are a lot of other scenarios that involve writing software, to make software. Its not possible to list them all.. the list changes while I type


How do you like to name varibles. Do you use constant == variable or variable == constant. Tabs vs spaces. Declarations inline with first use, or at the top as K&R intended. Comment syntax and content. Etc.

Lots of little things.


Depending on language there are ton of style choices. There’s style guides as examples of trivial.

Non trivial include names, comments, logging, error checking, structure, ordering of operations that aren’t sequential.


Yes, but all of those have impact to the actual function and performance of the proposed solution. By doing so, you are changing the solution.

Look at FizzBuzz. If you were to set strict requirements on performance (and allow for reiterative testing), the results from different groups of people would be identical. They would reach the same conclusion because that's how code works, it's far more aligned to math than it is creative writing.

So you cannot take an existing code solution and translate it to your own style. You are altering the program, the efficiency, and therefore the solution itself. Even when you do something like changing 1 single variable name!


I interpreted the comment you are responding to as “make sure it uses the same style conventions as the rest of this file”, which is something that Copilot does very well!




Join us for AI Startup School this June 16-17 in San Francisco!

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

Search: