Category: Programming

19 Dec

On technology books


Jeff Atwood mad some explicit about technology books here: At first I was astonished and strongly disagreed with him. Later I thought about it, digested its meaning and must admit, I agree. So this is a how I will choose which books I will buy or not:   Buy Books about architecture, design and techniques – design patterns, dependency injection, test driven development. Interestingly also useful are books of these topics applied to a specific language. Even more interestingly, also useful are books of these topics applied to a specific language you broadly know but don’t use. In particular, you can mix and match books on these topics between Java, C# and ActionScript whether you are a Java, C# or ActionScript programmer. Doing the “translation” (adapting examples to missing language features, etc.) might even help. Books about the fundamentals of a technology you know nothing about. This means that if you have to learn say Silverlight and you are a Java programmer, buy a book about C# and XAML. Do not waste time in buying books containing practical examples like “form validation” or “how to create modal windows” and so on. There’s Google for that. Books about organization and (self-)management practices. From The mythical man month to I.M. Wright’s Hard Code, you can’t go wrong with this kind of books. With “you can’t go wrong” I mean that even if you pick up an obsolete, wrong and heretical book about soft topics you’ll find more food for thought than by buying a “recipe” book [...]


Filed under: Featured, Programming, Rants

18 Feb

Top 10 music for programming


For programming one needs silence to concentrate at the problem at hand. But comes a time (often) when one has to go in auto mode, and have the hands write the ideas accumulated at the time. Good music is the best thing to let them go, and it must be non-boring, lengthy enough to avoid having to switch back and forth, with the right level of darkness and, above all, top quality. The rule I followed is 1 per author, if an author has more than one submission, they share the same slot (and most, share). So, from bottom to top: 10 – Dido – Life for Rent, No Angel For some reason when programming sad, melancholic  music feels better than a beach Boys album would, probably because I want my brain to be kidnapped by the music while the hands write like an automaton, and not my brain to start . Life for Rent has fewer good tracks than No Angel, but I’ve listened to No Angel literally too much and it’s starting to get boring. 9 – Dire Straits – Love over Gold Dire Straits are able to reap a 9th place in this list, and it’s strange. Their music don’t fit the theme, and it’s generally not good to code with; you can’t concentrate with Twisting By The Pool. Still Love over Gold is a strange beast, and they are able to get on the list with just two songs of a single album of all their life. The first two of [...]


01 Feb

A smarter but not smartest greedy algorithm for hotel bookings


Doing homework for my university studies, I stumbled upon the problem of having a somewhat smart logic for hotel bookings. The assignment was to build a model-2 jsp/servlet based website for bookings of a generic hotel chain; the required booking facilities were simple but I wanted to do something smarter, and solve the problem in a satisfactory way. Let’s say that you are eager to go to Sidney between the 29th Jan and 5th of Feb.. because – well, any reason you want to be there in that period. What bothers me is that most booking facilities just check for a whole availability – a single room available for the entire period. Now, if I really want to go to Sidney, and I’m already willing to take 12+ hours of plane to go there, renew the passport, fight spiders, etc., probably having to change the room at the mid of my stay there is the least of the problems – specially if the alternative is not going to Sidney at all. Now, apart from the fact that this is a stupid example because I would never want to go to Sidney because there are some of the worst (1) spiders (2) of the world(3) there,  the problem was interesting to solve and the solution happened to me while walking towards home, listening to Alesha Dixon – this to justify the non-optimality of the algorithm. (The rest of the project was built over Miles Davis prestige recordings I received as a present for Christmas… much better [...]