Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re: (OT) Editor-neutral code formatting

by dorko (Prior)
on Feb 07, 2002 at 03:51 UTC ( #143785=note: print w/replies, xml ) Need Help??


in reply to (OT) Editor-neutral code formatting

Ovid,

++ to you for saving my sanity. That's just about exactly the format I use to code. I don't think I've ever seen anyone format quite like I do.

The only thing I do differently is to keep the braces in-line with the block that surrounds them (indenting them all) like so:


sub_connect 
       {
       my %conn_data  = @_;
       my $dbh = DBI->connect(
                $conn_data{ data_source }, 
                $conn_data{ user }, 
                $conn_data{ pass },
                        {
                        RaiseError  => 1,
                        AutoCommit  => 0,
                        LongReadLen => 65_634
                        } 
                ) or die DBI->errstr;
        $dbh;
        }

I like the way this quickly delineates function definitions and gives the reader a bird's eye view of the major chunks of code.

Cheers!

Brent

  • Comment on Re: (OT) Editor-neutral code formatting

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others studying the Monastery: (5)
As of 2022-01-21 08:45 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    In 2022, my preferred method to securely store passwords is:












    Results (57 votes). Check out past polls.

    Notices?