What do Ruby’s Enumerable module, .NET LINQ, and the new Java Stream package have in common? They are all there to facilitate functional programming. Here’s an example, pulled from Java 8’s docs because its support is the most recent.
int sum = widgets.stream() .filter(b -> b.getColor() == RED) .mapToInt(b -> b.getWeight()) .sum();
. . .
If you read my last blog you know that I’ve been pushing the idea of chained computation rather far. It’s been fun to just try to use it for all of my utility programming to see where it breaks down. When you build a program as a single expression in a single sequential flow, one of the things that you have to deal with is making sure that . . .
When you find a more powerful tool, it’s hard to avoid using it. We like to think of this as the ‘if all you have is a hammer, everything looks like a nail’ syndrome, but the fact of the matter is - I have plenty of tools. It’s just that some are more powerful and it's hard not to use them.
Last night, I was playing noise music at an art . . .
We’re really at a point in the industry where all developers should be aware of the importance of continuous refactoring. It’s easy to look at deteriorating code bases and get the sense that if only we’d done large refactorings along the way things would be better. But, code goes bad slowly and it happens through a predictable process. We add . . .
I’m constantly amazed at how biological code seems. It grows and it sprawls. It becomes easier to patch than change deeply. I have this theory that any system the where the cost of changing old structure is high has a strong biological feel. Code, in the worst cases, is like a decaying city. It's easy to add a new sign or a clean up a . . .
I’ve been thinking about cohesion, coupling, and the Single Responsibility Principle quite a bit recently. The other day I realized that cohesion is harder to explain or understand than coupling. I figured I’d put that thought out into the world via twitter (not realizing that Glenn Vanderburg had said essentially the same thing about four . . .
Over the past 30 years, the internet has transformed the world in immeasurable ways. As internet use spread from universities to the mainstream, millions of people were able to access and contribute knowledge, build businesses and connect with the world - at first with simple dialup modems over phone lines and later with more advanced . . .