23

I made this question asking if it is possible to recover the source code of a pure JavaScript function. I have the answer to the question now, i.e., I have a code that (I believe) works in all cases (which I already edited on the question). Now, I want to ask a similar question: how can this function be optimized? For example, I'd want to know if that kind of tree-mashing concatenations could be improved (with a Rope structure, perhaps), or if it would be wasteful (maybe JS engines already implement fast concatenation).

How do I proceed? Do I edit that question to become the new one I want to ask? Do I delete this and create a new one (perhaps on Code Review SO)? Or do I answer my own question and create a new one?

4
  • 38
    If you've got a new question (optimization) as a result of the old question (debugging), then ask a new question! The new question probably fits better at Code Review as well. I normally encourage separate questions for little things, so I'm passing this on to you too :)
    – Zizouz212
    Oct 13, 2015 at 1:24
  • 1
    It doesn't sound like a similar question at all, one is asking how to do something, and the other is asking for advice. In this current question, your answer looks like it should be an edit to your question, but even then its unclear what kind of an answer you're looking for.. is it to get your code fixed or are you looking for an alternative approach?
    – Sayse
    Oct 13, 2015 at 7:12
  • 2
    As Zizouz212 said, that question would probably be a good one to ask on Code Review Stack Exchange.
    – Pokechu22
    Oct 13, 2015 at 13:45
  • 4
    You can always link to the older question from a new one.
    – choroba
    Oct 13, 2015 at 14:13

1 Answer 1

50

Your first question was asking how to determine some source code, which is a very specific question. Now you are asking for advice on optimisation of source code, which is an entirely different question.

Since the two questions have nothing in common besides that one is a result of the other, I would, in your instance, simply open a new question.

P.S: Code optimization might fit better on CodeReview than on StackOverflow.

2
  • 9
    I agree but want to add that if you post two different questions that revolve around the same code, it is always nice to add mutual links to them.
    – 5gon12eder
    Oct 15, 2015 at 11:27
  • @5gon12eder Or at least add a link to the older one on the newer one. As long as one of the questions references the other, both of them will automatically have a link to the other on the 'linked questions' list on the right side.
    – reirab
    Oct 15, 2015 at 20:37

You must log in to answer this question.

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