Archive for October, 2008

Did you know?     1 - x 3 = 1 3     1 - = 0.333... 3     0.333... x 3 = 0.999...     ...then...     0.999... = 1     Are you searching for the trick? Believe it or not, this demonstration is true. Maybe the old intel pentiums […]

Online Free Book: Getting Real

Just put in my queue: Getting Real Today I had an overview of Clean Code, by Uncle Bob. From what I saw today, I perfectly agree on everything, but going in details it will be for sure an enjoyable learn experience. The book is well groomed, with plenty of code samples and amusing comic strips. […]

Welcome to anti-refactoring lesson number 4. Previously I posted about trivial programming errors, stuff for amateur programmers as in last case. Here we go for a more conceptual mistake. Answer this question: from 1 to 10, how do you think it's smart to bind the name of a configuration property to the internals of your […]

The Repetita Juvant Principle

Welcome to anti-refactoring lesson number 3. The "Repetita Juvant Principle" is the counterpart of the DRY principle: 1 @Override 2 public SomeObject getSomeObject() { 3 return super.getSomeObject(); 4 } 5 6 @Override 7 public void setSomeObject(SomeObject arg0) { 8 super.setSomeObject( arg0 ); 9 } Then, you may think... this code has been written for some […]

Always on getter and setters

Welcome to anti-refactoring lesson 2. There are painters that paint with pencils or brushes and painter that paints with a bucket. A bucket is very effective if you just want a canvas filled. An example: 1 private String prefix; 2 public String getPrefix(){ 3 return getClass().getPackage().getName(); 4 } 5 public void setPrefix(String prefix) { 6 […]

It is quite fun when you see an extremely verbose code that can be replaced by two or three lines, just removing useless stuff, or using the correct API. But it is much less fun, when an expert makes a huge refactoring on your codebase covering it of useless crap. It happened to me today […]

LOC (Lines Of Code)

"skilled developers may be able to develop the same functionality with far less code" --Wikipedia "Source Lines Of Code" A very simple way to count Physical LOC (Lines Of Code) using Unix tools: $ cd ${your project dir} $ find -name "*.java" | xargs wc --lines A general rule (not always true): the lower LOC […]

Concurrent locking for dummies

Locking is a technique used for concurrent manipulation of shared data. Locking is not only related to databases: for instance you use locking in Java to synchronize multithreaded access to shared objects residing in memory. Here I am not going to talk specifically about Java locking or database locking, but only how conceptually locking works […]

Colleague: I just got an email ... Title: "The blue wonder - and you can also f**k the girl next to the door" ... Content: some comments about the offer in subject .... ... The best thing about Vi is the safety of flying with autopilot, relaxing and without the necessity of worrying of that […]

Today I booked a flight to Italy for this weekend with Lufthansa. At the beginning I checked without logging in, and I got a nice price (€251.00). Then I logged in with my miles & more account and I got an higher price (€327.00). I made some checks, and what I've understood is that the […]


You are currently browsing the NewInstance weblog archives for October, 2008.

Longer entries are truncated. Click the headline of an entry to read it in its entirety.


October 2008
« Sep   Nov »

Follow me

twitter flickr LinkedIn feed

Subscribe by email

Enter your email address:



Tag Cloud