Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re^6: Summing numbers in a file

by eyepopslikeamosquito (Archbishop)
on Jun 03, 2020 at 10:24 UTC ( [id://11117638]=note: print w/replies, xml ) Need Help??


in reply to Re^5: Summing numbers in a file
in thread Summing numbers in a file

Another important principle is this: Wherever possible, prefer compile-time errors to run-time errors.
Indeed. Finding errors earlier rather than later is a sound general principle in any programming language: it's listed as general guideline number seven at On Coding Standards and Code Reviews, for example. Though more common in C++, this principle applies to Perl as well - after all, using strict catches many typos at compile time rather than run time. Other Perl examples could be given, such as a hash reference catching an odd number of elements in an anonymous hash at compile time - mentioned here and in "Use a hash of named arguments for any subroutine that has more than three parameters" in Perl Best Practices.

As for who invented the find errors at compile time rather than run time meme, in addition to your citation of Scott Meyers in Effective C++, it's also listed as one of the 101 Guidelines in C++ Coding Standards by Alexandrescu and Sutter (2004), as described in this comparison of C++ Coding Standards with Perl Best Practices.

Log In?
Username:
Password:

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

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

    No recent polls found