Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

7
  • I'm going ahead and accepting this one because of the "write first optimize later" principle you mentioned, and the Knuth quote. Sometimes I forget Commented Oct 29, 2014 at 22:16
  • 4
    I am surprised you brought out this old chestnut. You didn't even write the whole quote (it does matter), nor did you factor in sensible design decisions that should be made at the very beginning, like choosing the correct data structures having the appropriate performance characteristics for your particular programming task. That's not premature optimization; it's just sensible design. Writing slow code because you don't know simple performance optimizations that may actually enhance readability is not avoiding premature optimization; it's just a lack of education. Commented Oct 30, 2014 at 15:40
  • The question is about priorities, not the entire design process. (Although a specific question about "which is clearer, an object-method or multiple scalar-methods" would be interesting, as either Java or OOP specific.) Commented Oct 30, 2014 at 15:46
  • 2
    Then don't call it design. Call it "I pick the right data structures because I know what I'm doing." Call it "I write reasonably fast code from the beginning, because I know what I'm doing." Knuth's quote was always directed at the folks who don't understand what the 3 percent is (the part of the quote that you omitted), not the folks who are building adequate performance into their programs from the beginning, without using overly obtuse techniques. Commented Oct 30, 2014 at 15:49
  • 2
    c2.com/cgi/wiki?PrematureOptimization Commented Oct 30, 2014 at 16:19