test.ical.ly | getting the web by the balls

TAG | Clean Code Developer

Today it happened again to me. I was writing some code for that awesome little tool of mine which I am really excited about. I’ve been writing for a few days now but something was wrong.

There was this smell..

(more…)

· · · · ·

single-level-of-abstractionSome of you – I hope many – have heard about the Single Level Of Abstraction principle. I learned it from Uncle Bobs book Clean Code. The idea is to maintain only a single level of abstraction per method or function. So a method should either work on the system level i.e. making calls to the file system, work on an abstract API, controlling a process flow by calling other very abstract methods. Never should there be calls to i.e. fopen() and $db->findById($id) in the same method.

A common reaction to this that I heard a couple of times by now is: “But then I end up with hundrets of tiny methods littering my code all referencing each other and making my code far more complex than it needs to be.”

(more…)

· · · · ·

hands on clay

When approaching a new project there are several possible ways of preparation. The small time between learning about a project and starting to code can be used for resource planning, user interface design, UML diagrams and a lot more.

A very common way to spend this time seems to be worrying.

There is a line you need to cross before you dive into the code and you know you should be prepared before you cross it. However there is a good chance that you prepare too much.

I don’t want to go into methodology and promote agile methods over waterfall (although that would make a lot sense). What I am saying is that you should get started as early as possible to produce code.

Starting to code right away though bears some risk to get lost in your code and to loose the focus on your project early on, leading to missed deadlines and higher costs.

So what is the right level of preparation and how can the risk of a hands-on approach be reduced? Also what is the benefit of it?

(more…)

· · · · · ·

duplice codeAls ich vor ein paar Tagen mich und meine Arbeit auf den roten Clean Code Developer Grad geprüft habe, habe ich auch das erste mal mit dem Copy & Paste Detection Tool phpcpd zu tun gehabt und habe es kurz darauf als Leitmass für ein kleines Refactoring genutzt.

Mittlerweile habe ich dieses Tool auch in meinen Continuous Integration Prozess aufgenommen und kann die Ergebnisse mit jedem Build im Auge behalten. Deswegen möchte ich kurz zeigen, wie ich phpcpd und Hudson in Einklang gebracht habe.

(more…)

· · · · · ·

keimIn der letzten Woche habe ich begonnen, mich selbst in Richtung Clean Code Developer zu entwickeln, bzw. mich mit Graden zu beschäftigen und mich selbst zu prüfen, indem ich meinen  Code prüfe.

Gerade beim Favour Composition over Inheritance FCoI Prinzip ist mir aber aufgefallen, dass ich dem nicht ohne weiteres folgen kann, auch wenn es die bessere Lösung wäre, weil die Software, die ich einsetze dieses so nicht vorsieht.

(more…)

· · · ·

copy-pasteGestern habe ich mich mal an den roten CCD Grad gemacht und mich und meinen Code auf die dort angegebenen Prinzipien überprüft.

Eines der Prinzipien des roten Grades ist DRY und ich habe mal mit dem PHP Copy Paste Detector phpcpd nachgeschaut, wie viel Doppelungen ich denn so fabriziert habe.

Ich habe mittlerweile das erste Refactoring bereits hinter mir und bin sehr zufrieden, aber auch die restlichen Todos in diesem Zusammenhang sehen vielversprechend aus.

(more…)

· · · · · ·

www.clean-code-developer.de

Wie ich gestern angekündigt habe, werde ich damit beginnen mein sfImageTransformExtraPlugin anhand der Clean Code Developer Grade zu überprüfen angefangen mit dem roten.

Implizit überprüfe ich mich damit natürlich selbst. ;)

Die gute Nachricht ist, dass ich alleine mit dem Interesse bereits den schwarzen Grad erreicht habe. Die eigentlich Arbeit beginnt aber mit dem roten Grad. Dann mal los!

(more…)

· · · · · · · · · · ·

Ich habe diesen Blog angefangen zu schreiben, um mich selbst quasi dazu zu zwingen, mich mit Themen der Softwarequalität speziell dem Thema Testing zu beschäftigen.

Bereits letztes Jahr, als ich diesen Entschluss gefasst hatte, hatte ich das Buch Clean Code con Uncle Bob gelesen, welches ja fast schon einen Kultstatus erlangt hat (eine schöne Rezension könnt ihr u.a. hier lesen).

Seit geraumer Zeit gibt es eine Ergänzung zum Buch, nämlich www.clean-code-developer.de, eine Art Programm zur selbstständigen Weiterbildung und Verbesserung. Das will ich auch machen! (more…)

· · ·

Theme Design by devolux.nh2.me