Category Archives for Clean Code

Don’t Make Your Code Lie

This short little post you’re reading was inspired by all the code reviews that I’ve done in the past month. I don’t know if that’s a coincidence or I haven’t paid too much

Continue reading

Unit Testing: The Myth of Complete Isolation

Time and time again, when people talk about unit testing, they mention the fragility of unit tests as some inherent disadvantage of the technique. I disagree. I believe this is just bad unit testing and

Continue reading

Creating a Groovy DSL for Structurizr

In the previous post, we took a quick look into generating documentation with Structurizr. I really enjoyed playing with the tool, but I wasn’t aesthetically pleased with the code necessary to create

Continue reading

Method Length and Extract Till You Drop

As a typical nerd (and a DZone Zone Leader), I tend to read a lot of blog posts and comments about programming. One thing that keeps amazing me how long people’s functions tend to be and how many

Continue reading

Value Objects

Since I’ve already set you up in a DDD mood with the previous post, let’s capitalize on that further. In this post, I’ll try to provide an easy explanation of Value Objects and their

Continue reading

Aggregate Pattern

I’ve recently done some reading on DDD and Aggregates in particular. Since many people struggle to understand the pattern, I decided to try to explain it myself. Problem Imagine that you’re

Continue reading

The Stepdown Rule

It has recently occurred to me that some people are ordering the functions in a class randomly, mostly based on gut feelings. It’s a good indicator that we should rehash the old, simple but very

Continue reading

Entity Objects Power Ranking

There seems to be an ever-ongoing discussion about how powerful should an entity object be. That’s indeed a very valid discussion as the choice that we make (often unconsciously) will have a huge

Continue reading

Optional Method Parameters

I have recently come across an interesting problem: should you use Optional as a method parameter type? The majority of sources says that you shouldn’t, but let’s weigh the arguments before

Continue reading

Cleaner Tests with Spock

One obvious fact about tests that is often overlooked is: tests are code. This implies that the tests, as any kind of code, have to be read, understood and maintained. We’re smart, educated guys,

Continue reading
1 2 3