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

Comment on

( #3333=superdoc: print w/ replies, xml ) Need Help??
Let me start by saying that I think you are at the right place (PerlMonks!) to find out answers & gather opinions about coding styles and what's new in the Perl world. You could even extend out to blogs, subscribe to Perl Weekly, or just keep an eye on what's just been released on CPAN (enable your CPAN nodelet under Nodelet Settings).

It's best if you trim your question on a particular style down to a simple SoPW post. Monks have varying opinions and perspectives, and sometimes the discussions will fill up the thread significantly. Better yet, search perlmonks.org for the question you're about to ask - many times I have found another monk has already asked the same thing. You could also post your code somewhere public (maybe on your PerlMonks scratchpad), and then have a link to it - but you may be creating more barrier with it being tl;dr.

So you've asked your question about 'style' and got answers. Maybe too many opinionated answers. I feel that the key to learning about recent 'styles' + new ways of doing things is to fully understand the shortcomings of the past and why people do it the new way. If you can gather the development motivation for, say, a new syntax for declaring constants, then it gives you a glimpse at the reason for the 'style' transition (i.e. peruse perldeltas/changelogs). Once you know why, then ask yourself whether the new way helps you. It it doesn't help, drop it; next question! Remember, form your own conclusions.

With all that said, now I'll attempt at bombarding you with my opinions about the questions you've asked so far :-)

    As I pointed out, perlbool teaches people who want to learn object oriented programming to use var and use @ISA. If I look at Perldoc, there's use parent.

parent is newest, lightweight, and recommended. I highly recommend reading the excellent latest Perl OOP tutorial by Dave Rolsky which explains OOP from the basics with modern Perl in mind.

    I've gone from the age of ... from procedural to object oriented Perl. ... You're not even suppose to use @EXPORT_OK. Instead, your code is suppose to be object oriented.

You make it seem as though object-oriented is an evolution of procedural programming in the Perl world. I disagree. They're two distinct techniques that have their own merits; one won't replace the other. For me, I'd code my directory tools and throwaway scripts procedurally. Once I start to see the possibility of many functions acting on a single type of data, I'd consider whether it'd be worth switching to OO.

    However, should I make sure my code works with earlier versions of Perl? Are there still a lot of people out on Perl 5.6?

Your module requirement of 5.8.8 is absolutely fine. If you can support Perl 5.6, then great! There would always be people on ancient versions, but consider that most *nix OS distros are shipping "modern enough" versions of Perl (my guess: 5.10 and above). My gut feel is to draw the line right around Perl 5.8; that is, if you have to break your backbone to support 5.6, not worth the pain at all. Disclaimer: this is a moving gut feel.

    Are vstrings still used?

I don't see much of that anymore. AFAIK, the recommendation is to use a float with 6 decimal places. You should highly consider your module for semantic versioning.

    camelCase vs underscore_variables; for(;;) vs while (1) vs while ()

It doesn't matter. Pick the one you like stylistically and be consistent.


In reply to Re: In Need of Mentoring by repellent
in thread In Need of Mentoring by qazwart

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



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • Outside of code tags, you may need to use entities for some characters:
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.
  • Log In?
    Username:
    Password:

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

    How do I use this? | Other CB clients
    Other Users?
    Others musing on the Monastery: (4)
    As of 2014-09-20 05:29 GMT
    Sections?
    Information?
    Find Nodes?
    Leftovers?
      Voting Booth?

      How do you remember the number of days in each month?











      Results (153 votes), past polls