Posts in category 'hacking'

  • In The Hopper

    Yes, believe it or not, I have a hopper. I never empty the hopper, but the hopper exists, and there are items in it. Usually the hopper is overridden with work concerns, be it actual, day-job work, or the consulting stuff I do on the side. Or it may be overriden by more immediate, viceral concerns: sleeping, eating, and so forth. But given it’s the Christmas season and things are slowing down a bit, it’s possible… just possible… I might be able to work on some items from the hopper.

    First on the list? Earn myself a Blackberry PlayBook. They currently have a very simple developer contest: Get an application approved and published in their app store by February first, and you get a free PlayBook. A free $500 tablet? Sounds good to me! I’ve already got the SDK installed (the first SDK released is based on Adobe’s AIR platform), and the simulator up and running, so now I just need to start coding. The current plan is a recipe manager application… ‘course, I just need to decide how to present such an application on a tablet device. Fun!

    And the second item? Update savsender to build against the latest devkitarm. And while I’m at it, get the code up on github. This was triggered by an email I received back at the end of October asking for an update, and given how simple the codebase is, it’s a request I should be able to fulfill during my spare time.

    So, here’s hoping this is a productive Christmas! Assuming I don’t just sleep my way through it…

  • ColdFusion Tip Of The Day - CFCs Are *Objects*

    So I have the “pleasure” of working on a couple ColdFusion projects on the side. The thing about ColdFusion is it’s a lot like Perl: wonky syntax, often used by total amateurs, and can be horribly abused to do really bad things. And guess who primarily uses ColdFusion? Yeah… total amateurs.

    As a beautiful example, let’s consider the CFC, or ColdFusion Component. This concept was added to ColdFusion in order to add modularity and object orientation to what was, frankly, a largely procedural programming mish-mash. And it does a pretty good job:

    1. It provides mechanisms for encapsulation.
    2. It encourages code reuse.
    3. It encourages documentation.

    Well, assuming it wasn’t being used by amateurs. See, a CFC can, and should, be used like a real object. But let’s say you’re a dumbass who doesn’t understand object oriented programming. Well, in that case, you might do something really stupid, like use a CFC as just a container for a bunch of utility functions that are only loosely related. For example, you might do something stupid like:

    <cfcomponent output = "false">
      <cffunction name = "init" access = "public" returntype = "myType">
        <cfreturn this>
      </cffunction>
    
      <cffunction name = "firstThing" access = "public">
        <cfargument name = "Datasource" type = "string" required = "1" />
    
        ...
      </cffunction>
    
      <cffunction name = "secondThing" access = "public">
        <cfargument name = "Datasource" type = "string" required = "1" />
    
        ...
      </cffunction>
    
      <cffunction name = "thirdThing" access = "public">
        <cfargument name = "Datasource" type = "string" required = "1" />
    
        ...
      </cffunction>
    </cfcomponent>
    

    See, because this person is a moron, they don’t understand the concept of instance variables. A smart person would stuff the datasource into an instance variable, and populate it when the object is initialized. A complete moron would just pass the same parameters in over and over again because he or she is a god damned moron who shouldn’t be allowed near a computer, let alone permitted to program one.

    deep breath

    Bonus tip: Naming arguments to a function “table1”, “table2”, “table3”, etc, should resulting in the “developer” being dragged into the town square, tarred, and feathered.