Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re: An irrational coding choice found

by Anonymous Monk
on Apr 15, 2012 at 07:42 UTC ( #965138=note: print w/ replies, xml ) Need Help??


in reply to An irrational coding choice found

Have you ever made a coding choice that later you can not rationalize?

All the time, until I started using version control and reviewing my choices on a weekly , even daily basis ( refactoring ).

Its like when you first start writing code, you end up with 10-20 line if-blocks, 3-5-8 indentation levels deep, and it feels very comfortable because its all very fresh in your mind.

It's not until you're forced to revisit that code a year later that you realize how difficult it is to read, and start turning each long if-block (or indentation level ) into a function (refactoring).

schwern has a slideshow about this skimmable code where he tackles refactoring WWW::Mechanize

There is also a shorter version of the skimmable code talk, in the longer version he subliminally introduces Method::Signatures


Comment on Re: An irrational coding choice found

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others studying the Monastery: (11)
As of 2015-07-30 08:37 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (270 votes), past polls