15
\$\begingroup\$

I recently asked this question. I looked around, but it doesn't look like my problem has been asked here:

A small (9 SLOC) portion of my code is an equation from a user on Stackoverflow. I credit the user and a link to the answer containing the equation is provided in the source code as well. Though I am concerned with this portion of the Code Review Help Center addressing Authorship of Code:

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.

I perfectly understand how his code works, and how it fits into my program. Yet it wasn't written by me. Am I allowed to have this question posted, even though it contains code that wasn't written by me but was credited? Thanks.

\$\endgroup\$
21
\$\begingroup\$

Not a problem

If it would be a problem, you wouldn't be allowed to use someone else's libraries either.

That rule is there to prevent people from dumping code that they don't understand and/or 80% copied from the internet. We can't review that for a whole lot of reasons explained in other meta posts, enough of them already visible in the 'Related' section next to this question.

The key is whether your code is different enough. And even then, it gets tricky at times. There are only so many ways you can multiply or divide 2 numbers in a meaningful way. When in doubt, your question might get closed (and if you disagree you can take it to meta). But I have absolutely no doubts about this one.

Crediting the small portion of code is exactly the right way to go about this. You understand how it works and why this is exactly where it should be. If (potential) reviewers have questions about your code, they can ask and you can answer. You're using a small piece of code to get a much larger piece written.

All is well.

\$\endgroup\$

You must log in to answer this question.

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