Dynamic and static typing with unit tests.
April 20, 2009 at 01:20 AM | categories: python, brainstorm, c++ | View CommentsThere is an on going discussion at the office with a team member who refuses to use dynamic languages. Claiming that most of his errors are typographical errors and they are caught by the compiler. So for him, since these errors are not caught until runtime, he throws and entire group of languages out the window. He also claims that to ensure that same level of checking with a dynamic language you would have to create more unit tests than normal to prevent introducing unhandled runtime exceptions. So I decided to do a little test over the weekend. I created a very simple Number class in Python and C++. Using the exact same TDD development process, I implemented some very basic operations including division, addition, subtraction, etc... I ended up with 12 tests. The exact same tests for both the C++ and Python implementation resulting in 100% of the executation path being covered. I decided that the compliation (in case of C++) and passing of the tests determined a success. Then went back and inserted common typographical errors. Mistypes, extra = signs, not enough = signs, miseplled_varaibles, etc... The end result was I was unable to get my unit tests passing while introducing syntax that would induce an unhandled runtime exception in Python. Granted, in C++ the compiler did catch a lot of things for me, but the point here is I didn't have to create any extra tests to ensure that same level of confidence in my Python code.
Blog themes and SCM.
October 11, 2008 at 06:57 PM | categories: brainstorm, sourcecontrol | View CommentsWe have a new theme? You like? If not, blame commenter rholmes, it is his fault. Seriously though. In a previous post he brought up a very good point, the site looked like hell if you were browsing with images off. Well this new theme looks better with images off and overall it isn't too horribly bad. So, if you don't like it, suggest one, just make sure it looks good with images turned off. Now to the SCM part. After about a week of playing with Github and Lighthouse, I found them both to be great products. They integrated well with each other and the tools for working with Git are available under every platform. If I didn't already have my own server and experience deploying Trac and Mercurial I would use both these services without question. That being said, though I have enjoyed my time working with those tools, I've migrated my Github source and Lighthouse tickets over to a newly installed Trac 0.11, full circle. End result. If you like tinkering. If you like managing your own installations or you have some customization/integration you would like to do, use Trac and Mercurial, otherwise use Github and one of the great ticket systems it integrates with; I enjoyed Lighthouse. For fun, here is the circle of ticketing and scm life I've gone through over the last 6 years or so.
- cvs and PHP Ticket
- svn and home grown Python tickets
- svn and Trac
- Github and Lighthouse
- mercurial and Trac
Keeping a Kitchen: A programmers approach.
September 17, 2008 at 11:48 AM | categories: python, brainstorm | View CommentsA recipe site to end all recipe sites? After going through piles of recipe and food sites I found absolutely nothing that met my needs, be it a pay site or a free site. Nothing did what I was looking for. After speaking to some friends and family, throwing around my ideas, I decided that was I was looking for wasn't all that far fetched, just no one has really taken the time to do it. First, lets cover what is how there.
- Recipe sites (tons)
- Diet sites (tons)
- Kitchen/pantry inventory sites (a few)
- Recipe database
- Item database (for recipes and shopping lists)
- Ability to add new recipes
- Ability to edit existing recipes
- Kitchen/pantry inventory (barcodes?)
- Daily, Weekly, Monthly food planning
- Sensible shopping lists (more on this)
- 1/2 cup Salsa
- 10 tortilla chips
- Salsa
- Tortilla Chips
Project: Developing a simple insurance interface.
July 06, 2008 at 07:23 PM | categories: python, project, brainstorm | View CommentsI play a game called EVE Online and I create and support a lot of software for our in-game corporation. After recently migrating forums away from punBB over to vBulletin I was stuck with the choice to either migrate our existing Ship Insurance script (written in PHP) or create a whole new system from scratch. Being a lover of Python, TDD, and sausage, I of course picked the rewrite option since it would be the most difficult and suck up more resources and time than just migrating some shitty PHP script. The requirements are very simple. Allow claim to be entered. Allow claim to be approved. Allow a claim to be denied. Allow an agent to see a listing of all claims. Allow filter options by ship type and pilot. Allow agent to enter in the payout. Save all past claim information. (reporting) My personal goals for this project. 100% coverage with unittests. Use TDD methods to develop the project. Use the Trac system to support development. Use Pylons with a SQLite DB Use Ext for any fancy shit. Code available soon as I get my repository back online.