> Plagiarism isn’t a legal concept, it’s an ethical one.
Well if it isn't a legal but an ethical concept, then that's just your opinion, since there isn't some universal body that establishes exactly what is ethical and what isn't. And as I said in my previous comment, "I don't consider".
> You need to either attribute the source, or rewrite it in entirely your own words — just like when writing a paper.
Often times a three liner can not be changed in any way, and is the only solution to a problem. In some cases you may be able to change it only in terms of indentation and variable names (in others you can't even change that).
But assuming you can do that, it makes no sense at all just changing indentation and variable names just for the sake of changing it.
> Confirming to the license is also required; iirc, SO requires attribution under the CC-SA license.
You should use the example to understand the underlying problem, at which point you will be well-equipped to write your own one-liner.
If you can’t write it using your own understanding of the problem, you’re not an adequate programmer and need to improve your skill-set … which won’t happen if you just keep plagiarizing code you don’t understand.
You're basically just repeating that your opinion is the right opinion.
I don't agree that such example is plagiarism and I'm sure a lot of people also would disagree that that's plagiarism.
> You should use the example to understand the underlying problem, at which point you will be well-equipped to write your own one-liner.
> If you can’t write it using your own understanding of the problem, you’re not an adequate programmer and need to improve your skill-set … which won’t happen if you just keep plagiarizing code you don’t understand.
Who says you can't write it by your own, or you don't understand it? Stack overflow and tools such as copilot are often about saving time, not that you would be unable to figure it out by yourself.
And besides that, the point of those examples is that a lot of people without searching for those stack overflow posts, would type that exact same code character by character.
You need to either attribute the source, or rewrite it in entirely your own words — just like when writing a paper.
Confirming to the license is also required; iirc, SO requires attribution under the CC-SA license.