Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??

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.


In reply to Re^2: CPAN's perltidy to the rescue! (not for 'standards') by topher
in thread CPAN's perltidy to the rescue! by tfredett

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others lurking in the Monastery: (6)
As of 2024-03-28 22:50 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found