2

This question: https://stackoverflow.com/questions/15369280/java-vs-php-for-parsing-html-pages#comment21718238_15369280 got 6 downvotes within a couple of minutes, and is now closed.

I guess the main contributing factor was that the title reads like a "x vs. y" question: is Java faster than PHP for parsing some massive XML files?

However, what the OP really wanted to know is whether Java has some built-in characteristics that make parsing large amounts of XML in it inherently faster, like threading. He appears to know what he's doing and he's unhappy about his library's overall performance.

I tend to think that's a fair question and shooting it down like this was a little premature. Or was it? Is it too broad either way? How should it have been put to have a better chance?

Either way - what should the OP do? I guess at -6, the question is not really salvageable. He should definitely add some stats to beef things up. Anything else? Was the question rightly downvoted and closed? Should they open a new one?

Should this be asked on Programmers instead?

10
  • 1
    The whole question reads like x vs y. And even with figures to back up the PHP claim, it would still be x vs y. So if anything he should steer away from that I'd say. Then how to formulate it with a Java focus without it getting to be "not constructive"...pfff...
    – Bart
    Mar 12, 2013 at 19:12
  • 1
    Not much to do here, you're asking to replace "X vs. Y" with "list the things that I can use in this vague situation I've described." That's not an improvement. And no, not on Programmers.
    – casperOne
    Mar 12, 2013 at 19:12
  • 1
    I don't think it fits on SO( better on programmers.SO ), but I also don't think it deserves -6 vote score. It bugs me a little that a well-phrased, intelligent sounding question gets such a low score. Somebody decided to take it from -4 to -5 , and I'm curious.. why? Close and be done with it.. Mar 12, 2013 at 19:14
  • 3
    P.s. I note that there are some reopen votes coming in for that question. If you feel that it should be reopened in its current form, by all means vote accordingly. But it might be better to address the obvious issues first. Otherwise it might well end up being closed again before you know it. :s
    – Bart
    Mar 12, 2013 at 19:14
  • @Bart yeah. I do have criticism about the question - it's definitely too vague as it's not even mentioning the library that's being used on the PHP end. Still, it was dealt with too harshly
    – Pekka
    Mar 12, 2013 at 19:15
  • 2
    In its current rendition, it's very much NARQ. I appreciate the OP taking the time to write something well, but in the end, all the good writing in the world can't compensate for a question that simply doesn't fit on the site.
    – casperOne
    Mar 12, 2013 at 19:27
  • 1
    @casper yeah. What irks me is that the question could be put in a form that would likely fly, just by changing the wording a bit and adding a couple of specifics... but the OP indicated he doesn't want to change it so it's probably going to stay where it is.
    – Pekka
    Mar 12, 2013 at 19:28
  • 1
    My impression is that the OP is asking the wrong question, and that the programming language is the wrong level to ask about. I always prefer to state questions as problems, and asking how to solve this problem. The part about parallelising would make a fine question I think, but the existing one is written in a problematic way, and also doesn't seem to be fixable by anyone else except the original author. Mar 12, 2013 at 20:08
  • 3
    Rookie mistake. When you ask "[x] sucks, can [y] do better?" then never tag that question with [x]. Way too many SO users like [x] and will find fault with just about anything. Not that hard to find in that question either. Mar 12, 2013 at 21:34
  • @Uphill heh, hadn't though of it that way - makes sense :)
    – Pekka
    Mar 12, 2013 at 21:48

1 Answer 1

5

My interpretation of the post is that the OP has a PHP solution for parsing and analyze HTML files. The existing solution is functionally correct (I infer), but is too slow.

For some reason (it's not clear to me why, even though multi-threading was mentioned) the OP considered Java as an alternative solution.

My suggestion would be for the OP to

  1. Provide more detail about the current solution. (Did he write his own code? Is he using XYZ framework?)
  2. Provide a more specific performance benchmark, including what is considered "acceptable" or "slow"
  3. Explain what he has tried so far to improve the performance.
  4. Ask something like, "How would I improve the performance of my code? Or, have I reached the limits of what is possible in PHP which would mean that I should look at other languages/environments?"
  5. If there is more to the story of why the OP considered Java, explain that too.

You must log in to answer this question.

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