Skip to main content
replaced http://stackoverflow.com/ with https://stackoverflow.com/
Source Link

Recently I noticed a question where a long time user edit the void main() in the OP's code to int main(). I left a comment asking how did he know that is not using void main()? I got a reply back from the editor

[...]It would be really bad teaching to let it pass by in SO example code (except where it is the point of the code), so please do fix that wherever you see it.[...]

Now I get that void main() is not standard in C++, it never has been and I do not think it ever will be. I personally point that out to the OP in a comment and normally I link to What should main() return in C and C++?What should main() return in C and C++?. The editor did have that in their comment

You might also admonish the OP about it. When you have the time.

Which I agree with but if the code is changed to int main() then the comment looks out of place as there is no void main() in the code anymore.

So do we really want to change the OP's code in this case or should we leave it alone and politely inform the user that they should not be using void main()?

I disagree with the dupe closure. The dupe states that the edit should not change the intent of the OP. That is what I am trying to figure out in this question. Does changing void main() to int main() which has no effect on the code except to make it compile on compliant compilers changing the intent or not and if it does not then should we still do it or not.

Recently I noticed a question where a long time user edit the void main() in the OP's code to int main(). I left a comment asking how did he know that is not using void main()? I got a reply back from the editor

[...]It would be really bad teaching to let it pass by in SO example code (except where it is the point of the code), so please do fix that wherever you see it.[...]

Now I get that void main() is not standard in C++, it never has been and I do not think it ever will be. I personally point that out to the OP in a comment and normally I link to What should main() return in C and C++?. The editor did have that in their comment

You might also admonish the OP about it. When you have the time.

Which I agree with but if the code is changed to int main() then the comment looks out of place as there is no void main() in the code anymore.

So do we really want to change the OP's code in this case or should we leave it alone and politely inform the user that they should not be using void main()?

I disagree with the dupe closure. The dupe states that the edit should not change the intent of the OP. That is what I am trying to figure out in this question. Does changing void main() to int main() which has no effect on the code except to make it compile on compliant compilers changing the intent or not and if it does not then should we still do it or not.

Recently I noticed a question where a long time user edit the void main() in the OP's code to int main(). I left a comment asking how did he know that is not using void main()? I got a reply back from the editor

[...]It would be really bad teaching to let it pass by in SO example code (except where it is the point of the code), so please do fix that wherever you see it.[...]

Now I get that void main() is not standard in C++, it never has been and I do not think it ever will be. I personally point that out to the OP in a comment and normally I link to What should main() return in C and C++?. The editor did have that in their comment

You might also admonish the OP about it. When you have the time.

Which I agree with but if the code is changed to int main() then the comment looks out of place as there is no void main() in the code anymore.

So do we really want to change the OP's code in this case or should we leave it alone and politely inform the user that they should not be using void main()?

I disagree with the dupe closure. The dupe states that the edit should not change the intent of the OP. That is what I am trying to figure out in this question. Does changing void main() to int main() which has no effect on the code except to make it compile on compliant compilers changing the intent or not and if it does not then should we still do it or not.

Post Reopened by NathanOliver, jscs, Brad Larson discussion
Post Closed as "Duplicate" by Peter Duniho, Luke, Glorfindel, HaveNoDisplayName, ketan
added 368 characters in body
Source Link
NathanOliver
  • 179.4k
  • 8
  • 109
  • 145

Recently I noticed a question where a long time user edit the void main() in the OP's code to int main(). I left a comment asking how did he know that is not using void main()? I got a reply back from the editor

[...]It would be really bad teaching to let it pass by in SO example code (except where it is the point of the code), so please do fix that wherever you see it.[...]

Now I get that void main() is not standard in C++, it never has been and I do not think it ever will be. I personally point that out to the OP in a comment and normally I link to What should main() return in C and C++?. The editor did have that in their comment

You might also admonish the OP about it. When you have the time.

Which I agree with but if the code is changed to int main() then the comment looks out of place as there is no void main() in the code anymore.

So do we really want to change the OP's code in this case or should we leave it alone and politely inform the user that they should not be using void main()?

I disagree with the dupe closure. The dupe states that the edit should not change the intent of the OP. That is what I am trying to figure out in this question. Does changing void main() to int main() which has no effect on the code except to make it compile on compliant compilers changing the intent or not and if it does not then should we still do it or not.

Recently I noticed a question where a long time user edit the void main() in the OP's code to int main(). I left a comment asking how did he know that is not using void main()? I got a reply back from the editor

[...]It would be really bad teaching to let it pass by in SO example code (except where it is the point of the code), so please do fix that wherever you see it.[...]

Now I get that void main() is not standard in C++, it never has been and I do not think it ever will be. I personally point that out to the OP in a comment and normally I link to What should main() return in C and C++?. The editor did have that in their comment

You might also admonish the OP about it. When you have the time.

Which I agree with but if the code is changed to int main() then the comment looks out of place as there is no void main() in the code anymore.

So do we really want to change the OP's code in this case or should we leave it alone and politely inform the user that they should not be using void main()?

Recently I noticed a question where a long time user edit the void main() in the OP's code to int main(). I left a comment asking how did he know that is not using void main()? I got a reply back from the editor

[...]It would be really bad teaching to let it pass by in SO example code (except where it is the point of the code), so please do fix that wherever you see it.[...]

Now I get that void main() is not standard in C++, it never has been and I do not think it ever will be. I personally point that out to the OP in a comment and normally I link to What should main() return in C and C++?. The editor did have that in their comment

You might also admonish the OP about it. When you have the time.

Which I agree with but if the code is changed to int main() then the comment looks out of place as there is no void main() in the code anymore.

So do we really want to change the OP's code in this case or should we leave it alone and politely inform the user that they should not be using void main()?

I disagree with the dupe closure. The dupe states that the edit should not change the intent of the OP. That is what I am trying to figure out in this question. Does changing void main() to int main() which has no effect on the code except to make it compile on compliant compilers changing the intent or not and if it does not then should we still do it or not.

edited body
Source Link
NathanOliver
  • 179.4k
  • 8
  • 109
  • 145

Recently I noticed a question where a long time user edit the void main() in the OP's code to int main(). I left a comment asking how did he know that is not using void main()? I got a reply back from the editor

[...]It would be really bad teaching to let it pass by in SO example code (except where it is the point of the code), so please do fix that wherever you see it.[...]

Now I get that void main() is not standard in C++, it never has been and I do not think it ever will be. I personally point that out to the OP in a comment and normally I link to What should main() return in C and C++?. The editor did have that in their comment

You might also admonish the OP about it. When you have the time.

Which I agree with but if the code is changed to int main() then the comment looks out of place as there is no void main() in the code anymore.

So do we really want to change the OP's code in this case or should we leave it alone and politely inform the user in the incorrectness ofthat they should not be using void main()?

Recently I noticed a question where a long time user edit the void main() in the OP's code to int main(). I left a comment asking how did he know that is not using void main()? I got a reply back from the editor

[...]It would be really bad teaching to let it pass by in SO example code (except where it is the point of the code), so please do fix that wherever you see it.[...]

Now I get that void main() is not standard in C++, it never has been and I do not think it ever will be. I personally point that out to the OP in a comment and normally I link to What should main() return in C and C++?. The editor did have that in their comment

You might also admonish the OP about it. When you have the time.

Which I agree with but if the code is changed to int main() then the comment looks out of place as there is no void main() in the code anymore.

So do we really want to change the OP's code in this case or should we leave it alone and politely inform the user in the incorrectness of using void main()?

Recently I noticed a question where a long time user edit the void main() in the OP's code to int main(). I left a comment asking how did he know that is not using void main()? I got a reply back from the editor

[...]It would be really bad teaching to let it pass by in SO example code (except where it is the point of the code), so please do fix that wherever you see it.[...]

Now I get that void main() is not standard in C++, it never has been and I do not think it ever will be. I personally point that out to the OP in a comment and normally I link to What should main() return in C and C++?. The editor did have that in their comment

You might also admonish the OP about it. When you have the time.

Which I agree with but if the code is changed to int main() then the comment looks out of place as there is no void main() in the code anymore.

So do we really want to change the OP's code in this case or should we leave it alone and politely inform the user that they should not be using void main()?

Source Link
NathanOliver
  • 179.4k
  • 8
  • 109
  • 145
Loading