Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris

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 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

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 or How to display code and escape characters are good places to start.
Log In?

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

How do I use this? | Other CB clients
Other Users?
Others imbibing at the Monastery: (1)
As of 2021-10-26 00:00 GMT
Find Nodes?
    Voting Booth?
    My first memorable Perl project was:

    Results (90 votes). Check out past polls.