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

comment on

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

reuzam, isn't it amazing how much energy a simple thank you can create - LOL!

I also am a strong proponent of using perltidy. I have been cranking perl code since version 2.0 came out - I guess that makes me a dinosaur. Over the years, I have used a whole bunch of different development environments, tools and appraoches to perl and other languages. Without exception, I have returned to the following kit

  • vim/gvim
  • perl-support for vim
  • perltidy
  • perlcritic

I am not saying categorically that this is the best approach in the world, but it is best for me. As a younger code wrangler, I used to get very carried away with how code should be structured and formatted. I thought my ideas were the best, and often they were in the case in which we were working. I felt like my creativity was in how the code was structured and that code should be presented in its absolute best light. As I age, I come to realize that the best way to present good code is in the end result. All the rest is just hubris.

Results to me mean:

  • The delivered solution meets/exceeds users/consumers needs
  • The code is structured in a way that easily understood and adequately commented

While perltidy can't directly help with the former, it can be a great tool with the latter. perl-support in vim does a great job with syntax highlighting and helping me insure that all opening {[( are closed. While developing, I inherently tab here and there and do a bit of formatting; however, I don't sweat the formatting. Before each and every save, I \rs (compile the code to make sure my syntax is clean) and \ry (run perltidy from within vim) and then save.

I love that I don't spend practically "no" time worrying about formatting code. While I don't necessarily love every little thing about perltidy ( like the earlier comment on qw formatting ), overall it is great. I can readily see the structure and the flow of code -- it makes my visual cortex happy!

And one last thought, if you are arguiing about how code format interferes with your creativity, stop, get a drink, maybe an adult one, and reassess what creativity is and your ability to be creative;)

lbe


In reply to Re^2: CPAN's perltidy to the rescue! by learnedbyerror
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 cooling their heels in the Monastery: (8)
As of 2024-04-16 09:18 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found