March 2009 Entries
Here's a short snippet from me to think about. Say we have a some code which retrieves a list of orders from a datasource. The part of the application using this functionality looks like this:
public class OrderProvider
{
public ICollection<Order> GetOrdersFor(Customer someCustomer)
{
ICollection<Order> orders = CallSomethingHereToFetchOrders();
return orders;
}
}
ICollection<Order> orderlist = OrderProvider.GetOrdersFor(someCustomer);
if(orderlist == null || orderlist.Count == 0)
{
//something is happening here//
}
else
{
//something else is happening here//
}
At a glance, someone I showed this to said there was nothing inherently wrong to this snippet. I care to disagree. What's wrong here, in my opinion, is that the provider doesn't have a unambiguous behavior as far...
I just had a moment of deeper understanding in how real life guidelines apply to software development as well (as far as software development isn't real life of course).When I was taking driving lessons for my license a while ago, my driving instructor gave me a few tips, which with a little creative reasoning apply to software development as well:Be decisive. Don't hesitate, do what you have to do. When you make a decision, follow through! Don't wait when you don't need to, just do it!In sofware development: When in a situation that seems difficult, find a way to solve...
So, for my current job I (together with two peers) write-slash-maintain a moderately big stack of PHP code. It’s written in a typical PHP fashion: (almost) no object-oriented principles, a bad attempt of separating presentation and business logic, code duplication all over the place, and, currently my biggest nemesis, zealous usage of the ‘global’ keyword. What is the global keyword you ask? By declaring $a and $b global within the function, all references to either variable will refer to the global version. There is no limit to the number of global variables that can be...
Well, here we go! Time to kick off my 'professional' blog. I will be posting my experiences with various programming languages here, although it will mostly be about Microsoft's .NET framework.A little bit about me? Sure!I've been developing on different levels of complexity in C, C++, Java (1.3 - 1.5) and C# (1.1 - 3.5) for a few years now. I've developed a strong preference towards web based frameworks in the past few years, after working for a company that develops online management tools.This company (we'll just call it Company X) has a nice package deal on things like CRM,...
Ladies and gentlemen, I am now on Twitter. You can find me as tedkees. Feel free to follow me, or just ignore it. That’s fine too. What made me do it? Well, Scott Hanselman of course!
For my work I have to work in a few different scenes so to speak. On one hand we have the PHP junkies, on the other hand there's the .NET evangelists. I'm sort of caught in the middle, with a unique vantage point on both sides. I can't say it's pretty all of the time.After having worked with C# and Microsoft SQL Server 2000/2005 exclusively for a few years, I can honestly say I've gotten spoiled with all sorts of cool productivity tools. Snazzy IDEs, database profilers, query browsers, you probably know the drill. How horrified I was when I...
Spike: A simple prototype program to prove your assumptions. This can range from feasibility to performance and back again. I recently found that almost half of my time is spent creating spikes for ‘difficult’ situations I encounter. One of the pitfalls of writing spikes is getting stuck in an endless cycle of writing them. You’ll end up with a bunch of proofs that the problem can be solved, but your problem is still present. So, how do we avoid getting stuck on spikes? I use the following steps: Analyze Before you start...
Recently I've been working extensively on a web application based on ASP.NET with a C# backend. For data persistence I used Castle ActiveRecord, which is based on NHibernate. I encountered a problem with queries taking too long, or so I thought.I wrote a bit of code that printed the amount of queries executed on the bottom of each page. I did that by putting a memory appender in my log4net settings.By doing this, all SQL queries will be logged into the memory appender. At the end of each request I would simply get the amount of entries from the memory...
This post is inspired by a lengthy open letter blog from Ayende about his experiences with a licensing component, interlaced with my own experiences on dealing with my clients. In my day job I regularly have to talk to (potential) clients about their wishes, their problems and overall product satisfaction. So even though I don’t run my own company, I think I do have some experience with dealing with clients now and then. Communication is the key. Communication is essential for managing your clients. Software development inherently introduces bugs, requirements mismatch and all sorts of other problems. The biggest...
Phil Haack recently blogged on using jQuery for creating a delete link in ASP.NET MVC which uses ajax when available, while still using conventional form posts when needed. One of the comments was about using the same html link in both cases opposed to changing from a html link to a submit button and vice versa. One advantage of that is that you enable a common case when deleting an item: a confirmation dialog/screen. It just so happens that I recently implemented a very crude version of this in my pet project. First off, I’d...
So, it’s busy, life’s busy, I’m busy. So I want to make a list for myself what to blog about. I’ve got a lot of interests, but I’d like to stay in line with the general topics I’ve written about so far. So, here’s my list for the coming weeks (months?). NHibernate and custom usertypes I’ve recently ran into a simple case where this might apply. I’ve got the code, just need the explanation. Storing an unbounded tree structure with NHibernate ...
I’m coining a new programming discipline, called Jenga Programming, or Jenga Driven Design (JDD). It’s something I see happening all the time, and it’s driving me crazy now and then. For those of you who don’t know what Jenga is: Jenga is a game of physical and mental skill, marketed by Hasbro, in which players remove blocks from a tower and put them on top. The word jenga is derived from kujenga, the Swahili verb "to build"; jenga! is the imperative form. (http://en.wikipedia.org/wiki/Jenga) Basically what you do is you start with a solid...