Notes from YOW! 2013: Hadi Hariri on ‘Refactoring Legacy Codebases’

I attended Day 1 of YOW! Sydney 2013 and thought some people might get something useful out of my notes. These aren’t my complete reinterpretations of every slide, but just things I jotted down that I thought were interesting enough to remember or look into further.

A stack of stickers showing the word 'refactor' in a stylised, death-metal-like font.Hadi Hariri is a Developer and Technical Evangelist at JetBrains. He spoke at YOW! about refactoring legacy codebases.

Hadi started by offering reasons for refactoring:

  • increase the understandability of the code
  • decrease the impact of change
  • reduce the cost of change

He described how refactoring relies on culture: Continue reading

Notes from YOW! 2013: Jeff Hawkins on ‘Computing Like the Brain: The Path to Machine Intelligence’

I attended Day 1 of YOW! Sydney 2013 and thought some people might get something useful out of my notes. These aren’t my complete reinterpretations of every slide, but just things I jotted down that I thought were interesting enough to remember or look into further.

A visual repesentation of machine intelligence as an incandescent brain with digital inputs and outputsKeynote, Day 1: Jeff Hawkins spoke about “Computing Like the Brain: The Path to Machine Intelligence

Jeff is an entrepreneur (he invented this slightly popular thing called the Palm Pilot) and scientist who co-founded Grok (formerly Numenta) to build technology based on theories of how the neocortex of mammalian brains works. Continue reading

Does Scala == Effective Java?

From the archive: Originally written in January 2011, this post from my old blog, Graham Hacking Scala, has been consistently popular ever since and I thought it deserved a new lease on life here…

'Effective Java (2nd Edition)' by Joshua Bloch. Many of its suggestions are redundant if coding in Scala.I started reading Joshua Bloch’s Effective Java last week. I’ll have to admit that I haven’t read it before, but only because I’ve been told by several people, “you already do most of what’s in there anyway.” Seeing as we tell all the new recruits to read it, I thought I should actually flip through it myself so I know what’s in there.

Books of best practices are always written in relation to domains that have many possibilities for bad practices (choosing otherwise would make for a very short book). Reading the first chapter of Effective Java, I was amused as I realised that, if you’re coding in Scala instead of Java, many of the book’s recommendations are either unnecessary, because Scala doesn’t permit the corollary bad practice, or built into the language of Scala, or made easier to implement than they are in Java. This isn’t a criticism of the book, but an observation that the state of the art is moving on, and Java is being left behind.

From the first 25 items in the book, here are my notes on practices that either become easier to follow or unnecessary if you are using Scala: Continue reading

A New Java Library for Amazing Productivity

I’ve found this great Java library that can make developers more efficient in pretty much every source file they write. It has the following features:

  • Ferrari 458 Italiaa broad and powerful collections framework
  • collection methods that greatly reduce boilerplate
  • immutable collections that don’t have mutation methods (unlike java.util classes where e.g. List.add() throws an exception if the list is immutable)
  • an awesome switch-like function that doesn’t just match numbers, enums, chars and strings, but can succinctly match all kinds of patterns in lots of different classes, even in your own classes
  • an annotation that automatically writes meaningful equals, hashCode and toString methods for classes whose fields don’t change (without using reflection) Continue reading

Is it really a DSL, or just an expressive interface?

Clowsn with GuitarsI think the term ‘Domain Specific Language’ (DSL) is starting to become over-used and is being applied to things that aren’t really languages at all.

A Tale of Two Designers

When I think about explaining DSLs to people, the examples that spring to mind are languages like SQL, Regular Expressions, maybe even BNF, or CORBA IDL. And if I think about Why these languages exist, I imagine that somewhere, at some time, somebody thought:

I’m going to design a new language that is specifically crafted for solving this particular problem.

I like DSLs. Or maybe it would be more accurate to say I love them. They are powerful, expressive, and allow people who are eager to describe a solution or encode information (be they programmers or otherwise) to escape the complexities of imperative paradigms and Von Neumann thinking, permitting a strong focus on the actual problem.

In contrast to the above, the way in which I’ve most frequently seen the term DSL used of late is from people thinking something more like this: Continue reading

Graham’s Guide to Learning Scala

From The Archives: This article is one of the all-time most popular posts from my previous blog Graham Hacking Scala. I thought it worth updating and re-printing it here.


It’s a pretty widely-accepted view that, as a programmer, learning new languages is a Good Idea™ . Most people with more than one language under their belt would say that learning new languages broadens your mind in ways that will positively affect the way you work, even if you never use that language again.

With the Christmas holidays coming up and many people likely to take some time off work, this end of the year presents a great opportunity to take some time out from your week-to-week programming grind and do some learning.

With that in mind, I present “Graham’s Guide to Learning Scala”. There are many, many resources on the web for learning about Scala. In fact, I think there’s probably too many! It would be quite easy to start in the wrong place and quickly get discouraged.

So this is not yet another resource to add to the pile. Rather, this is a guided course through what I believe are some of the best resources for learning Scala, and in an order that I think will help a complete newbie pick it up quickly but without feeling overwhelmed.

And, best of all, it has 9 Steps!

Continue reading

ScalaSyd Wrap-Up: November 2012

ScalaSyd: Episode 9

We had a great meeting at ScalaSyd last Wednesday night, probably one of the best I’ve been to. These are my notes from the evening, which are in no way comprehensive – they are just the points I found most interesting.

Jed (@jedws) warned us at the start that there were two “pointy” talks with some soft stuff in the middle, but I found the two pointy talkers did an excellent job of conveying their pointy subjects to neophytes. Not an easy task, so well done, guys.

Continue reading

My Debugging Secrets Revealed

A large tick wriggling upside-down next to a pair of tweezersI’ve always been pretty good at debugging. Until a couple of years ago I’d never thought much about why I find it easy, but once I realised that I didn’t know why I was good at something, I had to know. So I dedicated some time to analysing my own internal, instinctive thought process, and from what I’ve observed it can be reduced to this:

Continue reading