Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??

"How can I re-use this?" is something that I'm trying to make a mantra, especially after reading through The Pragmatic Programmer a couple of times. Modular, orthogonal code is a Good Thing.

Not really a mantra, but one concept that's stuck with me pretty much forever is the idea of conservation of difficulty, which was introduced to me by one of my profs in an intro programming course. The idea is that every problem has a set difficulty, and making some part of the solution easy (writing hacked-up, off-the-cuff code, for instance) will make another part difficult (debugging). Sometimes, the tradeoffs between easy and difficult are political at best (doing the hard bit when nobody's looking, and saving the easy finishing touches for when your boss shows up), but (here's the tie-in with reusable, orthogonal code) often you can do the difficult bits of many problems once -- by writing a module to do something clever that relates to a bunch of your problems, or spending an hour or two putting together a really elegant interface to a function you'll call a lot, for instance.

"How am I going to debug this?", and it's friend "How am I going to test this?", are ones that I should keep in mind, though.

--
:wq

In reply to Re: Programming Mantras by FoxtrotUniform
in thread Programming Mantras by dws

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

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

How do I use this?Last hourOther CB clients
Other Users?
Others having a coffee break in the Monastery: (4)
As of 2024-03-29 09:40 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found