design
We had a crisis in our team last week. One of our teammates left. It all started off with a discussion while pairing on a task with John (not his real name). I found a method did not belong in a certain class, while John didn't care, but didn't want to change it. We started a discussion that ended up into a heated debate about code quality. The two positions were: having readable code leads to a higher velocity checking in code that just works gets us to the deadline During the sprint retrospective,...
I had fun writing this one My current client asked me to allow users to paste text into textboxes/textareas, but that the pasted text should be cleaned from '<...>' tags. Here's what we came up with: $(":input").bind('paste', function(e) { var el = $(this); setTimeout(function() { var text = $(el).val(); $(el).val(text.replace(/<... '')); }, 100); }) ; This is so simple, I'm amazed. The first part just binds a function to the paste operation applied to any input declared on the...
I recently bought Call Of Duty: Black Ops for the PC. It's a really realistic and challenging game, and my kids love it. However, if you want to share a gaming experience, you want to have different profiles for each player in the family. No luck with CoD:BO though. The game doesn't support mutliple profiles. I started looking around on the internet for known solutions and stumbled upon this guy who made his own multi-profile CoD:BO launcher. I was quick to notice that it was a .net 3.5 app, probably...
While preparing the code for my previous post, I decided to try NU to get the OSS I needed for the demo. I must say it was a blast. Ruby is required to run NU. For those who don’t have ruby on their machine, get the ruby installer. It won’t slow your system down or pollute it in any way. It’s just creating a directory of your choice for ruby, and adds a system path pointing to it. I wanted fluent Nhibernate with all it’s compatible dependencies: NHibernate, Castle.core, … To get all these dependencies,...
Since I published the state of my project goals, I got a few questions about my repository implementation, so here goes… The ‘classic’ repository interface looks like this: public interface IRepository<T> { T GetById(int id); IEnumerable<T> GetAll(); T SaveOrUpdate(T entity); void Delete(T entity); //... } This interface has some issues to me. First of all, it’s data-centric. I know that’s the whole point of a repository, but bear with me. Second, it exposes far too many methods. One...
I recently realized the many parallels you can draw between the theory of evolution and evolving software. Evolution is not the proverbial million monkeys typing on a million typewriters, where one of them comes up with the complete works of Shakespeare. We would have noticed by now, since the proverbial monkeys are now blogging on the Internet ;-) One of the main ideas of the theory of evolution is the balance between random mutations and natural selection. Random mutations happen all the time:...