Pissing people off

From time to time, if you feel the need to piss someone off for their own good, let me assure you that it’s a perfectly natural thing. If you see someone living their lives without getting pissed off even for few minutes, do them a favour by pissing them off, at least once. Just like eustress people need eupiss for a long healthy life. Besides, it shakes things a little bit which helps people to bring some variety to their monotonous existence. So, if the conventional wisdom has shown you that pissing people off is bad, well, it’s because it’s conventional. Make a note on your todo lists, or your GTD system and make it an items that you could do in less than 2 minutes. Then do it. After all it’s for their own good.

Now, let me show you a very easy method to piss someone off. This works extremely well if the pissee is a tech guy. More specifically a programmer. It’s a well tested and trustworthy method which people used in mailing lists from time to time to start holy wars. This method is most successful if the pissee uses a big stupid language and actually LIKE it. All you have to do is utter “my language is better than you one” phrase in a slightly offensive tone and throw an example on their face. It’s that simple. Lemme give you one example.

Artificial examples on blogs sucks. So let me take some code which I was playing with today and explain.

I was writing some Ruby code this afternoon with WSF/Ruby. In order to talk to an SSL endpoint you need to supply the CA cert to the client as an option. Rampart expects you give the cert with the certificate delimiters removed (first and the last line of a certificate). WSF/Perl will read the certificate for you and do the right thing when you pass the filename. But not WSF/Ruby (note to self: make this part of the lib).

client = WSClient.new( 
  { "to" => "/your/end/point",
    "ca_cert" => "cert content as a string" }, logfile )

The beauty of the language you’re using spring up in situations like this. Without further ado, here’s the one liner to get the cert content as a string with certificate delimiters removed,

File.open('server.cert').readlines[1..-2].join.gsub(/\n/, '')

You got to appreciate the beauty of the above line. Although I’m quite fond of it I prefer the Python version over it. Here’s one way to do it,

"".join([line.strip() for line in open("server.cert")][1:-2])

Yes, the list comprehension beats it all. It’s simple and elegant. Most importantly beautiful and pleasing to look at. My first exposure to list comprehension has been via Erlang. Purely due to the fact that I started reading about it before Python.

Anyhoo, all you have to do now is find someone who uses a big stupid language and throw an example like above to their face and tell them to beat it. See if they can write it more elegantly using their language. The beauty of the trick is that there’s no way in this world that’s gonna happen. So, you’ve already won. One word of caution though. When taking an example take something slightly more complex than a single function call. Like opening a file. In both Ruby and Python it’s one function call. DON’T take this type of examples. Why? Because there’s a very high probability that the other person, yes, the one who’s using a big stupid language, will get so angry and beat you up. You don’t want this. So, avoid at all costs.

There you go. Do some good to the world by pissing off few people with this technique. It’s good for your karma too. Happy pissing!

Update: Ok, I admit that I got a bit carried away with that example which made it artificial, hence sucked. When you write an SSL client using WSF/Ruby you only have to give the filename of the certificate, none of the certificate delimiter removal plus newline removal is necessary. But, I’ll keep the examples to keep the central theme in alignment. BTW, here’s the correct SSL client example with WSF/Ruby,

client = WSClient.new(
  { "to" =>  "/your/end/point",
    "ca_cert" => "server.cert" }, logfile )

Update 2: Before it gets a bit out of hand, let me reiterate if it was not evident from the first reading. This whole thing was meant to be a joke. Don’t take it too seriously, have a laugh and return to you editors, grow some sense of humour for chrissake. Oh, one more thing, I’m no Erlang wiz. I’m just started to grok the Erlang landscape.

Comments (20)