coding practice in ruby