sitepoint.com sitepoint.com

Practical Code Refactoring, Part 1 - What is Good Code?

Refactoring is about re-thinking your code, everything in it, for the sake of making your code better. In this series on code refactoring, I’ll show you the Why, When, What, Where, and How of refactoring since refactoring is more of an art more than a science. In this part I’ll explain what makes code good, the basis which I build upon later through the rest of the series. What is Good Code? The main goal of refactoring is...

blog.jessitron.com blog.jessitron.com

Duck typing is like the force

Scala's type system is impressive, and yesterday one feature came in handy: converting certain classes into a common type with useful methods on it.Say several types have a core set of characteristics, and we want to define methods based on those without modifying the original classes. In this example, various classes represent regions of a chromosome, and the common characteristics are a begin position, end position, and strand. I...