Become a fan of Slashdot on Facebook


Forgot your password?
User Journal

Journal npsimons's Journal: Profiling 3

No, not the racial kind. This has to do with code efficiency. I was recently writing patch acceptance guidelines, and was trying to explain that maintainability matters far more than efficiency. I was trying to be polite about people who harp on "efficiency", but my basic feelings boil down to: "People who talk about software efficiency, yet aren't familiar with software profiling, are idiots." Discuss.

This discussion has been archived. No new comments can be posted.


Comments Filter:
  • I've seen code written for "maintainability" that ended up so complex it couldn't be maintained anyway.

    I've seen code so efficient, that it can't be ported even to the next generation CPU because it depended on bugs that no longer exist in the microcode.

    I say, far better than arguing between efficiency and maintainability, is KISS- keep it simple stupid.

    If you have a function that runs over a page of printout, it needs to be broken up into sub functions.

    If you're using inheritance, also use comments to keep

    • by npsimons ( 32752 )

      I say, far better than arguing between efficiency and maintainability, is KISS- keep it simple stupid.

      There are some (myself included) that would argue that simple code is more readable *and* generally easier for compilers to optimize. Therefore, I would agree that the KISS principle should reign supreme.

      Then there are some I've gotten into arguments with (the aforementioned "efficiency experts" who have never heard of profiling) who think that tweaking variables and unrolling loops by hand will make a pie

      • Inlining is only more efficient if you're only calling a function from a single place. Otherwise the maintenance hit will far outweigh the efficiency you'll get in code.

        I'm currently stuck in exactly such a project- one where an addiction to XML and inheritance has made the code all but unmaintainable. And worse yet, the company I'm contracting with refuses to give me more than 20 hours a week to work on it.

What is algebra, exactly? Is it one of those three-cornered things? -- J.M. Barrie