-1
\$\begingroup\$

In this answer the OP of the question presented an alternative solution from github. The github repository shows that it uses the MIT license:

...

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

Which leads me to believe the user can post it as maintainer.

However at the end of the answer is this (which I modified for grammar and formatting):

  • Checks if the condition -d*m%b%g == 0 is satisfied. This condition is related to finding a solution to the modular equation \$p*x + d*m ≡ 0 (mod b)\$ where \$x\$ is the repeating part. This is still a mystery for me, how does it work?

If this was posted in a question then I would vote to close because it would not be on-topic due to the OP not being able to answer all questions from that page- primarily:

  • Am I an author or maintainer of the code?

    For licensing, moral, and procedural reasons, we cannot review code written by other programmers. We expect you, as the author, to understand why the code is written the way that it is.

Yet this code and question is contained in an answer. Is it okay for the OP to post this code in an answer even if they don't fully understand how it works?

\$\endgroup\$
3
  • \$\begingroup\$ what is OP? in next days i will explain with more detail de answer \$\endgroup\$
    – qleoz12
    Commented Nov 21, 2023 at 22:13
  • 1
    \$\begingroup\$ Original Poster \$\endgroup\$ Commented Nov 21, 2023 at 22:17
  • 1
    \$\begingroup\$ Is it OK for anyone to post/cite code in an answer and disclose to not understand how/why it works? Should OP or not make any difference? Can code for an alternate solution be a valid CR answer, does tag algorithm make a difference here? \$\endgroup\$
    – greybeard
    Commented Nov 22, 2023 at 7:06

1 Answer 1

0
\$\begingroup\$

For the author or maintainer reason, lets go to the source: Why is only my own written code on-topic?

Moral / Polite

The purpose of a code review is to provide constructive criticism. Criticism can only be constructive if given to the person who is the emotional 'owner' of the code.

[...]

This can be abused even further. We have had instances on Code Review where 'managers' have requested their employee's code is reviewed, and the outcome of the review would impact that employee's job (fired?)

rolfl's answer to "Why is only my own written code on-topic?" © CC BY-SA 4.0
Section(s) removed with "[...]".
Peilonrayz' answer to "Can a user post code in an answer even if they don't fully understand how it works?" © CC BY-SA 4.0

Is an answer posted to receive "constructive criticism"? Are we going to have bad actors abuse posting other people's code as answers?

I think we can relatively safely say "no" to both.

Practical

[...]

In Code Review, as an online resource, in a Q&A format, the expectation is that the text describing the code should explain why the code does things the way it does. Code that is just dumped without an explanation is, in Code Review terms, "unclear", and is likely to be closed as "Unclear what you are asking."

If the code is not your code, you cannot answer questions about what motivated certain implementation decisions, you can only speculate. By default, it is impossible for you to describe the motivations for the code if it is not your code, and thus the question is unclear. On code review this happens often enough for there to be a special off-topic close reason to cover this situation.

rolfl's answer to "Why is only my own written code on-topic?" © CC BY-SA 4.0
Section(s) removed with "[...]".
Peilonrayz' answer to "Can a user post code in an answer even if they don't fully understand how it works?" © CC BY-SA 4.0

I think we can agree giving answerer's the advice "the text describing the code should explain why the code does things the way it does." With the intent we have for questions is harmful.

However "the text describing the code should explain why the code does things the way it does." rings similar to our IO rules.

What goes into an answer

Every answer must make at least one insightful observation about the code in the question. Answers that merely provide an alternate solution with no explanation or justification do not constitute valid Code Review answers and may be deleted. In addition to criticisms, pointing out good practices in the code is also a form of helpful feedback.

Answers need not cover every issue in every line of the code. Short answers are acceptable, as long as you explain your reasoning. Do not provide suggestions for improvements in a comment, even if your suggestion makes a very short answer.

Code Review's How do I write a good answer? © CC BY-SA 3.0

Legal

One of the reasons for the restriction is the implied licensing terms that are part of Stack Exchange. Anything you post here is automatically ascribed to the Creative-Commons ShareAlike type licensing. See Section 6 of your terms-of-service - subsection "Subscriber Content" here on Stack Exchange.

If it is not your code, then you have no authority to give away the licensing for it.

rolfl's answer to "Why is only my own written code on-topic?" © CC BY-SA 4.0

We are not lawyers so legalities are out side our remit to understand or enforce. Additionally providing legal advice is not something non-lawyers should do.

However we may want to have rules which reduce the harm potential for all users of our site.


Lets have a quick look at the licence for the code in the answer.

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

RussellDash332's LICENSE

Has the user provided the copyright notice or the permission notice in the answer on Code Review? No.

One thing to note is because the MIT license has the owner's name and a date included in the license no single "MIT license" exists. We can see the Arch Wiki lightly describes the situation:

License families like BSD or MIT are, strictly speaking, not a single license and each instance requires a separate license file. In license variable refer to them using a common SPDX identifier (e.g. 'BSD-3-Clause' or 'MIT'), but then provide the corresponding file as if it was a custom license.

Arch Wiki's PKGBUILD © GNU Free Documentation License 1.3 or later

Another common licence our users interact with is the CC BY-SA 4.0 license.

Attribution — You must give [appropriate credit1], provide a link to the license, and [indicate if changes were made2]. You may do so in any reasonable manner, but not in any way that suggests the licensor endorses you or your use.

  1. If supplied, you must provide the name of the creator and attribution parties, a copyright notice, a licence notice, a disclaimer note, and a link to the material. CC licences prior to Version 4.0 also require you to provide the title of the material if supplied, and other slight differences.
  2. In 4.0, you must indicate if you modified the material and retain an indication of previous modifications. In 3.0 and earlier licence versions, the indication of changes is only required if you create a derivative.

Creative Commons's Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) © CC BY 4.0
I have changed the hyperlinks to [name<sup>num</sup>] and entered the pop-up text to be in an ordered list
Peilonrayz' answer to "Acknowledging code review contributions in academic projects" © CC BY 4.0

So overall the only site policy we may need is one around having a minimum level of attribution. Irrespective of actual legalities of the license of the attributed work.

\$\endgroup\$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .