Harmful coding practice

A customer has reported a bug. Being one of those educated and smart customers we love, he sent us the repro steps and the input data.
When I first saw the bug report, I thought it will be really hard to repro it, but, to my surprise, I’ve been able to repro it from the first try.
Good, let’s move into debugging …
Everything works ok, until we’re returning a value in an Office ribbon callback method. That’s where PowerPoint raises an exception and stops calling other callbacks. I had to modify the code a little to make it debuggable (it has been written in fluent paradigm and there was no other way of finding out the culprit).
And … surprise: the callback returns 1500, which is probably too large for PowerPoint to handle and this is why the other callbacks are never called – PowerPoint stops processing this request and moves on to other requests.
Why would the callback return 1500, since it should have returned something below 30? Here’s where karma bit me: I’ve optimized some code to use internally some lists and return these lists. The code worked fine for years, until a rookie had to use my code.
My original code:

public static class AvailableDateFormatsManager

private static readonly List _formatsListA = …
private static readonly List _formatsListB = …

public static List GetAvlFormats( {criteria} ) …


Rookie’s code:
public List GetAllAvlDateFormats( …)
var list1 = AvailableDateFormatsManager.GetAvlFormats( criteriaA ); // returns _formatsListA
var list2 = AvailableDateFormatsManager.GetAvlFormats( criteriaB ); // returns _formatsListB
list1.AddRange( list2);
return list1;

All names are meaningless and stupid, all you have to do is to notice how I’ve broken the encapsulation by returning the actual private List object instead of returning an IEnumerable or a ReadOnlyCollection.

Our customers are smart

We’ve recently seen a plethora of issues with Office Timeline ribbon not getting loaded (again?…)
In the end, it seems they’re all related to abused systems. Once the customers reinstalled Office 2007, the add-in loaded fine. Thank God the customer had this idea before we had to present it to him (nobody likes to be told “uninstall A,B,C” and then “install Office Timeline”, although in many situations this fixes the problem (we call this troubleshooting procedure “the silver bullet” – give the customer TSB :-)

I’ve got a pain in the butt (literally)

I couldn’t think it can hurt so much …
(Warning: gross content ahead, I had to write it to take my mind off the pain).
A boil has developed in my left buttock, very close to the anus. This morning it was so painful I couldn’t sit in a chair.
The state-run medical system in Romania is so f..ed up that I’d preferred to try first to see a doctor at some private practices; not a chance, they’re all overloaded.
So I called my GP, who’s a very nice guy, but he can’t fight the system; so every time I try to do something normal, like schedule an appointment, he says “come around xxx hour, hopefully I’ll be able to serve the people that gather here from yyy hour …”; no guarantee that he’ll see me exactly at that hour.
The good thing is the GP managed to prescribe some medicines that helped me for a while, including an antibiotic and pain-killers.
Go figure: I’ve taken two pain-killers today( one at 9 AM, one around 12:30 PM), now it’s around 4:00 PM and the pain is back and it’s slowly growing to the same level it had this morning. Soon I shan’t be able to sit in the chair again …
And I still must visit the GP, because the pharmacist is allowed to sell me one or two antibiotics pills, but not more. And I shan’t be able to fight this beast in my butt without antibiotics; I’ll try again in a few minutes, wish me luck.

The funny part of the story (and I’m repeating it to all people around, and they all laugh a lot in the end): I had to tell my boss I need to leave because there’s a pain in my butt :-D

Beware, web, here we come …

We’re advancing with our brand new product (it’s secret, but it’s ok to say that a huge part of it is web-based).
We had to analyze and review many, many web technologies and it’s clear to us that they have NOT been designed by developers. They’ve been designed by hobbists and (possible, although I doubt it) graphical designers.
Only two examples:
– Ember versus Angular (the Ember people realize it’s better to propose the implementation guidelines and force them; also the syntax of the code using Ember has a normal topic, unlike Angular’s)
– SaSS versus Less (Sass uses an imperative-like language when special constructions are needed, while Less it’s just some sugar on top of CSS)
– anything versus PHP
– TypeScript versus JS
The way things evolve, it’s very likely that many, many C# developers will have to embrace the web technologies. It takes only a few good developers, pissed off at the status of the current web technologies, to clear the mess that’s HTML/CSS/JS.