Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked

Re: Re: Re: IYHO, what do you consider good code?

by theorbtwo (Prior)
on Jun 13, 2003 at 07:09 UTC ( #265600=note: print w/replies, xml ) Need Help??

in reply to Re: Re: IYHO, what do you consider good code?
in thread IYHO, what do you consider good code?

I could agree with that, if you put a ..."and comment on exactly why you don't". However, note that I specificly didn't say that every line of code must comply with every stricture and warning.

Warning: Unless otherwise stated, code is untested. Do not use without understanding. Code is posted in the hopes it is useful, but without warranty. All copyrights are relinquished into the public domain unless otherwise stated. I am not an angel. I am capable of error, and err on a fairly regular basis. If I made a mistake, please let me know (such as by replying to this node).

  • Comment on Re: Re: Re: IYHO, what do you consider good code?

Replies are listed 'Best First'.
Re: Re: Re: Re: IYHO, what do you consider good code?
by diotalevi (Canon) on Jun 13, 2003 at 23:27 UTC

    I find myself using strict less and less often but only in constrained circumstances. Small scripts, stub applications for CGI::Application, that sort of thing. If it fills half the screen its probably too long to write without strict. Maybe this just means a lot of my scripts are now less than half a page long, I'm not sure. I just know that it is occasionally easier to just throw caution to the wind. But then I am also very likely to make warnings fatal which for me is a stricter sort of strict - your code ends being *required* to operate on the data sanely or you fall over a fatal runtime error.

    Added text. I included an example of the sort of thing I'm thinking of. This could be written with strict but why bother? I also wrote Re: and another without strict or warnings. I added them on at the end just to keep the 'use strict'/warnings people happy.

    #!/usr/bin/perl -T BEGIN { $root = '/users/'; } use lib $root; use Camp; Camp::DataEntry ->new( TMPL_PATH => "$root/Tmpl/", PARAMS => { DBH_DSN => 'dbi:Pg:dbname=...', DBH_USER => '...', DBH_PASS => '...', DBH_OPT => { RaiseError => 1 } } ) ->run;

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://265600]
[pryrt]: 1nickt, sprintf "%.16e", $v will always give enough precision to see 1 ULP (the smallest fractional part) of a standard 64bit Perl NV*
[pryrt]: (*: for systems where $Config{nvsize}==8 )
[pryrt]: Thus, that's "enough precision" to tell the difference between 1.0 and 1.0+1ULP
[pryrt]: But in what circumstance does your problem arise? When, in Perl, does the integer 1 not work identically to the floating-point NV 1.0000000000000000 e0?

How do I use this? | Other CB clients
Other Users?
Others pondering the Monastery: (15)
As of 2017-05-24 19:13 GMT
Find Nodes?
    Voting Booth?