All things personal

Malte Finsterwalder's Blog

Oct 16
How do you like my jakolantern this year?

How do you like my jakolantern this year?


Aug 14

Standards of perfection

I just read an interesting blog post by Dale H. Emery: Standards of perfection. (If you don’t follow Dales blog, you should start to do so.) He points out that we often seam to implicitly measure ourselves and others against standards of perfection, that are unreasonable.

He was wondering, why we do so? So I’m trying to take this question a little further.

It occured to me, that I can still hear my parents requesting standards of perfection, that were more or less unreasonable. I oftern request myself to perform the best I can possibly do and I am dissapointed, when I don’t always live up to my own standards. And I can also hear myself requesting a lot from my own kids.

So why am I doing this? First of all it seams so “natural”, that I often don’t even notice it. Thanks for pointing that out again, Dale! But I can also think up a reasoning behind it: By setting high expectations, I want my kids and myself to rais up to the challenge. Not expecting the best that they or I can do, feels like opening the door to mediocracy. And my standards don’t seam to be so unreasonable after all, since I usually expect standards, that my kids or I were able to achieve at least sometimes before. If I only expect what I routinely get, will they or will I improve at all? How often will they or will I perform better than expected?

But there is a catch. I think we are mixing up expectations and aspirations. I aspire a lot, but how much should I expect?

I have been working hard to achieve reasonable expectations and not be dissapointed, if my high expectations aren’t met. Exceeding my reasonable expectations also feels better, than hardly ever achieving my perfect expectations.

So, setting another expectation for myself, I want to further improve my expectation setting. In particular, I want to state my expectations of others more explicitly. We’ll see how that works out.

I picture myself bringing our kids to bed. Brushing teeth and getting dressed for the night often works so wonderfully seamless, it’s a joy. At other times, it can be such a hassle. I can’t yet hear myself the next time we have a hassle. Maybe I can even think up something, that can make my reasonable expectation explicit in a way, that challenges my kids to over achieve my expectations? ;-)

Thinking about it, making high expectations explicit, also might make failure an option and not a desaster.

Is it nature or nurture? From what I just stated above, it might have a high bias towards nurture. And I’m sure that it can be mitigated with some attention to it.


Apr 30

Apr 16

JUnit “Catch unexpected Exception”-Anti-Pattern

When I look at codebases, I often see the following anti-pattern in JUnit tests:

@Test
public void testmethod() {
    // do something
    try {
        // do something that throws a checked exception
    } catch (Exception e) {
        fail(e.getMessage());
    }
    // do some more
}

The problem with this construct is, that it swallows the stacktrace. You only get a failure with the message of the exception. And besides it’s a lot of work to write all the try-catch blocks and they clutter the code.

Exceptions that should not occur in a test should just be thrown out of the test method. JUnit will catch them, show the test as failing and give you the stacktrace in all it’s glory.

So it’s better and easier to just write the code as follows:

@Test
public void testmethod() throws Exception {
    // do something
    // do something that throws a checked exception
    // do some more
}

Catching exceptions in tests only makes sense, when you want to test, that an exception occurs.

@Test
public void testThatExceptionIsThrown() {
    // do something
    try {
        // do something that should throw an exception
        fail("XyzException expected");
    } catch (XyzException expected) {
        assertEquals("BlaBlaBla...", expected.getMessage());
    }
    // do some more
}

If you are only interested that the exception occurs at all and don’t want to verify anything on it, JUnit 4 makes it even easier:

@Test(expected=XyzException.class)
public void testThatExceptionIsThrown() {
    // do something
    // do something that should throw an exception
}

This test fails, if the expected exception is not thrown (either because no exception or another exception was thrown). But beware, that you can’t know for sure in which call the exception occured. If multiple methods in the test could raise the exception in question, a try-catch-block is more specific.


Apr 7

Balancing reading, listening and doing

Bookshelf - Reading in the round1

As a curious person in general and as a software professional in particular I feel I need to read a lot (or listen to podcasts) to stay up to date. Since I’m always curious, it’s also fun, too. I inform myself about a diverse set of topics: Programming, Design, Management, Parenting, Psychology, …
It has helped me in the past to know about a lot of things from reading.

But I’m also constantly unsure about my reading:

  • Am I reading too much or too little.
  • Am I reading the “right” things?
  • Am I missing something important?
  • Am I reading “useless” stuff?

It’s really hard to “measure”, whether investing an hour into reading/listening something will “pay off”. I know that a lot of the stuff I investigate doesn’t pay off in a streight forward manner. But it does form my understanding and thinking over time and that helps me in being successfull, I think (and hope).

But investing an hour into reading/listening also means an hour I can’t spend doing something. So a constant question is: Should I rather read about something or should I do (practice) something instead?

  • How much are you reading?
  • What are you reading?
  • How much are you doing?
  • What are you doing to practice?

Depending on my project situation I roughly spend between 45 and 120 minutes a day reading or listening. If I’m not in a project, it can be as high as 4-5 hours of reading/listening and investigating. I have a 45 minute commute to work, where I listen to podcasts or read. Nowadays I’m reading more and more stuff online (Blogs, Articles, podcasts, …) than books. My doing on the other hand is very limited, besides the things I do at work anyways. I invest relatively little time just for practice and playing around.

Having three little kids, I spend a lot less time for myself than I used to, of course.


  1. “Reading in the round” by Dick Rochester, available under a Creative Commons Attribution-Share Alike 2.0 licence at http://www.flickr.com/photos/question_everything/1460025318 


Apr 6
Just me: A dad, a software developer and a new tumblr

Just me: A dad, a software developer and a new tumblr