29 May 2009

Public Relations

It seems that I am particularly unlucky in finding support for my interest in code quality. I can't help ranting so I will tell you this little story.

Some years ago, shortly after my "career" as code cop began, I wrote a series of articles about code quality and daily build techniques for a Java magazine (which I enjoy to do from time to time). My boss knew about it, but was not interested in it and I wrote the articles in my free time. (As you might have noticed I am not a gifted writer and filling all the gaps between facts and source code took the best part of most weekends during that year.) The first part was published soon after that.

Depressing DayAfter some time the second part of the series was published. This time the head of the IT department (the boss of my boss) learned about it and was impressed. He thought I had done it during work hours, or at least should have. I was happy and thankful for his appreciation and of course did not object to being paid for the time already spent. But my boss did not like the idea. He kept saying that we (the company I was with back then) were not an IT providing company and did not need to show any technical expertise or qualification to the outside world. However as he was forced to pay me for those hours, a rather difficult time began. In the end I regretted having shown the article to anyone.

In fact the whole story depressed me a lot and made me accept an offer from another company half a year later. There, during my interview I was promised support for writing technical articles. Later when a new article was due I wanted to call on that. It turned out that neither a budget nor a process was available for such activities so the support melted down to being allowed to write in my free time. I was pissed but in the end couldn't blame my boss. It was entirely my fault. Due to my lack of bargaining skills I hadn't pinned down the promised support to something concrete. (Technically my boss had not lied to me.) So from this time on I did neither ask nor expect any support. If they didn't want it, they should have said it straight at the first place.

But that was not the end...
Several months later I attended a department meeting on improving internal education, knowledge transfer and being more professional in general. It turned out that the head of the department (the boss of my boss) wanted more activities seen by the general public and that they had problems fulfilling the request of upper management to place an article in internal journals from time to time. Imagine my confusion when I heard that.

Yesterday a colleague brought a small, local conference on software quality to my attention (shame on me I hadn't known it before) and proposed that I should try to submit a talk. Again I tried to get some support for it. I am able to prepare stuff at home (at the weekends) but I can't afford taking days off for giving a talk. This time I contacted the boss of my boss directly because I remembered his (feigned?) interest in public relations. Unfortunately he delegated the decision back to my boss. As we already know, she does not deem public actions necessary. :-( My colleague was surprised, too. We remembered the things being discussed during the departmental meeting and both had thought that management wanted more public relations. (Otherwise I would have started questioning my senses.)

Depressed Wander
What is going on here? Are they all dreamers, talking about things they would like to have knowing they can never afford them? Or is it just another form of the suppressing code quality because we don't have any-syndrom? (In full name I call this the suppressing code quality topics because we know that we do not have any quality and I will write about it later.) I don't know. But I do know that it was the last time they tricked me. (They've already tricked me twice, shame on me.)

2 May 2009

Fragments of cool code

From time to time I stumble over a piece of code, that just looks "cool". For example date literals in Ruby:
class Fixnum
def /(part)
[self, part]
end
end

class Array
def /(final_part)
Time.mktime(final_part, self[1], self[0])
end
end

13/11/2008 # => Thu Nov 13 00:00:00 +0100 2008
or a proper name for a throw:
catch (Exception up) {
// log the error
throw up;
}
The best name for a JUnit 4 test fixture (free to choose) I ever saw was in a presentation given by Peter Petrov:
@Before
public void doBeforeEachTest() {
A good name for a Ruby binding was
module Regenerated
Inside = binding
end
eval(script, Regenerated::Inside) where the evaluation is done within the scope of another module Regenerated which acts as a namespace.

22 April 2009

About the Code Cop

The Big IdeaThree weeks ago I attended the eJug Days in Vienna. It was a little conference with some nice presentations. I hadn't been to a conference for some time and was highly motivated. At the end of one particularly cool talk, when the speaker showed his last slide containing the address of his personal web site, a thought hit me. "Man", I thought, "I should have some nice web page with all my stuff put together in one place." This should save my job from going to India ;-) This was the beginning of Code Cop dot org.

I am a senior developer and have been working with Java and internet related technologies since 1999. And I am a completionist. I like my code being in order, e.g. nicely formatted, readable, proper named, designed, tested etc. In fact I am fanatic about it, sometimes even forced to keep it neat. For example a colleague calls me to his place to discuss some problem and I spot some minor flaw in the code on the screen, e.g. he wrote static public instead of public static. I'm getting mad. I am unable to listen to him till the flaw is fixed. I can tell you it's a vice. (And rumours are that there are colleagues who write such crap on purpose, just to tease me.) I don't know if it's the impact of my Virgo ascendant or the beginning of some weird mental disorder. But I do know that studying Mathematics and doing research work did not help to be less freaky.

Code Cop T-shirt reading Hard KoR Code CopI started working on code quality in 2004. While staying with Herold Business Data I was responsible for the code quality of the Online Services, running the Daily Build with Apache Ant and loads of tools. There, after years of harassing my dear colleagues with code and daily build issues, I was officially appointed "Code Cop" in 2006 (and even called a "Code Nazi" once). Later I published some articles about being a Code Cop :-). Now I moved all my QA related stuff from different sources here and will add all things I have not published yet.

Like Why the Lucky Stiff I'm an "aspiring author with no true achievements under my belt". I am interested in code quality tools, code generation techniques and recently in dynamic languages like Ruby or Scala. I have a PhD in mathematical computer science (a mixture of Applied Mathematics and Computer Sciences) from the university of technology in Vienna. I live in Austria.

Licence
Scott Hanselman gives advice to license your blog: All the content provided on code-cop.org is Creative Commons Attribution 3.0 licensed (short CC 3.0 BY), except noted otherwise. That says you can share or remix the work as long as you attribute the original work to me. Note that some images might have a different licence. For code I usually use the New BSD License.

Credits
It's time to thank some people for their help: Christoph Kober (Polychrom) for the cool Code Cop logo you see above on the right. Back in grammar school he already made the fanciest drawings. Claudia Gillmeier (Aurian) for her help with the design and layout. Stefan Nestelbacher designed my first T-shirt back in 2006. Further thanks to Douglas Bowman (Minima Stretch template), Mike Samuel (Prettify), phydeaux3 (Tag Cloud) and all the folks at Flickr for releasing their images under the creative commons licence. I just love your images. Keep going! Last but not least I want to thank my significant other Kasia for proofreading and supporting me in setting up this site.