http://www.perlmonks.org?node_id=388474


in reply to Ninja style coding... is it bad?

Upon first reading this, I wondered how I would feel if someone found a mistake and surreptitiously fixed it without notifying me. Ninja coding seems to have a set of prior assumptions that I don't know if I agree with. Here's what comes to mind:

How would you feel if a CPAN maintainer liked your module a great deal, but found a small bug in it and changed it on the master repository without telling you? To many people coding is their craft and they are interested in producing good quality code. By not communicating possible errors to people you are essential stating "I, being the great coder in our group, have found several errors in your code. Instead of notifying you of these errors so you can be educated, it's easier for me to just fix things rather than tell you about them."

Depending on your situation, this might be a reasonable thing to do. If you're the lead programmer on a time-critical project, this may even be a good thing (at least in the short term). But I believe that fostering a programming environment of creativity in which people can learn from each other is good for everyone's coding, so in the long term you may want to rethink your ninja ways. By practicing better communication, you may teach your peers a thing or two (and perhaps even learn something yourself). If you demonstrate best practices of coding to those around you their "bad" coding style may be vanquished by your "good" coding style in time.

It's interesting that you're being assimilated by the bad code that you are fixing. I would say that one key to learning good style is communication, by reading books, talking to people, and understanding the concepts behind various styles of coding. Perhaps if you communicate better you would be a Zen Master, rather than a Ninja. :)

Replies are listed 'Best First'.
Re^2: Ninja style coding... is it bad?
by demerphq (Chancellor) on Sep 04, 2004 at 11:32 UTC

    With large projects working on each others code is essential. Programmers cant just drop their current project to fix a few minor thinkos in their code that are causing someone else problems. Programmers leave (and then become the instant cause of every bug and failure in the system :-) programmers drop projects, etc. While sometimes it rankles when it happens to your own code because you would have fixed it differently/better the fact is its almost inevitable with large code bases.

    A good example is PM. The code base here has had many authors, we cant stand around waiting for those authors to show up to fix bugs or extend the code. If they are here and can do the work needed then fine, otherwise the work must get done.


    ---
    demerphq

      First they ignore you, then they laugh at you, then they fight you, then you win.
      -- Gandhi