Skip to main content
added 10 characters in body
Source Link
rhermans
  • 37.8k
  • 13
  • 17

The offence

There seem to be a significant amount of new people posting code that looks like this

a = (E^(-2 Abs[\[Gamma] - z Cos[\[Theta]]]^2) \!\(
\*UnderoverscriptBox[\(\[Sum]\), \(j = 0\), \(m\)]\(
\*UnderoverscriptBox[\(\[Sum]\), \(l = 0\), \(m\)]
\*FractionBox[\(1\), \(\(j!\)\ \(l!\)\)] Binomial[m, j]\ Binomial[m, l]\ 
\*SuperscriptBox[\(Conjugate[ z\ Sin[\[Theta]]\ Tan[\[Theta]]]\), \(j\)]\ 

Examples: 268606 268222 268172 267133

This String Based Input of Notebook Boxes, is normally created by using a palette or control keys. This form is interpreted by the Front-End without problems, but it is very hard to parse for humans. I call it unreadable.

The solution

A solution exists in the answer posted by @m_goldberg, back in 2015. The code that looks good is thewell-indented raw input form.

How to copy code from Mathematica so it looks good on this site

Basically:

Choose Convert To > Raw InputForm from the Cell menu or from the contextual (right mouse click) menu. Then Copy & Paste

Previous discussion

This Q&A addresses what formats are acceptable

What kind of Input and Output Code Styles are acceptable in SE?

The answer by moderator @rm-rf calls for

  1. One should be able to copy-paste-evaluate the code block in Mathematica.
  2. The code block should be as noise-free as possible.
  3. Do not use fancy typesetting in your code.
  4. Try to use sane and reasonable indenting/formatting.
  5. Also, try to avoid the code block scrolling sideways.
  6. Keep the code and variables minimal and simple

Strictly speaking, the form I'm complaining about does comply with point 1, and may comply with 5 and 6, but definitely fails in points 2, 3 and 4.

Opinions

Personally, I think it is NOT acceptable to share code that it's not human readable. Questions featuring such code should be corrected or closed.

Some people may disagree, and argue that such code can be interpreted directly by the Mathematica Kernel by pasting it into a Mathematica Notebook.

After the latter, I would offer the counterargument that before deciding to copy&paste code one needs to assess if the question deserves one's attention, and unreadable code doesn't allow that. The burden on the community is too high.

The question

The previous discussion defines the ideal formatting but doesn't conclude what to do with the questions that are not in an ideal form. I am not aware of any consensus on where is the threshold that divides acceptable forms from not acceptable.

I'm looking for a community consensus on whether this form of code is:

  1. Acceptable and should be answered without complaints.
  2. Unacceptable and questions of this style should be either edited or closed.
  3. Some other alternatives.

Is unreadable valid code acceptable in Mathematica Stack Exchange?

The offence

There seem to be a significant amount of new people posting code that looks like this

a = (E^(-2 Abs[\[Gamma] - z Cos[\[Theta]]]^2) \!\(
\*UnderoverscriptBox[\(\[Sum]\), \(j = 0\), \(m\)]\(
\*UnderoverscriptBox[\(\[Sum]\), \(l = 0\), \(m\)]
\*FractionBox[\(1\), \(\(j!\)\ \(l!\)\)] Binomial[m, j]\ Binomial[m, l]\ 
\*SuperscriptBox[\(Conjugate[ z\ Sin[\[Theta]]\ Tan[\[Theta]]]\), \(j\)]\ 

Examples: 268606 268222 268172 267133

This String Based Input of Notebook Boxes, is normally created by using a palette or control keys. This form is interpreted by the Front-End without problems, but it is very hard to parse for humans. I call it unreadable.

The solution

A solution exists in the answer posted by @m_goldberg, back in 2015. The code that looks good is the raw input form.

How to copy code from Mathematica so it looks good on this site

Basically:

Choose Convert To > Raw InputForm from the Cell menu or from the contextual (right mouse click) menu. Then Copy & Paste

Previous discussion

This Q&A addresses what formats are acceptable

What kind of Input and Output Code Styles are acceptable in SE?

The answer by moderator @rm-rf calls for

  1. One should be able to copy-paste-evaluate the code block in Mathematica.
  2. The code block should be as noise-free as possible.
  3. Do not use fancy typesetting in your code.
  4. Try to use sane and reasonable indenting/formatting.
  5. Also, try to avoid the code block scrolling sideways.
  6. Keep the code and variables minimal and simple

Strictly speaking, the form I'm complaining about does comply with point 1, and may comply with 5 and 6, but definitely fails in points 2, 3 and 4.

Opinions

Personally, I think it is NOT acceptable to share code that it's not human readable. Questions featuring such code should be corrected or closed.

Some people may disagree, and argue that such code can be interpreted directly by the Mathematica Kernel by pasting it into a Mathematica Notebook.

After the latter, I would offer the counterargument that before deciding to copy&paste code one needs to assess if the question deserves one's attention, and unreadable code doesn't allow that. The burden on the community is too high.

The question

The previous discussion defines the ideal formatting but doesn't conclude what to do with the questions that are not in an ideal form. I am not aware of any consensus on where is the threshold that divides acceptable forms from not acceptable.

I'm looking for a community consensus on whether this form of code is:

  1. Acceptable and should be answered without complaints.
  2. Unacceptable and questions of this style should be either edited or closed.
  3. Some other alternatives.

Is unreadable valid code acceptable in Mathematica Stack Exchange?

The offence

There seem to be a significant amount of new people posting code that looks like this

a = (E^(-2 Abs[\[Gamma] - z Cos[\[Theta]]]^2) \!\(
\*UnderoverscriptBox[\(\[Sum]\), \(j = 0\), \(m\)]\(
\*UnderoverscriptBox[\(\[Sum]\), \(l = 0\), \(m\)]
\*FractionBox[\(1\), \(\(j!\)\ \(l!\)\)] Binomial[m, j]\ Binomial[m, l]\ 
\*SuperscriptBox[\(Conjugate[ z\ Sin[\[Theta]]\ Tan[\[Theta]]]\), \(j\)]\ 

Examples: 268606 268222 268172 267133

This String Based Input of Notebook Boxes, is normally created by using a palette or control keys. This form is interpreted by the Front-End without problems, but it is very hard to parse for humans. I call it unreadable.

The solution

A solution exists in the answer posted by @m_goldberg, back in 2015. The code that looks good is well-indented raw input form.

How to copy code from Mathematica so it looks good on this site

Basically:

Choose Convert To > Raw InputForm from the Cell menu or from the contextual (right mouse click) menu. Then Copy & Paste

Previous discussion

This Q&A addresses what formats are acceptable

What kind of Input and Output Code Styles are acceptable in SE?

The answer by moderator @rm-rf calls for

  1. One should be able to copy-paste-evaluate the code block in Mathematica.
  2. The code block should be as noise-free as possible.
  3. Do not use fancy typesetting in your code.
  4. Try to use sane and reasonable indenting/formatting.
  5. Also, try to avoid the code block scrolling sideways.
  6. Keep the code and variables minimal and simple

Strictly speaking, the form I'm complaining about does comply with point 1, and may comply with 5 and 6, but definitely fails in points 2, 3 and 4.

Opinions

Personally, I think it is NOT acceptable to share code that it's not human readable. Questions featuring such code should be corrected or closed.

Some people may disagree, and argue that such code can be interpreted directly by the Mathematica Kernel by pasting it into a Mathematica Notebook.

After the latter, I would offer the counterargument that before deciding to copy&paste code one needs to assess if the question deserves one's attention, and unreadable code doesn't allow that. The burden on the community is too high.

The question

The previous discussion defines the ideal formatting but doesn't conclude what to do with the questions that are not in an ideal form. I am not aware of any consensus on where is the threshold that divides acceptable forms from not acceptable.

I'm looking for a community consensus on whether this form of code is:

  1. Acceptable and should be answered without complaints.
  2. Unacceptable and questions of this style should be either edited or closed.
  3. Some other alternatives.

Is unreadable valid code acceptable in Mathematica Stack Exchange?

edited title
Link
rhermans
  • 37.8k
  • 13
  • 17

Is it acceptable to post code in non-human readableunreadable form? (i.e Notebook boxes not Raw Input Form)

added 257 characters in body
Source Link
rhermans
  • 37.8k
  • 13
  • 17

The offence

There seem to be a significant amount of new people posting code that looks like this

(please edit this question and replace this line if you know how to technically describe this form of code)

a = (E^(-2 Abs[\[Gamma] - z Cos[\[Theta]]]^2) \!\(
\*UnderoverscriptBox[\(\[Sum]\), \(j = 0\), \(m\)]\(
\*UnderoverscriptBox[\(\[Sum]\), \(l = 0\), \(m\)]
\*FractionBox[\(1\), \(\(j!\)\ \(l!\)\)] Binomial[m, j]\ Binomial[m, l]\ 
\*SuperscriptBox[\(Conjugate[ z\ Sin[\[Theta]]\ Tan[\[Theta]]]\), \(j\)]\ 

Examples: 268606 268222 268172 267133

This String Based Input of Notebook Boxes, is normally created by using a palette or control keys. This form is interpreted by the Front-End without problems, but it is very hard to parse for humans. I call it unreadable.

The solution

A solution exists in the answer posted by @m_goldberg, back in 2015. The code that looks good is the raw input form.

How to copy code from Mathematica so it looks good on this site

Basically:

Choose Convert To > Raw InputForm from the Cell menu or from the contextual (right mouse click) menu. Then Copy & Paste

Previous discussion

This Q&A addresses what formats are acceptable

What kind of Input and Output Code Styles are acceptable in SE?

The answer by moderator @rm-rf calls for

  1. One should be able to copy-paste-evaluate the code block in Mathematica.
  2. The code block should be as noise-free as possible.
  3. Do not use fancy typesetting in your code.
  4. Try to use sane and reasonable indenting/formatting.
  5. Also, try to avoid the code block scrolling sideways.
  6. Keep the code and variables minimal and simple

Strictly speaking, the form I'm complaining about does comply with point 1, and may comply with 5 and 6, but definitely fails in points 2, 3 and 4.

Opinions

Personally, I think it is NOT acceptable to share code that it's not human readable. Questions featuring such code should be corrected or closed.

Some people may disagree, and argue that such code can be interpreted directly by the Mathematica Kernel by pasting it into a Mathematica Notebook.

After the latter, I would offer the counterargument that before deciding to copy&paste code one needs to assess if the question deserves onesone's attention, and unreadable code doesn't allow that. The burden toon the community is too high.

The question

The previous discussion defines the ideal formatting but doesn't conclude what to do with the questions that are not in an ideal form. I am not aware of any consensus on where is the threshold that divides acceptable forms from not acceptable.

I'm looking for a community consensus on whether this form of code is:

  1. Acceptable and should be answered without complaints.
  2. Unacceptable and questions of this style should be either edited or closed.
  3. Some other alternatives.

Is unreadable valid code acceptable in Mathematica Stack Exchange?

The offence

There seem to be a significant amount of new people posting code that looks like this

(please edit this question and replace this line if you know how to technically describe this form of code)

a = (E^(-2 Abs[\[Gamma] - z Cos[\[Theta]]]^2) \!\(
\*UnderoverscriptBox[\(\[Sum]\), \(j = 0\), \(m\)]\(
\*UnderoverscriptBox[\(\[Sum]\), \(l = 0\), \(m\)]
\*FractionBox[\(1\), \(\(j!\)\ \(l!\)\)] Binomial[m, j]\ Binomial[m, l]\ 
\*SuperscriptBox[\(Conjugate[ z\ Sin[\[Theta]]\ Tan[\[Theta]]]\), \(j\)]\ 

Examples: 268606 268222 268172 267133

The solution

A solution exists in the answer posted by @m_goldberg, back in 2015. The code that looks good is the raw input form.

How to copy code from Mathematica so it looks good on this site

Basically:

Choose Convert To > Raw InputForm from the Cell menu or from the contextual (right mouse click) menu. Then Copy & Paste

Previous discussion

This Q&A addresses what formats are acceptable

What kind of Input and Output Code Styles are acceptable in SE?

The answer by moderator @rm-rf calls for

  1. One should be able to copy-paste-evaluate the code block in Mathematica.
  2. The code block should be as noise-free as possible.
  3. Do not use fancy typesetting in your code.
  4. Try to use sane and reasonable indenting/formatting.
  5. Also, try to avoid the code block scrolling sideways.
  6. Keep the code and variables minimal and simple

Strictly speaking, the form I'm complaining about does comply with point 1, and may comply with 5 and 6, but definitely fails in points 2, 3 and 4.

Opinions

Personally, I think it is NOT acceptable to share code that it's not human readable. Questions featuring such code should be corrected or closed.

Some people may disagree, and argue that such code can be interpreted directly by the Mathematica Kernel by pasting it into a Mathematica Notebook.

After the latter I would offer the counterargument that before deciding to copy&paste code one needs to assess if the question deserves ones attention, and unreadable code doesn't allow that. The burden to the community is too high.

The question

The previous discussion defines the ideal formatting but doesn't conclude what to do with the questions that are not in an ideal form. I am not aware of any consensus on where is the threshold that divides acceptable forms from not acceptable.

I'm looking for a community consensus on whether this form of code is:

  1. Acceptable and should be answered without complaints.
  2. Unacceptable and questions of this style should be either edited or closed.
  3. Some other alternatives.

Is unreadable valid code acceptable in Mathematica Stack Exchange?

The offence

There seem to be a significant amount of new people posting code that looks like this

a = (E^(-2 Abs[\[Gamma] - z Cos[\[Theta]]]^2) \!\(
\*UnderoverscriptBox[\(\[Sum]\), \(j = 0\), \(m\)]\(
\*UnderoverscriptBox[\(\[Sum]\), \(l = 0\), \(m\)]
\*FractionBox[\(1\), \(\(j!\)\ \(l!\)\)] Binomial[m, j]\ Binomial[m, l]\ 
\*SuperscriptBox[\(Conjugate[ z\ Sin[\[Theta]]\ Tan[\[Theta]]]\), \(j\)]\ 

Examples: 268606 268222 268172 267133

This String Based Input of Notebook Boxes, is normally created by using a palette or control keys. This form is interpreted by the Front-End without problems, but it is very hard to parse for humans. I call it unreadable.

The solution

A solution exists in the answer posted by @m_goldberg, back in 2015. The code that looks good is the raw input form.

How to copy code from Mathematica so it looks good on this site

Basically:

Choose Convert To > Raw InputForm from the Cell menu or from the contextual (right mouse click) menu. Then Copy & Paste

Previous discussion

This Q&A addresses what formats are acceptable

What kind of Input and Output Code Styles are acceptable in SE?

The answer by moderator @rm-rf calls for

  1. One should be able to copy-paste-evaluate the code block in Mathematica.
  2. The code block should be as noise-free as possible.
  3. Do not use fancy typesetting in your code.
  4. Try to use sane and reasonable indenting/formatting.
  5. Also, try to avoid the code block scrolling sideways.
  6. Keep the code and variables minimal and simple

Strictly speaking, the form I'm complaining about does comply with point 1, and may comply with 5 and 6, but definitely fails in points 2, 3 and 4.

Opinions

Personally, I think it is NOT acceptable to share code that it's not human readable. Questions featuring such code should be corrected or closed.

Some people may disagree, and argue that such code can be interpreted directly by the Mathematica Kernel by pasting it into a Mathematica Notebook.

After the latter, I would offer the counterargument that before deciding to copy&paste code one needs to assess if the question deserves one's attention, and unreadable code doesn't allow that. The burden on the community is too high.

The question

The previous discussion defines the ideal formatting but doesn't conclude what to do with the questions that are not in an ideal form. I am not aware of any consensus on where is the threshold that divides acceptable forms from not acceptable.

I'm looking for a community consensus on whether this form of code is:

  1. Acceptable and should be answered without complaints.
  2. Unacceptable and questions of this style should be either edited or closed.
  3. Some other alternatives.

Is unreadable valid code acceptable in Mathematica Stack Exchange?

added 305 characters in body
Source Link
rhermans
  • 37.8k
  • 13
  • 17
Loading
Became Hot Meta Post
added 234 characters in body
Source Link
rhermans
  • 37.8k
  • 13
  • 17
Loading
added 22 characters in body
Source Link
rhermans
  • 37.8k
  • 13
  • 17
Loading
Source Link
rhermans
  • 37.8k
  • 13
  • 17
Loading