Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid

Re^2: CPAN's perltidy to the rescue! (not for 'standards')

by topher (Scribe)
on Jul 15, 2012 at 05:50 UTC ( #981882=note: print w/replies, xml ) Need Help??

in reply to Re: CPAN's perltidy to the rescue! (not for 'standards')
in thread CPAN's perltidy to the rescue!

I'm a huge fan of perltidy. At work, I pushed us to institute a policy where all code is run through perltidy before being checked in. The reason isn't that I want to enforce my views or standards on code style, but because many of my coworkers either follow no consistent style, or because they use very odd styles that are rarely seen in Perl (a couple of them have more experience programming in other languages, and they write their Perl as if it were Java or C++).

Alternately, there's also a guy at work who likes to write code in a window that's 150 characters wide. As a result, he writes a ton of really long lined code. For those of us who do a lot of maintenance work on our code, frequently working in vi on a 80x24 console window, it's a huge pain to deal with.

Life is *much* better since that policy was put into place.

But, here's the thing. I use perltidy constantly even on my own code. It gives me the freedom to not worry about formatting when I'm writing or editing my code. If I wrap something in a new block, I'm not going to bother reindenting a bunch of code. I'm just going to run perltidy on it. Line up a list of things? Why waste the time? Same thing with lining up comments, and so many other things.

Remember, one of the keys to a good programmer is laziness. I love being able to write my code with a lazy style. perltidy cleans up after it, so I don't have to.

  • Comment on Re^2: CPAN's perltidy to the rescue! (not for 'standards')

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://981882]
[marto]: yikes
[marto]: and this is a bank you say?

How do I use this? | Other CB clients
Other Users?
Others musing on the Monastery: (11)
As of 2018-01-23 16:56 GMT
Find Nodes?
    Voting Booth?
    How did you see in the new year?

    Results (250 votes). Check out past polls.