#20 Suggestions for refactoring


While checking the source code, i found that it would benefit from some refactoring. There are e. g. some methods which get the user name as a parameter, while most of them simply fetch it from the global options struct. However, those methods receiving it as a parameter get this from the global options struct in the end. I suggest removing the user name parameter from the signature of all those methods.

Furthermore, i suggest using the unescaped user name for logging purposes even where the escaped user name is used.


  • knob-creek

    knob-creek - 2007-02-03
    • priority: 5 --> 3
  • Anonymous - 2007-02-03

    Logged In: YES
    Originator: NO

    Thanks for the suggestions. The code could use a lot of refactoring, not unsurprising since the original code was written in 1996.

  • knob-creek

    knob-creek - 2007-02-06
    • assigned_to: nobody --> esniper
  • knob-creek

    knob-creek - 2007-02-06

    Logged In: YES
    Originator: YES

    Next suggestion: parseBidHistory has 450 lines, this could be extracted into its own file "history.[ch]" and broken down into smaller methods.

  • Anonymous - 2007-02-06

    Logged In: YES
    Originator: NO

    I've got 3 biggies on the todo list. You scratched the first one:

    1. Separate parsing from output. Preferably there would be a parseBidHistory() that fully populates auctionInfo, then a printStatus() that takes auctionInfo and prints the details.

    2. Change watch() so that auction updates, bidding, and bid result checking are placed in a wait queue, ordered by wakeup time. This will let esniper check all auctions daily and report lost auctions sooner (rather than when it wins/loses the auction it is currently watching).

    3. Once (2) is done, change "won" calculation by using won and assumedWon variables. When you place a valid bid, assumedWon is incremented. When the final result is known, assumedWon is decremented and Won (if you actually won) is incremented. This will allow esniper to place bid on multiple auctions ending at the same time if won + assumedWon < quantity.

  • Anonymous - 2007-03-29
    • assigned_to: esniper --> nobody

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

No, thanks