As I mentioned in previous week notes I will sometimes publish older notes. I started to get through my old notes a filter some interesting links. Here they are.

Composed regex

Some people, when confronted with a problem, think “I know, I’ll use regular expressions.” Now they have two problems. ~ Jamie Zawinski

Composed regex is idea of breaking the complex regular expressions into smaller ones with name or comment and composing them back together. IT significantly improves readability of regexes. Related article on coding horror Regular Expressions: Now You Have Two Problems.

Step builder pattern

Step builders is nice approach for building complex objects. Compared to standard builders these builders provide more fluent api and it ensures that the builder is properly setup with type checks not runtime exceptions (except nulls of course). On the other hand you have to write a lot more code.

Cognitive biases

There are so many biases that are affecting the way how we think. Look at that list! At craft conf there was a talk about how those biases affect our work decisions. Think about decisions you have made or opinions you stand for and compare them with those biases. I have how easily I can get biased sometimes. It is always worth to remind how easily our minds can be tricked.

Others

“Another reminder that poor designs invites more documentation”
Skip lists are fascinating data structure.