Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re: Reading Someone's Program

by Tux (Canon)
on May 17, 2011 at 14:38 UTC ( [id://905285]=note: print w/replies, xml ) Need Help??


in reply to Reading Someone's Program

  • Reformat/reflow to your liking. Preferably with Perl::Tidy, so the new layout is both documented and reproducible.
  • Do not rewrite function-based code to OO-based code just because it is more modern. There may be (very) good reasons other than modernizing the code, but simply because you think OO is more modern or because you like OO is a very bad reason for such a conversion. To me that sounds like implementing threads in a program that doesn't gain anything by that.
  • Add comments! Everywhere that you needed time to investigate, add comments.
  • Start writing tests based on the docs and based on any fix you make.
  • Replace local option parsing functions with Getopt::Long and write a good usage function.
  • Create a two-sided TODO list. On the left "Have to change", on the right "would love to change". Postpone the right until everything works and you have spare time.
  • Use a good VCS, like git and commit often with very clear commit messages.

Enjoy, Have FUN! H.Merijn

Replies are listed 'Best First'.
Re^2: Reading Someone's Program
by Anonymous Monk on May 17, 2011 at 14:55 UTC

    A good rule of thumb for the "often" part of local committing is:
    you've changed something and managed to get it to compile again -> commit!

      "managed to get it to compile again" o.O? I'm going to assume you mean "have added thorough tests for the changed code and confirmed they all pass".
      Me

        No, that would be the commit following :)

        I really don't like having the (small) fix in the same commit as the commit that adds a number of tests to verify the fix. Note that the OP is dealing with a project that does not have tests (yet).

        In a project where you do test-driven development, I would completely agree with you.


        Enjoy, Have FUN! H.Merijn

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others meditating upon the Monastery: (4)
As of 2024-04-25 15:40 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found