in reply to Re: PBP: Code Layout
in thread PBP: Code Layout

I have actually recommended that we make a nice perltidy config and apply it to all files when they are checked into CVS. The problem here is that there is now a disconnect between what you just wrote yesterday and what you are editing today. I think coding standards are important in the context of a development team because people tend to get more done when they don't have to spend extra time deciphering yet another individual coding style. For example, we've got numerous styles running rampant:
if($this) { do_that(); # Pretend this is indented with a tab } if ( $this ) { do_that(); # another tab } if($this) { do_that(); } if($this) { do_that(); } if($this) { do_that(); } if($this) { do_that(); }
And that's only the if statements! And some people use 4 spaces and some use 2. Of course, they become harder to read with more complex statements:
if($this) { do_that(); eval { do_something(); }; if($something_else) { here_we_go(); } }

Replies are listed 'Best First'.
Re^3: PBP: Code Layout
by Skeeve (Parson) on Oct 19, 2005 at 22:43 UTC

    The problem here is that there is now a disconnect between what you just wrote yesterday and what you are editing today

    Personally I wouldn't care! If the formatting is there so that everyone understands the code more easily, then fine! I should understand my code also. If not, I programmed something so obfuscated, I should rethink it ;-) and that's a positive side effect of the tidy process, don't you agree?

    I'd still (even if I get downvoted more) prefer my own "style" over any company dictated one because I don't want to focus un bureaucraccy ;-) (I'm exaggerating). Let the perltidy do it's work and I will be happy.


    s$$([},&%#}/&/]+}%&{})*;#$&&s&&$^X.($'^"%]=\&(|?*{%
    +.+=%;.#_}\&"^"-+%*).}%:##%}={~=~:.")&e&&s""`$''`"e
      I'd still (even if I get downvoted more) prefer my own "style" over any company dictated one because I don't want to focus un bureaucraccy

      I didn't downvote you, but I find it pretty shocking that you would rather go your own way than follow team guidelines. No matter how well he or she codes, I wouldn't want someone with that kind of attitude on my team.

        No matter how well he or she codes, I wouldn't want someone with that kind of attitude on my team.

        Ditto. The fact that I've been wasting large chunks of my time dealing with somebody's bizarre idea of naming conventions this week just emphasises the point.

        We're just talking about code formatting, don't we? Taking care of formatting - if it's not the same I got used to in the last 24 years - is most certainly a hindrance to me and I believe to anyone with long programming history.

        So if your goal is to have nice looking code and not to have good code, then maybe you're right and I really wouldn't fit into such a team.

        If we're not talking about code formatting but what to use for programming, which module or even which language, it's another story. For example: I still don't like Java. But our programm is written in Java and I have written a big part of it. With my own code layout of course ;-)

        The funny part about my Java is: A colleague said, that my Java code still looks like Perl. But that's just because one method he uses consists of 5 or so regular expressions, I think.


        s$$([},&%#}/&/]+}%&{})*;#$&&s&&$^X.($'^"%]=\&(|?*{%
        +.+=%;.#_}\&"^"-+%*).}%:##%}={~=~:.")&e&&s""`$''`"e
          A reply falls below the community's threshold of quality. You may see it by logging in.
        No matter how well he or she codes, I wouldn't want someone with that kind of attitude on my team.

        Physician, heal thy self!


        Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
        Lingua non convalesco, consenesco et abolesco. -- Rule 1 has a caveat! -- Who broke the cabal?
        "Science is about questioning the status quo. Questioning authority".
        The "good enough" maybe good enough for the now, and perfection maybe unobtainable, but that should not preclude us from striving for perfection, when time, circumstance or desire allow.
Re^3: PBP: Code Layout
by herveus (Prior) on Oct 20, 2005 at 12:12 UTC
    Howdy!

    That's a risky suggestion. Far safer is to insist the people run that standard perltidy pass, and then make sure their code still passes its tests.

    It is possible that perltidy could break code when it reformats it, so ensuring that it still passes all its tests (or at least all the tests it passed before) is important, and having it happen automagically on check-in runs the risk of overlooking that effect while it is easy to undo.

    yours,
    Michael