Archives

Archives / 2006 / March
  • Welcome to Web 2.0

    Micheal Robertson writes
    "Bye Bye Microsoft Word, Hello ajaxWrite"
    What if there was alternative for Microsoft Word that would install and open in 6 seconds, read and write Microsoft Word .doc files and run on Macintosh, Microsoft Windows or Linux computers? And oh yeah, it was FREE so consumers didn't have to pay $499 for Microsoft Office. I'm excited to announce that day is here....

    Read more...

  • BookNotes I - Refactoring Workbook (Willian C. Wake)

    For future reference, here are few things to look for during refactoring the source.

    Comments
    -          Lots of comment explaining a piece of code -> Extract the code in a separate method
    -          When comment explains preconditions -> Use Assertions

    Long Method
    -          Look for comments to extract methods
    -          Extract methods semantically

    Long Class
    -          Extract class if there are too many responsibilities
    -          Extract interface if you can identify subset of features that clients can use

    Long Parameter List
    -          See if the method is being used to do more than 1 action and the logic is controlled by the parameters ( eg. Add/Update in a single method )
    -          If the parameters come from a single object, pass the object or extract an object out of parameters

    Names
    -          Avoid Hungarian notations
    -          Name the method so that it communicates to other people ( Avoid One or Two Character names, Numbered variables, Odd abbreviations, Misleading names )

    Unnecessary Complexity
    -          Dead code
    -          YAGNI principle ( avoid unnecessary generalization )

    Duplication
    -          Magic Number -> Replace numbers inside code body into symbolic constants
    -          Extract Methods to pull duplication code and put it inside the most appropriate class. Otherwise, extract a class and use it.
    -          Combine classes if two classes are doing mostly similar stuff.

    Read more...

  • Using Webcam in your applications

    As part of another project, I wrapped the very basic functionality of "avicap32.dll" to use webcam in your own applications. Well for some reason, I'm unable to continue working on it so I decided to put the source online which I hope will save someone a little time.

    Read more...