why code optimisation is not done with source code?

Discussion in 'Programming' started by dpkrulz, Sep 3, 2010.

  1. #1
    we all know that code optimization in most of the languages is done after the intermediate code. i wanted to ask what are the drawbacks or we can say why it is not beneficial to perform code optimization in the early stages of a program/software development.
     
    dpkrulz, Sep 3, 2010 IP
  2. jizzhack

    jizzhack Peon

    Messages:
    27
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Optimized code is typically harder to read and change then un-optimized code. If the code is harder to read then it's harder to track down bugs. If it's harder to rewrite then it's harder to alter/add/remove features. Finally the vast majority of code 'optimizations' that people do don't really make any difference. Typically your loosing a large amount of maintainability for a pitiful amount of performance.
     
    jizzhack, Sep 4, 2010 IP
  3. sketerpot

    sketerpot Peon

    Messages:
    5
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Also, the majority of compiler optimizations are difficult to write so that they operate at the level of the abstract syntax tree.

    Focus on getting your programs to work correctly.
     
    sketerpot, Sep 7, 2010 IP