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

Re^3: Questions from "Coders at Work"

by roboticus (Canon)
on Oct 19, 2009 at 15:25 UTC ( #802013=note: print w/ replies, xml ) Need Help??


in reply to Re^2: Questions from "Coders at Work"
in thread Questions from "Coders at Work"

bsb:

It's really not so bad, since you don't start from a blank slate. I just compile it to make sure it all works and that my development environment is ready. I play with the program a little to see how it reacts. While playing, I make a few test cases so I can compare my "improvements" against the production system.

Then I start reviewing the code. I don't bother to rewrite the obvious stuff, only the stuff that I need to figure out. Then I rewrite that chunk of code and fine tune it, making sure to test the code.

Finally, I should mention that when I rewrite, I don't just blow away the chunk of code and write blindly. Some chunks of code are fine, so I can use them as is (though I might move them to a more "sensible" location). So you can do the rewriting fairly quickly, unless you start finding odd mismatches in your test cases. Then it can be a be a bit slow going.

A case in point is from Uploading pictures - displays only 2 of 12: The code was repetitious, so rather than making myself go blind looking for a subtle difference or missed edit between each repeated block, I added a little code to set up some values and then ran the code to generate my reference output. Then I assumed that all the blocks were the same and turned it into a loop. I then ran the code and compared the output to the original, and there was no difference. The original complaint was that the code acted differently depending on how many items were selected. I didn't see any evidence of problems in my updated code, and he didn't provide a complete example, so I expect the problem was elsewhere, and I left it at that.

...roboticus


Comment on Re^3: Questions from "Coders at Work"
Re^4: Questions from "Coders at Work"
by bsb (Priest) on Oct 21, 2009 at 00:42 UTC
    One of the later interviewees (Bernie Cosell) described a similar rewrite-to-understand approach.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (7)
As of 2014-09-30 22:14 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (385 votes), past polls