TAG | Clean Code Developer
20
If code begins to smell while you work it you should revisit your design decisions
No comments · Posted by Christian in Good to know

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..
architecture · clean code · Clean Code Developer · Code Quality · Design · smells
26
Will a single level of abstraction result in a higher complexity?
3 Comments · Posted by Christian in Good to know
Some 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.”
CCD · Clean Code Developer · PHP · Separation of Concerns · Single Level of Abstraction · Unit Tests
12
Get your hands on, get them dirty. Now wash your hands!
4 Comments · Posted by Christian in Outside the box
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?
CCD · Clean Code Developer · Entwurf · Hands-on · Prototyping · Refactoring · symfony
7
Doppelten Code überwachen mit dem Copy & Paste Detection Tool phpcpd und Hudson-CI
1 Comment · Posted by Christian in The right tool
Als 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.
CCD · Clean Code Developer · Continuous Integration · DRY · Duplicated Code · Hudson · phpcpd
29
Kann ich sauberer sein als die Technologie, die ich benutze?
1 Comment · Posted by Christian in The real job
In 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.
CCD · Clean Code Developer · FCoI · Refactoring · symfony
26
Copy and Paste Detection und wie man damit umgehen kann
2 Comments · Posted by Christian in The real job
Gestern 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.
CCD · Clean Code Developer · DRY · Refactoring · sfImageTransformExtraPlugin · Tests · Unit Tests
25
Entspricht mein symfony Plugin dem roten Grad des Clean Code Developers (CCD) ?
3 Comments · Posted by Christian in The real job
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!
CCD · Clean Code Developer · DRY · FCoI · KISS · Pfadfinderregel · phpcpd · Refactoring · Refektion · Root Cause Analysis · Sebastian Bergmann · sfImageTransformExtraPlugin
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…)
CCD · Clean Code Developer · Robert C. Martin · sfImageTransformExtraPlugin



