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.
Plagiarism being unethical is just my opinion?
> Are you going to attribute that every time you use Math.pow?
Does a simple 2-ary function call of a well-defined API qualify as “taking someone else's work or ideas and passing them off as one's own.”?
If not, then it’s not plagiarism.