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

Re^2: What's your programming style?

by syphilis (Archbishop)
on Dec 11, 2018 at 06:23 UTC ( [id://1227080]=note: print w/replies, xml ) Need Help??


in reply to Re: What's your programming style?
in thread What's your programming style?

return $Config{path_sep}

I don't think that's the "separator" the OP's code is looking for.
$Config{path_sep} returns the symbol that separates the pathnames in $ENV{PATH}, but I believe the OP's code is looking for the symbol that separates the individual directories within a pathname.

Cheers,
Rob

Replies are listed 'Best First'.
Re^3: What's your programming style?
by Anonymous Monk on Dec 12, 2018 at 21:10 UTC
    I don't think that's the "separator" the OP's code is looking for.

    OP is looking for style, not functionality. Document your subs!

      Agree that POD is a million times better than # Comments. POD inside the sub though is incredibly jarring to me. I don't even like it between subs. I like to wear one hat at a time and code and documentation are polar opposites to my creative flow and focus. I deeply appreciate Perl's flexibility with POD but I personally will always only put POD in the __END__ of packages and scripts. Like a manual for a car, I think the real documents should not even be attached. Comments are a fine substitute for things like # Oil or # + and # - engraved on a part though.

        I personally will always only put POD in the __END__ of packages and scripts
        Yes. In a module, I use POD (after __END__) for the user of the module and write comments (with the code) for the maintainer of the module. That is, I like to keep user and maintainer documentation separate.

        See also:

        POD inside the sub though is incredibly jarring to me.
        Amen.
        Agree that POD is a million times better than # Comments. POD inside the sub though is incredibly jarring to me. I don't even like it between subs. I like to wear one hat at a time and code and documentation are polar opposites to my creative flow and focus.

        I agree that embedding POD in subs is somewhat jarring (ugly) and sympathize with the desire to wear one hat at a time (because I too love to code, but hate writing documentation ;). I embed POD in subs to force myself to keep the code and docs in sync. Since they are adjacent to each other this chore becomes very convenient. I used to code first and document later but found it annoying having to decipher non-obvious code all over again resulting in vague documentation. I tend to understand the code perfectly when it's being written and find that to be the perfect time to write accurate documentation. Another benefit to this technique allows one to construct a built-in help system that can display the POD of a specific sub with an option to also dump the code for easy review.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1227080]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others sharing their wisdom with the Monastery: (3)
As of 2024-04-19 01:41 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found