Wednesday, 8 May 2013

Day of the developers


Today on Reddit there was this reference about how programmers are dealing with bugs. And then suddenly it started escalating and they depicted all the typical cliches. It was nice to see and I say with all my heart, it is all true.

Like this typical thing of not knowing what the code is about. Let's just call it the iceberg-technology. We often have no idea what is the underlying code doing. Partially it's really just the level of overview we have. We have 2 gods. XDebug and Grep. Developers not knowing those two are cursed for life, no question. It's like getting the top 10 Drupal troubleshooting tips from Cosmopolitan. On the other hand I feel the need for transparent overrides. I mean how many times happened that you didn't have any idea what alters the form. Or what changes the access system. Or during a process at what point your precious variable gets deleted. Actually this latter is one of my pervert fantasy. You have a state on the top of the heap at some point. And you wonder how the heck is that variable got that value. What you need is to go back in time and follow the memory address. Haha, if only we work with referenced variables. So you would need a tricky tree-like variable backtracking to follow all variable merges and expressions. To be honest for that you would need to not just go up (down) in the call stack but you would need a replay functionality in XDebug - as not all assignment happened at the parent stack route. Yeah, dreams.

A great news for me - the StatDiary refactoring is going good. The chart and the data sources has absolutely no awareness about each other. I could remove half of the refactored code and generating the stat already feels better. For debugging I extensively use PHPStorm's refactoring capabilities. That's a perfect example where Vim and N++ fails big time (unless you like grepping and typing). Since I'm using PHPStorm I rename functions and variables a lot. Sometimes just to give them a more meaningful name, sometimes to change the purpose. The second most used feature is of course extracting expressions to variables - or blocks to functions. Another rule I follow is to make tiny steps and try to make it stable after each step.

And the big thing of the day: finished Need For Speed! Woot. I beat a Lamborghini and completed all tracks. Now comes the OCD part, to make everything perfect first place. As a contrast I've got a toilet game on my phone, it's a truck racing game where you have to trunk to girls driving in cabrios. Another splendid idea.

---

Peter

No comments:

Post a Comment