6
\$\begingroup\$

https://codereview.stackexchange.com/q/106028/56262

I do have three upvotes, but I still can't quite decide if I chose the correct place to ask this question, since my own solution doesn't feel quite "final" enough to me, I'm wondering if what I'm asking is really "Code Review".

I feel the upvotes could have simply been because of the effort I put in describing the issue and how I described what I'm trying to do, rather than because the question is good for this site.

I was first going to place the question on the Physics stack exchange, but it became dependent on my code. I considered the main SO site, but decided to to post it here because it comes off as "How can I improve my code", which does seem like what this site handles, except for what I mentioned before - it isn't really "final" code I'm showing.

Is this the best place for it? At what point is the line drawn between a question about "pseudo-code" (should be asked elsewhere), and a question about "Let's improve this code"?

\$\endgroup\$
  • \$\begingroup\$ Code that you have worked on to an extent where you are unsure of how to improve it, as long as it works, it suitable for code review. Code Review is all about making working code into better code. Since you removed your question, I can't comment on that but from the answers given, it sounds like it was indeed suitable for CR. \$\endgroup\$ – psychedelic_alex Oct 3 '15 at 0:55
9
\$\begingroup\$

it isn't really "final" code I'm showing.

It seems to be "final enough" to be reviewable. (Is code ever "final"?)

Is this the best place for it?

The best place? Depends on what kind of answers you are primarily looking for. On Code Review, we have a policy that answers may touch on any aspect of your code. So you might end up with an answer that only mentions your variable naming, for example. But another answer might answer your specific question that you want answered.

Depending on how you formulate the question, it could potentially fit also at Mathematics, or Physics, and other related Stack Exchange sites. Those kind of sites would not be very interested in your code, but more about your calculations / a description of your approach.

At what point is the line drawn between a question about "pseudo-code" (should be asked elsewhere), and a question about "Let's improve this code"?

This is a hard line to specify exactly where it is, it is mostly determined on a case-to-case basis. Generally, avoiding placeholder comments and obfuscated variable names such as someVar is a good indication that it is not pseudo-code.

\$\endgroup\$
3
\$\begingroup\$

tl;dr, Yes

Yes, I think that your question is perfectly fine. You have working, non-pseudo-code that is (presumably) your own, and you appear to be asking for improvements to it. This is what Code Review is all about.

If you're asking this because it doesn't have any answers, don't worry. It sometimes takes a little longer than other Stack Exchange sites to get an answer, but I wouldn't let that deter you. ;-)

\$\endgroup\$
  • 1
    \$\begingroup\$ It looks like it should work - it did start as psuedo-code which I just added float to for variables - but as a whole it will not run because I do skip splitting the distanceTraveledOverAcceleration into the X and Y pieces used in setting the position, because I'm lazy. Does this one small thing completely change your answer and require me to update the question? \$\endgroup\$ – DoubleDouble Sep 29 '15 at 19:06
  • 2
    \$\begingroup\$ @DoubleDouble When asking Code Review questions, please don't be lazy. I'd highly recommend to add the code to do the actual splitting of that variable. \$\endgroup\$ – Simon Forsberg Sep 29 '15 at 19:13
  • \$\begingroup\$ @SimonForsberg okay, I did update it - thank you \$\endgroup\$ – DoubleDouble Sep 29 '15 at 21:47
2
\$\begingroup\$

It looks perfectly fine to me. It's code you wrote yourself, it's actual code instead of pseudo code and it does work as intended. Now you want to see if you could've done anything better to improve the quality of your code.

That's what we're all about :-)

\$\endgroup\$

You must log in to answer this question.

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