Author: Bill Karwin

  • Parrot Web Framework?

    Wondering if the following idea could be feasible: Architect a web framework that emphasizes Inversion of Control. Implement core web framework in Parrot (now that this dynamic language platform has released its 1.0). Voila! A web framework that supports any language implemented for Parrot platform. Developers write plugins in any language: Python, Ruby, PHP, Perl6,…

  • How do the Proxy, Decorator, Adaptor, and Bridge Patterns differ?

    A user recently asked: I was looking at the Proxy Pattern, and to me it seems an awful lot like the Decorator, Adaptor, and Bridge Patterns. Am I misunderstanding something? What’s the difference? Why would I use the proxy pattern veses the others? How have you used them in the past in real world projects?…

  • Can I Use Example Code from Internet Q&A Sites?

    A user recently asked: Scenario: A developer is working on a project and encounters a problem. They ask a question on the internet somewhere (ie stackoverflow.com) Someone answers their question and provides a nice code snippet that just about does what they want. Where does one legally stand if the developer includes the code verbatim…

  • Quantity Over Quality

    Alex Netkachov recently reported a list of micro-optimizations for PHP. Several other bloggers (Sebastian, Maggie, Pádraic) responded with appropriate messages, reminding people that proper application design usually counts more than micro-optimizations. They are all correct. When I was an intern, I emailed a C compiler developer, to ask a question that had occurred to me…

  • Accepting a job that failed The Joel Test

    A user recently asked: I’m about to accept a job offer for a company that has failed The Joel Test with flying colors. Now, my question is how do I improve the conditions there. I am positive that within a few months I will be able to make a difference. But where do I start?…

  • Unit Test Coverage

    S.Lott writes in his blog about unit test code-coverage: how much is enough? Effective tests should account not only for code paths, but also input values and other application state or external environment that may affect the behavior. For example, it may be easy to get 100% code coverage from tests for a function like…

  • How Do You Reward Good Clients?

    A user recently asked: I find when I get a ‘good client’ things go so much smoother on a project (there even seems to be less bugs – weird?). I have a habit of rewarding good behavior from anyone (even if its just a simple thank you). I am interested to know what sort of…

  • Splitting a String in Perl

    A user recently asked: How do I take a string in Perl and split it up into an array with entries two characters long each? Ultimately I want to turn something like this F53CBBA476 into and array containing F5 3C BB A4 76 This was my answer: @array = ( $string =~ m/../g ); The…

  • Understanding Unfamiliar Databases

    A user recently asked: What kind of approaches and techniques can you employ to become familiar with an existing database if you are tasked with supporting and/or modifying it? How can you easily and effectively ramp up your knowledge of a database you have never seen before? Here was my reply: The first thing I…

  • Why Should You Use an ORM?

    A user recently asked for good arguments in favor of using Object/Relational Mapping technology: If you were to motivate [sic] the “pro’s” of why you would use an ORM to management/client, what would the reasons be? Try and keep one reason per answer so that we can see what gets voted up as the best…