Wednesday, July 17, 2013 #

Clean code talks by Misko Hevery - Part 4: Global State and Singletons

Global state (and singletons) is a big problem for testing because the global state cannot be controlled by the tests.

Dependency injection enforces the order of initialization at compile time. No magic behind the scene, that singletons get initialized and method talk to each other without the programmer knowing it.

Posted On Wednesday, July 17, 2013 9:36 PM | Comments (0)

Sunday, July 7, 2013 #

Clean code talks by Misko Hevery - Part 3: Dont look for things!

The constructor should have the objects you need as arguments. Don't use locator (object through which you get the object you actually need). In a test like this it is a lot easier to construct! You can just construct the objects needed. You don't need to construct the locator first and then reach in the locator to get the object you actually need.

--> This is law of demeter. Don't pass around objects you don't need. You don't want to know about objects you don't need.

DO this:

public House(Door door, Window window)
    _door = door;
    _window = window;

NOT this:

public House(Locator locator)
    _door = locator.getDoor();
    _window = locator.getWindow();

Posted On Sunday, July 7, 2013 9:50 PM | Comments (0)

Wednesday, July 3, 2013 #

Clean code talks by Misko Hevery - Part 2: Unit Testing

He says something brilliant:

There is no secret to writing tests...
... there are only secrets to writing testable code!

Unit Tests require a separation of instantiation of the object graph from the business logic.
  • do not use new(...) in the business logic. Use Factories.
  • do not use global variables/state
  • no static methods

Posted On Wednesday, July 3, 2013 9:48 PM | Comments (0)

Sunday, June 23, 2013 #

Clean code talks by Misko Hevery - Part 1: Polymorphism

Recently I found these videos about writing testable code and found them very helpful.

Posted On Sunday, June 23, 2013 8:22 PM | Comments (0)

Sunday, March 31, 2013 #

Oncle Bob Interview

Posted On Sunday, March 31, 2013 11:17 PM | Comments (0)

Saturday, March 30, 2013 #

David Allen about 'Getting Things Done'

Nice presentation he had at google:

Posted On Saturday, March 30, 2013 10:56 PM | Comments (0)

Wednesday, March 27, 2013 #

Practical MVVM Talk by Joel Cochran

Posted On Wednesday, March 27, 2013 8:57 AM | Comments (0)

Thursday, February 28, 2013 #

Great Video about MVVM

Posted On Thursday, February 28, 2013 6:28 PM | Comments (0)

Saturday, August 25, 2012 #

Senior Developers vs. Junior

I like the following quote which I found on codinghorror:

[As Steve points out this is one key difference between junior and senior developers:]

In the old days, seeing too much code at once quite frankly exceeded my complexity threshold, and when I had to work with it I'd typically try to rewrite it or at least comment it heavily. Today, however, I just slog through it without complaining (much). When I have a specific goal in mind and a complicated piece of code to write, I spend my time making it happen rather than telling myself stories about it [in comments].

Posted On Saturday, August 25, 2012 10:00 PM | Comments (0)

Saturday, June 2, 2012 #

What is a Coding Dojo?

Recently i found out that there is a thing called "coding dojo". The point behind it is that software developers want to have a space to learn new stuff like processes, methods, coding details, languages, and whatnot in an environment without stress. Just for fun. No competition. No results required. No deadlines.

Some days ago I joined the Zurich coding dojo. We were three programmers with different backgrounds.

We gave ourselves the task to develop a method that takes an input value and returns its prime factors. We did pair programming and every few minutes we switched positions. We used test driven development. The chosen programming language was Ruby.

I haven't really done TDD before. It was pretty interesting to see the algorithm develop following the testcases.

We started with the first test input=1 then developed the most simple productive program that passed this very first test. Then we added the next test input=2 and implemented the productive code. We kept adding tests and made sure all tests are passed until we had the general solution.

When we improved the performance of our code we saw the value of the tests we wrote before. Of course our first performance improvement broke several tests.

It was a very interesting experience to see how other developers think and how they work. I will participate at the dojo again and can warmly recommend it to anyone. There are  coding dojos all over the world.

Have fun!

Posted On Saturday, June 2, 2012 3:38 PM | Comments (0)

Copyright © huwyss

Design by Bartosz Brzezinski

Design by Phil Haack Based On A Design By Bartosz Brzezinski