tea.mathoverflow.net - Discussion Feed (Long code excerpts?) 2018-11-04T13:41:55-08:00 http://mathoverflow.tqft.net/ Lussumo Vanilla & Feed Publisher Michael Lugo comments on "Long code excerpts?" (2236) http://mathoverflow.tqft.net/discussion/184/long-code-excerpts/?Focus=2236#Comment_2236 2010-01-29T10:58:55-08:00 2018-11-04T13:41:55-08:00 Michael Lugo http://mathoverflow.tqft.net/account/37/ I feel like we shouldn't be more code-friendly than Stack Overflow, given that Stack Overflow clearly has a lot more people who can actually read code. I feel like we shouldn't be more code-friendly than Stack Overflow, given that Stack Overflow clearly has a lot more people who can actually read code.

]]>
Ilya Nikokoshev comments on "Long code excerpts?" (2220) http://mathoverflow.tqft.net/discussion/184/long-code-excerpts/?Focus=2220#Comment_2220 2010-01-29T00:22:16-08:00 2018-11-04T13:41:55-08:00 Ilya Nikokoshev http://mathoverflow.tqft.net/account/22/ @Qiaochu: from that link (emphasis mine) Most code that is going to be posted on the site is going to be a short snippet where the relevant parts are the only ones going to be posted. Anything ... @Qiaochu: from that link (emphasis mine)

Most code that is going to be posted on the site is going to be a short snippet where the relevant parts are the only ones going to be posted. Anything that gets a little longer will usually have comments in relevant parts explaining what's going on. We're programmers, I think that suffices. Allowing lines might encourage bigger code blocks, and that's not a behavior I think we want to encourage.

]]>
Qiaochu Yuan comments on "Long code excerpts?" (2212) http://mathoverflow.tqft.net/discussion/184/long-code-excerpts/?Focus=2212#Comment_2212 2010-01-28T14:50:55-08:00 2018-11-04T13:41:55-08:00 Qiaochu Yuan http://mathoverflow.tqft.net/account/13/ Ilya, as far as I can tell we are one of those sites, at least with respect to the first condition. Although see this discussion on SO as to why there are no line numbers: ... Ilya, as far as I can tell we are one of those sites, at least with respect to the first condition. Although see this discussion on SO as to why there are no line numbers: http://meta.stackoverflow.com/questions/7119/why-are-there-no-line-numbers-in-the-code-listings.

]]>
Ilya Nikokoshev comments on "Long code excerpts?" (2210) http://mathoverflow.tqft.net/discussion/184/long-code-excerpts/?Focus=2210#Comment_2210 2010-01-28T14:24:27-08:00 2018-11-04T13:41:55-08:00 Ilya Nikokoshev http://mathoverflow.tqft.net/account/22/ There are many sites where you can post your code and have it nicely formatted, line numbers, easy download etc. I think linking to a code pasted onto one those sites would be a much better choice ... There are many sites where you can post your code and have it nicely formatted, line numbers, easy download etc. I think linking to a code pasted onto one those sites would be a much better choice than pasting it directly into the question text. This may not apply if the code itself is the primary object of the question, but I don't imagine how it would be possible for a question appropriate for MO.

]]>
rwbarton comments on "Long code excerpts?" (2151) http://mathoverflow.tqft.net/discussion/184/long-code-excerpts/?Focus=2151#Comment_2151 2010-01-27T13:44:28-08:00 2018-11-04T13:41:55-08:00 rwbarton http://mathoverflow.tqft.net/account/6/ I tihnk it would generally be best to include an appropriately high-level explanation of what the code is about in English, so that people can determine whether they are interested in the question, ... I tihnk it would generally be best to include an appropriately high-level explanation of what the code is about in English, so that people can determine whether they are interested in the question, together with a link to the code on a pastebin site (e.g. gist.github.com) for the full gory details.

]]>
Michael Lugo comments on "Long code excerpts?" (2150) http://mathoverflow.tqft.net/discussion/184/long-code-excerpts/?Focus=2150#Comment_2150 2010-01-27T13:08:26-08:00 2018-11-04T13:41:55-08:00 Michael Lugo http://mathoverflow.tqft.net/account/37/ Just to make it clear, I'm not saying that long amounts of code should be disallowed. Just to make it clear, I'm not saying that long amounts of code should be disallowed.

]]>
David Speyer comments on "Long code excerpts?" (2149) http://mathoverflow.tqft.net/discussion/184/long-code-excerpts/?Focus=2149#Comment_2149 2010-01-27T12:31:44-08:00 2018-11-04T13:41:55-08:00 David Speyer http://mathoverflow.tqft.net/account/23/ That particular question didn't belong on the forum, because the math was elementary. But I could imagine having a question where a program wasn't performing as expected and I didn't know whether the ... That particular question didn't belong on the forum, because the math was elementary. But I could imagine having a question where a program wasn't performing as expected and I didn't know whether the flaw was in my understanding of the mathematics or my implementation of the algorithm; I think it would be OK to post code in that case.

]]>
Grétar Amazeen comments on "Long code excerpts?" (2148) http://mathoverflow.tqft.net/discussion/184/long-code-excerpts/?Focus=2148#Comment_2148 2010-01-27T11:42:35-08:00 2018-11-04T13:41:55-08:00 Grétar Amazeen http://mathoverflow.tqft.net/account/70/ That particular question was inappropriate. I agree that long chunks of code shouldn't be disallowed but I also agree with Michael that there should be something in the "how to ask" page ... That particular question was inappropriate.

I agree that long chunks of code shouldn't be disallowed but I also agree with Michael that there should be something in the "how to ask" page asking people to describe their algorithms in higher level terms, rather than in code. Perhaps it's just me but I couldn't write c++ code if my life depended on it, without investing some time in learning the syntax. However I'm well capable of following the reasoning behind an algorithm, and could possibly be of help to OP's if they wrote in higher-level terms rather then code.

If a question really is about the maths behind an algorithm, then that's fine and the question should be written in terms understandable to a lot of mathematicians. If however the question is sensitive tot which programming language it is written in, then it probably is not an MO question.

]]>
Scott Morrison comments on "Long code excerpts?" (2141) http://mathoverflow.tqft.net/discussion/184/long-code-excerpts/?Focus=2141#Comment_2141 2010-01-27T09:27:45-08:00 2018-11-04T13:41:55-08:00 Scott Morrison http://mathoverflow.tqft.net/account/3/ The asker has answered himself, and the question has since been closed. This particular question was inappropriate, but I agree there's no need for a "rule" about long chunks of code being ... The asker has answered himself, and the question has since been closed. This particular question was inappropriate, but I agree there's no need for a "rule" about long chunks of code being disallowed.

]]>
Steve Huntsman comments on "Long code excerpts?" (2139) http://mathoverflow.tqft.net/discussion/184/long-code-excerpts/?Focus=2139#Comment_2139 2010-01-27T09:07:14-08:00 2018-11-04T13:41:55-08:00 Steve Huntsman http://mathoverflow.tqft.net/account/110/ I made such a post. Most of the code was for graphing purposes; I haven't had time yet to follow up on my own question re: a Poincaré map. I think in certain carefully constrained contexts the ...
Given that, and because MO isn't a place for publication of papers but a place to ask questions, I don't think it's necessarily helpful to take a firm stance on including code.]]>
Michael Lugo comments on "Long code excerpts?" (2137) http://mathoverflow.tqft.net/discussion/184/long-code-excerpts/?Focus=2137#Comment_2137 2010-01-27T08:25:34-08:00 2018-11-04T13:41:55-08:00 Michael Lugo http://mathoverflow.tqft.net/account/37/ This question about the Atkin sieve includes an amount of C++ code that's much longer than the text of the post. I'm having trouble finding other examples, but I know there have been other such ... This question about the Atkin sieve includes an amount of C++ code that's much longer than the text of the post.

I'm having trouble finding other examples, but I know there have been other such posts. Generally I think that many of us aren't willing to read large amounts of code, especially in unfamiliar languages. (C++ is hardly obscure, but I'm not a programmer.)

Perhaps the "how to ask" page should include something like "if your post includes lots of code, this probably isn't the right place for it?" This seems to be in keeping with the general mathematical ethos that papers don't include code (at least, not outside of an appendix); most "experimental" papers that I've read seem to include a high-level description of the algorithm, maybe even in pseudocode, but not something somebody could actually run.

]]>