Clean code vs. efficiency

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • jeffc

    #16
    Re: Clean code vs. efficiency


    "Christophe r Benson-Manica" <ataru@nospam.c yberspace.org> wrote in message
    news:c7quih$1om $1@chessie.cirr .com...[color=blue]
    > Yesterday I changed some code to use std::vectors and std::strings
    > instead of character arrays. My boss asked me today why I did it, and
    > I said that the code looks cleaner this way. He countered by saying
    > that he was regarded the dyanamic allocation that C++ STL classes
    > perform as being very inefficient. He also said that he wasn't
    > particularly interested in clean code (!). My question to the group:
    > In what situations, if any, would you use fast but hackish C-style
    > code in favor of the convenient STL classes?[/color]

    Frankly, it sounds like your manager doesn't *really* know what he's talking
    about. There is far, far more money wasted on fixing and customizing and
    maintaining hard-to-read code than there is lost on inefficient code. Now
    it just could be that your compiler does a crappy job with these things and
    it is slow. But on the other hand, it still might not matter! (Does it
    really matter to the user if something takes .03 seconds or .01 seconds?)


    Comment

    • jeffc

      #17
      Re: Clean code vs. efficiency


      "Default User" <first.last@boe ing.com.invalid > wrote in message
      news:40A11BDD.6 AEFC0F3@boeing. com.invalid...[color=blue]
      > Karl Heinz Buchegger wrote:[color=green]
      > >
      > > Christopher Benson-Manica wrote:[color=darkred]
      > > >
      > > > Yesterday I changed some code to use std::vectors and std::strings
      > > > instead of character arrays. My boss asked me today why I did it, and
      > > > I said that the code looks cleaner this way. He countered by saying
      > > > that he was regarded the dyanamic allocation that C++ STL classes
      > > > perform as being very inefficient.[/color]
      > >
      > > Really?
      > > Has he tried it?
      > > Does he have some performance data?[/color]
      >
      > Since when does the boss have to prove things to subordinates?[/color]

      Who said his boss had to prove anything?


      Comment

      • Default User

        #18
        Re: Clean code vs. efficiency

        jeffc wrote:[color=blue]
        >
        > "Default User" <first.last@boe ing.com.invalid > wrote in message
        > news:40A11BDD.6 AEFC0F3@boeing. com.invalid...[color=green]
        > > Karl Heinz Buchegger wrote:[color=darkred]
        > > >
        > > > Christopher Benson-Manica wrote:
        > > > >
        > > > > Yesterday I changed some code to use std::vectors and std::strings
        > > > > instead of character arrays. My boss asked me today why I did it, and
        > > > > I said that the code looks cleaner this way. He countered by saying
        > > > > that he was regarded the dyanamic allocation that C++ STL classes
        > > > > perform as being very inefficient.
        > > >
        > > > Really?
        > > > Has he tried it?
        > > > Does he have some performance data?[/color]
        > >
        > > Since when does the boss have to prove things to subordinates?[/color]
        >
        > Who said his boss had to prove anything?[/color]

        Doesn't that flow from the questions I answered? What are those if not
        requests for proof?



        Brian Rodenborn

        Comment

        Working...