Category Archives: Clean Code

clean code is a more important today with our large scale it business. Basically this is “How do I write code that every one here understands”.

TDD with Venkat

Time for some education again. This time it’s Test Driven Development with Venkat Subramaniam (@venkat_s) Disclaimer: This is my own notes and my interpretation of things, NOT the teacher’s. I recommend you to take this course if you have the opportunity. Table of Contents Influences of TDD on Agility and Sustainability Circles of feedback Development speed Cost… Read More »

Features of Java generics

Java generics is a great feature introduced in Java 5, but it’s not that type safe that you would assume. The following example was found in our test code. dto.setFailingTask(new ArrayList(Arrays.asList(“Task1”, “Task2”)); where the setter looks like the following: public void setFailingTask(List<Task> aTasks) { tasks = aTasks; } So what’s going on here? The first… Read More »

Builder pattern for mandatory values

I found an interesting blog post for using the builder pattern with mandatory values. In short it uses the common builder pattern, but adds an twist by using interface to force which value to set next and thereby solving the problem with many mandatory values. I will demonstrate the problem with the common builder and… Read More »

Know your core framework

I found some legacy code in a project that I’m working on. I felt that I must share this one. I think it is very important to know the core framework you are working with. Especially the one included with the language you are using. In this project, we are currently using Java 7 and… Read More »

Keep your code clean

Keeping the code clean is not as easy that you first may assume. I have seen code examples that make you shiver but still it’s hard to really remove all the noise without changing the fundamental behaviour.

The evil comment

For the moment I am reading Clean Code by Robert C. “Uncle Bob” Martin @unclebobmartin. I just finished the chapter about comments that really made me think of something that I always argued about.

Implementing DDD

A while ago a took the “Implementing DDD” course with no less then Vaughn Vernon (@VaughnVernon) and Patrik Fredriksson (@weakreference) at Citerus. Vernon has written the book with the same name as the course. Here is my notes from that course.