Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

#20 Suggestions for refactoring

open
nobody
None
3
2007-03-29
2007-02-03
knob-creek
No

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.

Discussion

  • knob-creek
    knob-creek
    2007-02-03

    • priority: 5 --> 3
     
  • Scott Nicol
    Scott Nicol
    2007-02-03

    Logged In: YES
    user_id=441678
    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
    user_id=1001054
    Originator: YES

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

     
  • Scott Nicol
    Scott Nicol
    2007-02-06

    Logged In: YES
    user_id=441678
    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.

     
  • Scott Nicol
    Scott Nicol
    2007-03-29

    • assigned_to: esniper --> nobody