Objection

RSS

Social skills XOR programming skills?

I’m fed up with computer nerds being labeled as socially inept and how that’s a problem. I want to turn that problem upside down for a bit. What if the problem isn’t nerds lacking social skills, it’s other people focusing too much on ‘the rules’ of social interaction. Their rules. Like ‘don’t talk about computing, because we’re not interested’. Talking about football is OK. Talking about that guy who lives down the road is OK, but mention javascript and you’re a complete nerd? WTF? I don’t want to talk about your neighbor any more than you want to talk about javascript. It’s about time that our suffering is recognized. Every day we are bombarded with completely uninteresting chatter about people we don’t care about and events that don’t matter. It’s awful. You want us to become more like you? Well, you know what? We want you to become more like us. We want you to start caring about the things that really matter. Like correct indentation in code, favorite web frameworks and whether you should choose Clojure or Erlang as the next programming language to learn. You don’t find that interesting? Well that’s about how interesting your favorite topic might sound to a programmer. Why should our interests be inferior?

Then there’s the rule that you should never upset anyone. Always think of other peoples feelings and how your statement might affect your social standing. Firstly, this is just plain boring. If you’re only ever allowed to say things everyone already agrees with and never bring up anything out of the ordinary, you’ll never learn anything or improve in any way. Secondly, in a work setting, this can, and will, and does continually, lead to disaster. Honest, hard working and straight talking programmers clearly state that the product is not ready for production, but their messages of concern are translated to upper management via more ‘socially skilled’ minions who in accordance with social etiquette state that ‘everything is going according to plan, sir. No problem, sir. We’ll have everything delivered on schedule’. We all know how these projects turn out. We need to stop worrying about upsetting people, and worry more about learning how to handle bad news and criticism. How not to let ourselves be upset. If someone tells you something you don’t want to hear, maybe they aren’t the problem. Maybe your feelings are.

When you care deeply about something, every little aspect of it becomes very important to you. If you’re a journalist, you argue about the use of idioms. Then we have the likes of the grammar Nazis and the fashion police. Programmers can have heated discussions about indentation of code. Now if a large part of your life consists of sitting around discussing other people and how they behave, you can quite easily end up similarly obsessed. Many are. Things that really shouldn’t matter are seen as reasons for social exclusion. Social exclusion then leads to even worse social skills. This is the main reason blaming nerds for having no social skills pisses me off. First someone is bullied and pushed out from the ‘in crowd’, forced into a depressing childhood of seclusion. Then they’re blamed for having no social skills. How the hell is anyone meant to develop healthy social skills if no one wants to be their friend? The problem isn’t the guy with no social skills, the problem is the people who let that happen, who made that happen. If people would relax their criteria for what is acceptable social behavior, we’d see less exclusion. Less exclusion would lead to better social skills all round. So what if that guy down the hall has worn the same pair of jeans for 5 years straight and has a strange fondness of rabbits. Does it really matter to you that he eats nothing but spaghetti with anchovies? These are the kinds of people that make life interesting, if you ask me. Well adjusted, socially adept people – if you’ve met one, you’ve met them all. Boring.

Being really interested in, and caring about social interactions of course has its benefits. I’m sure any community, not just the software community, would be better off if people spent more time thinking about how their personality was affecting those around them. But there are only so many hours in a day, you have to choose what to focus on. Should you spend your time developing a deep understanding of a particular field of expertise (like programming) or should you spend it sitting around a sofa, talking with friends about other people, who you like, who you dislike, and why you like or dislike them. This is what social skills are all about: Interacting with other people, learning and creating the rules for what is acceptable behavior and what isn’t. I’ve sure done a lot of this. It seems to me to be what us girls do more than anything else. We sit around and talk. About people. In my experience the more nerdy the group, the less we talk about other individuals. Instead we talk about our field of expertise, we talk about new technology, we talk about politics, religion and so on. I love these conversations!  But the less you focus on the rules of individual social interaction, the less you learn about them. Nerds never get the memos about how annoying it is when someone does X or how silly it looks to wear Y. Or we get them a bit later than others maybe.

Anyway, it’s not like we never socialize. Us nerds learn a lot from each other in social settings. I had a really interesting experience at a software meetup not long ago. We were a group of programmers gathered together to learn about functional programming and F#. Now I forget why, but the local newspaper had sent a reporter along to write about our group and what we were doing. She was a very nice young woman, pretty and most likely seen as very socially adept in her surroundings. But in our group she didn’t work out at all. It was quite funny really. I think we managed to be nice and polite to her, just like she would have been nice and polite to one of us if we showed up for a party at her place and started talking about Test Driven Development and Pair Programming. But that’s exactly how awkward her presence at our meetup was. Her conversation and questions were so far removed from ‘our world’ that we struggled to find answers for her. My point is that much of what is perceived as social ineptness is a matter of culture. Put a computer nerd in a group of jocks and he’s completely out of place. But it’s the same the other way around too.

I know there are hopelessly antisocial software people out there that really need to sort themselves out. But they are a minority. Labeling us universally as socially inept is causing unnecessary problems all round. If you expect someone to be socially hopeless, you’re more likely to find proof to back up your concern. I think we deserve a second chance. I also think that if we spent less time getting worked up about inappropriate social interactions and more time exploring new technology the world would be a better place.

Live long and prosper, nerds! You’re the best :-)

Bra burning worked, now let’s burn some ties

I recently saw someone on Twitter despairing about how some feminists aren’t very inclusive of transgender people. I don’t know who they were thinking of in particular, don’t think it was me as I’ve never met them. But it struck me that I might quite easily be placed in that category if I started talking publicly about the topic. And I felt an explanation was in order. Because it is true that the transgender movement bothers me. But not transgender people themselves. I truly have nothing against transgender people at an individual level. This text is my attempt at explaining this. I’m pretty sure I will fail in some aspects. I might end up offending some people. I’m sorry for any offense I might cause, but I’m not sorry for trying to explain why the transgender movement upsets me. Because it does. I have feelings too it turns out.

I’ve always been a bit of a tomboy, in that respect I think I probably understand transgender people better than many. I’ve only ever been called feminine once, and that was after playing ‘Roger’ in the musical Grease. I was 14 or so and part of a local theater group that didn’t have enough boys to fill the male roles. ‘He was good looking, but a bit feminine’ one of the female spectators had commented after the show :-D Anyway.

So what is it about the transgender movement that disturbs me? Is it just that I’m a bad, intolerant person? Like any old garden variety racist, sexist or homophobe? I don’t think so. Because my issue isn’t with ‘them being less than me’ somehow, which is what racists and sexists think. My issue is with their definition of gender. Because of how that definition affects me and others like me. As mentioned I was never that girly growing up. But thanks to hard working feminists, fighting for women’s rights to be whatever they wanted to be, I never saw being a tomboy as a problem: girls can do anything. Being a girl doesn’t define who you are any more than your hair or eye color. That message is very liberating. You don’t have to fit into any gender based role. Your identity is your own to create, regardless of gender, ethnicity or social background. Your gender only comes into it when it comes to sexual orientation, having kids and so on. I love that message. It was very important to me growing up.

I feel that message is changing. Instead of gender being played down, it is being played up. Instead of saying gender doesn’t matter, fighting for equality and breaking down barriers, we’re putting up more boundaries: Female, male, cis female, transgender male, genderqueer, androgyne, bigender… Sure we’re adding doors, so you choose which group you want to belong to. But we’re still using gender as an important way of defining ourselves. Being a woman is no longer simply a question of genitalia and chromosomes, the term is now defined by the social roles feminists fought so hard to get away from. That’s putting it a bit harshly, but that’s how it feels. It really makes me so sad to see parents labeling their kids transgender at ages as low as 5. Instead of telling them, like I was told, that being a girl doesn’t stop you from playing with boys, cutting your hair short or dressing in blue or anything at all. You don’t have to be a boy to do these things. You’re free to be whoever you want. Don’t worry about your gender. Don’t listen to the people who want to limit your self expression. I want children to hear that message. I’m glad I did.

Not long ago, most white people genuinely believed that black people were less intelligent than them. Slavery and segregation was normal. And they had statistics to support their inhumane views. Black people on average scored lower on IQ tests for instance. They still do sadly, but we now acknowledge that there are so many factors involved in things like IQ tests, that blaming the color of your skin is not justified. Correlation is not causation. If a black kid does well academically, we don’t think of her as more white than the others; a ‘white kid trapped in a black body’. Of course not. We simply see proof that you can’t judge a person based on the color of their skin.

I don’t see why I, or anyone else should accept being made uncomfortable with our gender, based on how we are as human beings. What we like doing, how we like dressing. Sure there are stats telling us that women are ‘like this’ and men are ‘like that’. Just like stats have their say about racial IQ. But screw those stats. The problem we should be tackling is the fact that our society has such clear and separate ideals for what it means to be a girl and what it means to be a boy, that we are making people feel uncomfortable in their own skin. We are driving people to depression and suicide. This is especially true for boys. Thanks to feminists hard work, girls can now wear jeans and suits, be engineers or in top level management without anyone questioning our gender or sexuality. I am truly grateful for all the hard work they have put in to accomplish this. Men have had no such movement. Being a feminine boy is still not nearly as accepted. I can wear jeans and a shirt with no questions asked, boys wearing dresses on the other hand– now that calls for a diagnosis. Men do not accept femininity among their ranks, and women don’t seem to appreciate it in men either. ‘Girl’ and ‘woman’ are used as derogatory terms: ‘You cry like a girl’ etc. If you’re not macho enough, you must be a woman. Feminine guys are told they are girls again and again throughout their adolescence. And what do you know, twice as many men want to live as women compared with women wanting to live as men. (When it comes to actually undergoing surgery, it’s about 50/50 I believe)

I’m not denying that there ARE differences between men and women. It’s just that they aren’t that big. And by dividing us up so clearly, so early, we are amplifying the few differences there are. I have a 5 year old boy and a 3 year old girl. My girl does indeed like playing with dolls more than her brother. Girls are ‘programmed’ to care for babies. But that’s pretty much it. That doesn’t stop girls from potentially being interested in building things, playing catch or climbing trees. It doesn’t stop boys from wanting to cry when they hurt themselves, enjoy making flower arrangements or dressing up. I keep being surprised by how easy it is to interest my daughter in ‘boy stuff’ and my son in ‘girl stuff’. But they come home from daycare with clear ideas of what is a boys toy and what is a girls toy, what girls do and what boys do. I’ve lost count of how many times I’ve had to ‘explain’ to their friends why my daughter has a Buzz Lightyear toy. ‘That’s a boys toy’, I’m told. At 2, my son wanted to give a friend at daycare a hug. ‘Eeeew!’ his friend said and pushed him away. Someone had taught him that. Our society starts early giving clear hints as to what is acceptable for boys and girls. If they are constantly met with “why are you playing with that? that’s a girl’s toy, you’re not a girl”, no wonder they start feeling they are a girl trapped in a boy’s body. Especially if the boys are all mean to them.

Society being what it is today, I fully understand that some choose to live as the opposite gender. Which is why I have nothing against transgender people. I understand them. In many ways my own life would be better if I were a man. But I don’t want to ‘fix’ this by saying that I am a man. That’s not a fix! Not at a societal level. That’s a bad hack of a solution that simply hides the problem. “You don’t like racial segregation? No problem, you can now undergo surgery and become a white guy!”

We have come a long way when it comes to equal rights for men and women. But we’re still segregated. From infancy children are labeled – blue for boy and pink for girl. Girls play with girls and boys play with boys. Our very language segregates us. He and she. Every form you fill in asks you what gender you are. As if it matters. As Europeans it strikes us as very strange that some countries have you state your religion when getting a visa. Asking for your gender should be equally strange. Why on earth should it matter? I recently filled in a questionnaire about the food in our cafeteria at work. First question? Are you a man or a woman? Every single form, for every little thing, you have to state what kind of genitalia you’re hiding. Your doctor needs to know, I get that. Potential sexual partners should be informed. Everyone else should mind their own business.

While society is the way it is, being able to switch between genders is a good thing I suppose. Maybe it is a necessary step in getting to where I want us to go. I’ll grit my teeth and bear it if I have to. But I just don’t like it. I feel it is fixing a symptom, not the underlying problem. I also feel it’s a step in the wrong direction when it comes to women’s rights. Am I allowed to feel this way? Am I a bad person? Was this post helpful in any way? Writing it has helped me clarify my thoughts about the issue at least. Maybe I’ll get comments that will help my understanding further. Hope so.

May 9

Fix THAT!

Us programmers are a bit shy by nature aren’t we. Not really comfortable initiating contact with others. Especially if we don’t know them, or if they are human. I’m no exception. I’m terrible. I don't even feel comfortable calling meetings, I certainly don't like calling people, or actually going over to talk to them. I enjoy being around people, but I really hate initiating contact. Because I worry. I worry that they don't really want me to. That the timing might be bad, that they have better things to do, or that they might not have the information I'm after anyway. “Who would want me to come bother them anyway?”, I ask myself. “I'm sure I can figure this out on my own without getting in anyone's way”.

This is not healthy. I know. We all have our hangups, but it’s important to be aware of them so they can be dealt with. Especially when it comes to our work. Feel free to be a screw up in your own personal time, but if you want somebody to pay you good money for some work, you really should sort yourself out so your work is decent. And just as this kind of shyness screws up your social life, it can also screw up software systems.

In a distributed software system, each component needs to possess decent communication skills. They can’t be scared of initiating contact. Don’t let fear of rejection lead to communication forms so indirect they are impossible to follow and likely to cause confusion. If you like a girl, say, and you want a healthy relationship with her, you need to be able to talk to her, to trust what she’s saying. Communication via paper notes passed from hand to hand across a room full of people is not the optimal solution. The more people involved, the more likely it is that the message will get lost, or stuck or misrepresented along the way. The ideal solution is that you can just go over and have a chat. Most likely it will work out just fine. Relax. The chances of her loosing it and punching you in the face are most likely quite remote. More things can go wrong if you chose the indirect way. You should just go for it.  Just go talk to her.

Like the code we write internally in our app. We write

double result = Math.pow(3, 5);

We expect Math to respond. We expect the result to be correct. If it isn’t we rewrite our app with a different math library. This kind of simple direct communication we can trust should be our aim whenever possible. It is by far the easiest to deal with. Feeling unable to do synchronous communication should be seen as a symptom of a problem, not an opportunity to do fancy stuff with JMS and/or weird and wonderful custom cache services. If at all possible, we should try to fix the real problems in life. If a service is slow or unreliable, THAT’s your problem. Fix THAT. If the data you get from an external system is out of date or incoherent. THAT’s your problem. Fix THAT. It is not a problem that your site doesn’t support IE7, the problem is that your users are still using IE7. Fix THAT. “But some of our users use a paper based system and aren’t familiar with computers” ?!?! FIX THAT!

Sometimes this is really easy. Like saying no to old versions of IE. Just say no. You can do it. People will complain, because people always complain when changes are made. But you know it is the right thing to do. Just say no.

I’m working on a web app where you can apply for benefits. We depend on several official registries, like the Norwegian registry of where people live. If the registry says you live abroad, or that you’re dead, or something like that, we simply don’t allow you to apply before you’ve fixed the official record of where you stay. (Previously we’d accept that the official record might be wrong temporarily, and allowed you to fix it locally) By being stricter, we are simplifying our own solution, at the same time as we are helping the address registry stay updated, making it better for others using it as well.

Other times it isn’t as easy as this. But any connected system is no stronger than the weakest link. We need to start fixing or getting rid of those weak links. Far too often, I see us choosing to adapt our own systems to patch the problems of the weak link. Congratulations, you have now made your own system worse without fixing the real problem. You are a perpetuator and contributor to crappy code and miserable user experiences.

But I can’t fix THEIR system.” “I don’t have access.” “It’s out of my control” Is that what you’re thinking? I think you’re likely to be wrong. Maybe you CAN fix their system: If you go talk to the ones responsible for it. Maybe you CAN have access to their code, if you ask nicely. It is in your power to initiate contact with the people responsible for the badly behaved entity, and ask for help, or help them out. You really can do this. The only obstacle is that it might require contact with other human beings. I fully realize how unattractive this option seems. But sometimes you just need to make sacrifices. And surely your code is worth it. You have to grit your teeth and think of the code. Your poor code. You don’t want it filled up with crap. You want it to stay clean and beautiful.

Time and effort has to be spent regardless. Either you spend it making your own system worse, or you spend it making someone elses system better. It’s your choice.  

May 4

Backwards, not forwards

I once won a limbo contest at a summer party at work. As far as compliments and attention from my colleagues were concerned, it must have been my greatest achievement while there. 45cm, I must say I’m kind of impressed myself :) But I digress. Bending over backwards without falling over, whether figuratively; working hard for your customer, or literally seems to be a good way of impressing people. But watch out. Bending over only works out well in the one direction: Backwards. Bending over forwards will not necessarily result in the same adulation from the onlooker. Let’s face it, not many people will enjoy your ass in their face. And if they do, shouldn’t that worry you?

While I have little practical experience bending over forwards, in the literal sense of the term, I have way too much experience of the figurative one. “Yes sir, of course sir, we can do that for you, no problem sir”. This kind of mindless servitude needs to stop, people. If for no other reason, because it leads to really bad software.

Garbage in, garbage out. This also includes requirements. Crappy requirements lead to crappy code. “I need a <insert buzzword here> system” No, you don’t! “I need to be able to do <x>” No, you don’t! Really. No. You don’t.

You most likely do not need a configurable menu system.  You most likely don’t need all those custom components, standard ones will do the job.  And if you’ve pressed “print”, say, on a letter you’ve generated, you don’t need a button next to it that lets you regret pressing print. The user needs to accept the reality that when he or she presses print, it gets sent to the printer. I understand the requirements, they make sense, it’s just that they’ve been written by someone who shows a complete lack of understanding for basic cost/benefits analysis in software development. And of course they lack that understanding. They aren’t programmers.

Software cannot be simpler than the problem it is trying to solve. If the requirements are complicated, your code is likely to be too. Before you start solving a problem, you should be sure it’s worth it. For the customer – is the cost/benefit ratio acceptable? For the end user - will the code be so complex, it ends up being full of bugs? For others forced to maintain the software - will they be able to maintain it and stay sane? For you – programmers driven violently insane will have seen your name in the commit log, do you feel safe?

You need to take these concerns seriously. You might think your solution to the problem will be so damn elegant that it won’t matter that the requirements were difficult. Yeah right. I’ve just had to update a configurable menu as part of maintaining some old code. As far as configurable menu systems go, well it sure was configurable. I’ll give them that. I’m sure they were very proud of how configurable they had made it. But I promise you, that bit of functionality has NEVER been needed and has ALWAYS caused pain for whoever has the misfortune to work on it. Start asking how to change menus at work and people laugh nervously and run away to hide. The people who implemented this should just have said No. 

It’s your responsibility that the solution works well. And quite likely, no one further up the food chain has thought of the issue like you do. It won’t help much to send them on courses to write better requirements, they still won’t have your hands on experience. If you see a problem ahead, you’ll do them a favor by pointing it out. It doesn’t matter if it’s in the requirements. It doesn’t matter how many meetings they have suffered through to agree on a certain functionality. It doesn’t matter if they are above you in the corporate food chain. If the resulting requirements will make the application a lot worse, for no real benefit, you need to tell them.

What’s more, they will respect you MORE for saying no. Last year we were going to get started working on an extension to our house. The first step was laying the foundation. We started looking for potential building companies;

“Could you get this done by mid October?”. We asked.

“Yes!” said the first guy. “Of course” he said. “no problem”.

Then we asked another guy. He said:

“Well you know, I really recommend that you wait until the spring to do this, that way you’re sure the concrete will settle completely before the ground freezes”

Who do you think we went for? The guy who told us our requirements were wrong. Of course. He seemed far more trustworthy and knowledgeable. He might not have been. Maybe he was just fully booked that fall and was pulling our leg, but that’s not the point. The point is, that as a customer who doesn’t really know much about the work that’s being done, you really appreciate it when the people in the know tell you when you’re asking for something that you might regret in the long term.

We quite happily delayed the start the building process by 6 months, in order to feel safer. I think most sensible people would consider delays or other reworkings of their plans if there are good reasons to do so. They just need to be made aware that this is necessary.

“Well of course sensible people would”, I hear you say, “but I’d have to speak to project management.” Now, this is a problem, I agree. Because project management typically doesn’t care about how the end product will actually work when it’s done. Their job is to get it completed on time as per the requirements specification. If you’re stuck in a project like this… you’re screwed. Go buy a bottle of whiskey. I’m sorry.

But if you’re lucky enough (like me) to work for people who are responsible for the whole lifetime of the product you’re making – not just the initial project, then you CAN do something.  If you’ve been asked to do something you find indefensible, you should raise your voice, put your foot down and your chin up. Explain why the requirements as stated will complicate things unnecessarily. Give them other options. Hell, just implement the other options. They will never know! You can do it. You’ve got more power than you think. Use it.

How testers can make your code worse

I keep experiencing this: I’m unhappy with how we do things at work, I really wish we could do <x> instead. Then I finally get to try <x> and it turns out to be worse than the situation I was complaining about. I’ve complained about functions/methods being way too long (more than 5 lines each) I’ve complained about not having proper requirements before starting work. I’ve complained about not having dedicated specialist software testers. 

Now I’ve experienced all of these things I’m not so convinced anymore.  I find a codebase where nothing exceeds 5 lines frustrating to work with - especially for non-trivial software written by a large team. I find requirements documents counter productive and demotivating (talk in Norwegian) And I’m starting to realize that software testers can actually make your code worse and get you to focus on entirely the wrong things.

The most useful testers, in my experience, are the people who actually need the product you’re making.  They will often be quite happy to test your application too, as they are eager to see it finished, and finished in a way that suits their way of working.  If they aren’t eager to test your application, you should really be asking yourself if you’re making the right product.  When these people test your product, they will test if it makes their life easier. They test whether or not it gets the job done in a good way.  These are the most important things to get right.

Professional software testers on the other hand have a different focus. They start out with the requirements document. They have no need for the application under development, what is important to them is that it complies with the requirements. This is the definition of quality after all. After ensuring that the software meets the specifications, they do their best to make it fail, reporting any success they achieve a long the way.  If they were testing microwaves, they’d be putting animals in there, reporting all deaths as critical bugs to be fixed immediately.  If they were testing coffee machines, they would be pouring hot coffee in their eyes and reporting how your product can cause blindness. They input nonsense and complain that the output isn’t useful.

I can’t really blame them. They are there full time, doing nothing but testing. Testing a product they have never needed, and are unlikely to ever use again after the project completes.  They need something to do. And with shows like Jackass, Top Gear and Mythbusters so popular, who can blame these hard working souls for being inspired to do damage in as many creative ways as possible? 

It is a well established fact that most of the code in any application is practically never executed. Quite a lot is actually NEVER executed once in production. This code increases the overall complexity, increases chances of bugs, decreases maintainability, while giving very marginal, if any, benefit.  

These are the kinds of features that your software testers will spend 98% of their time finding for you.  You’re paying good money to get someone to find ways to make your software worse.  Instead of focusing on how the software is going to be used, focusing on the overall technical structure of the application, you end up focusing on “fixing” “bugs” that no sane user will ever encounter, or even see as a bug. As an example I once got the following bug report:

"When I click the context menu button on the keyboard [I didn’t even know there was such a button before I got this bug report!], a context menu appears with all menu items disabled. The context menu is only relevant for clicks on individual cells in the table shown, so no context menu should be shown when I click on the context menu button"

I swear that was a real bug report!  We ended up spending 15 hours “fixing” this “bug”.  Most of it was spent WTFing and asking ourselves and our managers whether this was really necessary.  A couple of hours here, another few hours there, it all adds up. More importantly though, the code fills up with ridiculous amounts of code that serves no important purpose at all.

My second concern with full time software testers, is that the developers themselves don’t think so much about testing, as they know they have dedicated testers to test for them. This leads to sloppy coding, and code that is hard to test at all.

I once had the luck of working on a project where we had a domain expert on the team with us full time.  He didn’t so much test our application, as use it. He used it as we were building it. Giving us invaluable feedback along the way, every day.  When he reported a bug, that bug was always something that stopped him from doing his job.  He was focused on how the application worked. Not whether it matched a specification, or whether it was physically possible to get the system to output nonsense. 

I say let the coders do the monkey testing. Make it the programmers themselves’ responsibility to ensure the system handles reasonable input ranges, say.  Send them to a TDD course, teach them FitNesse. Even if you don’t plan on using any of them.  It is important that your developers understand what it means and how important it is to test for correctness.  Once they understand this, and know how to do it, it doesn’t matter if they do TDD or if they use an acceptance test framework (they could just stick to normal unit test frameworks).  The point is that us programmers are more than capable of doing this kind of testing ourselves. Someone just needs to ensure that we take this responsibility seriously. 

One thing I did miss before using it, and haven’t regretted a second after starting, was doing automated testing. I love unit tests. I think most programmers worth keeping in your employment do too.  With a team of programmers keen on testing, you don’t need a team of software testers. At least not full time.  Invest time in domain experts who actually need your product instead. If no domain experts are interested in helping you out, you might be building the wrong product.  If management actually stops you from getting access to and input from domain experts or real users… you’re probably doomed anyway.

Nov 7

Not only are requirements documents worthless, they can be directly harmful. (10 min talk in Norwegian)

How I became an insensitive bitch

I read "Fuck you, I got mine" a few days ago and It’s been gnawing away at my subconscious ever since.  The author is so angry. She’s spewing out hate in all directions.  Toward men, toward women like me.  Her descriptions of the world of tech seem so foreign.  Her anger and hatred so misplaced. 

Then it occurred to me. I’ve been that angry too.  Just as deluded as she seems to be. Just as convinced that the world was against me. The only difference was that I didn’t have the self confidence to express my anger openly.  Also, I was 12.  

"Hey look, there’s that girl who’s so ugly"

No, I never got death or rape threats.  Never got beaten up or anything. But I got the message.  I was inferior.  And I was alone.  It all seemed so unfair and so random.  All I’d done wrong was to fall out with my best friend.  The girls in my class all played in pairs you see. When my best friend and I “split up” I was suddenly left all alone - she found a new best friend straight away.  Being alone in a group seemed to trigger some weird tribal vibe that made everyone shun me as if I were a leper.  

Me having no friends and actually being treated badly only lasted a few months.  And very very few people actually said anything mean to me.  But my perception of how people saw me was completely warped for years.  Those few assholes made me think everyone was against me.  I was angry.  I remember almost wishing that someone would try to attack me when I was on my way home alone from somewhere, just so I could beat the shit out of them :-D Never happened.  All those years of martial arts training to no use.

I’m not angry any more.  I don’t take things personally any more.  But that’s taken years and years of “training” if you will.  I’ve taught myself not to care.  So if I come across as an insensitive bitch, this is why.  It was either that or be depressed and angry. Not really caring that much can actually be quite liberating and fun. I know full well some people dislike me, but I really don’t mind.  I can be myself.  And I like myself the way I am.

Even so, I can’t really recommend this strategy to anyone.  The world would probably be a better place if people cared more.  Without a doubt, the best thing would be if nobody were made to feel inferior and excluded.  It’s horrible. I remember.

But the way to achieve this is not by spewing out hate. At the end of the day people in the tech community, more than in any other community, know how it feels to be left out.  Why not appeal to their better nature, make them understand how you feel.  They’re likely to have been there.

Attacking people makes them defensive, aggressive, more attached to their beliefs and ways.  When was the last time someone called you names and you thought “Hmmm, I think you have a point there, I AM a stupid bitch! Wow, thank you for that insight. I’ll rush off and change my ways immediately”.   It doesn’t happen often, does it.  

While I wish nobody had to learn the hard way NOT to care what others think, I DO hope that more people get to see the software community like I do.  The angry feminists are giving you guys a bad name.  It’s not fair and you deserve better.  You guys rock.  You’re the best. I refuse to believe that the concentration of misogynist assholes is higher here than anywhere else in society.  

You know what I hate most about working in tech? The fact that being friends with you guys can be a bit tricky. I’m surrounded by the most amazing people I really enjoy the company of, but if I ask you out for a coffee, or a drink or anything, it seems like a date and gets weird and people get the wrong idea. Spouses have to be involved. I practically only socialize in large groups.  Close friends can be hard to make when you’re the only girl in the office.  So I really hope we convince more girls to join us in tech.  I know we can.  But we’re more likely to get them by showing off our best sides, not our worst ones.  And if we want people to change, then encouraging good behavior is better than punishing bad behaviour. This is a pretty well established fact.  

So come on people, let’s go find some girls and show them how awesome we are :-D

If a girl can replace Hibernate in 600 LOC, just think what you could do…

Why you should write your app in java

My mother is American and my father is Norwegian, so I grew up with 2 languages at home.  I love languages.  I wish I knew more of them.  After a year in France, I did learn french to the point where French people asked me if I was Belgian. Quite proud of myself. I’ve lost it all now of course after years of neglect.  But anyway, I’ve learnt that some things are easier to express in one language than in another.  Some languages are easier to learn than others.  In English - nouns have no gender.  Which just makes so much sense. Why are Norwegian chairs masculine, while French ones are feminine? It’s just confusing and hard to learn.  In Norwegian we do have to deal with 3 genders for our nouns, but at least they are spelled sensibly.  We also don’t conjugate our verbs; I am, you am, they am.  We don’t care, everyone just am. Makes everything so much easier. We also have far more words to express different conditions of snow than your average language. Most importantly though, we make it really easy to express the fact that you just can’t be bothered to do something. Not ‘don’t want’ to, not  ’can’t do something’, just very ‘meh’.  ”Can not be bothered with” translates to “gidder ikke” Much shorter and nicer.  In short, if you’re writing a story about a group of Chronic Fatigue Syndrome sufferers who are stuck in a blizzard; Norwegian is the language for you.  

Or is it? As a Norwegian speaker, I would obviously go for Norwegian if I were to write that story. And if you would like to learn Norwegian, this might be as good a place to start as any.  But for the rest of you, sticking to a language you’re good at might be better option.  Even with its deficiencies, you will most likely create a better text in the language you know best.

Did Shakespeare ever write anything in French or German? Should he have? Maybe he did. I wouldn’t know as I, sadly, went to school in Norway. When young English students were reading Shakespeare in school, we were reading Petter Dass. 

I’ve been hearing a lot of complaints about java lately.  It’s verbose, it’s object oriented, it lends itself to creating factories, proxies and XML files galore.  I know, I hate those things more than anyone.  The English language has some serious flaws too, the spelling is ridiculous, the verb conjugation is unnecessary, and way too often it is used to express really stupid things.  But even with these deficiencies, you can still create beautiful texts, if you learn it well and use it wisely.

I’ve been writing java since 2006, but I’m learning new stuff all the time.  WeakReferences, ForkJoin, AtomicInteger/Reference/etc, CountDownLatch, Phaser, dynamic proxies, memory management tuning, all the new stuff in java 8.. the list goes on and on. Now that I’m starting to really understand how to use the language, I can focus more on what I’m making and less on the language and libraries.  And that’s one thing I miss in the software community.  A larger focus on what we’re actually making.  I want to create cool stuff, I want to make things happen. Sure the tools you use are important, but they aren’t the goal.  Maybe it’s a girl thing; I see a car as a way to get me from A to B. I see programming as a means to create cool stuff.  Guys (often) get so hung up on the car and the driving they forget the whole purpose of the thing. Similarly it seems that discussing language syntax becomes more important than creating something of value.  

Let’s face it.  If you suck at java, the solution isn’t to learn clojure or scala. By all means do, by the way. I sure would like to anyway. My point is just that learning a new language isn’t necessarily that much of a solution if it’s great products you’re after.  For that you need good programmers who know the language they are using.  Hell, I’ve seen a finite element analysis program written purely in VBA in Excel(!!!!) Was it the right tool for the job? Absolutely not! But I mean - WOW! How cool is that? If you know your stuff, you can do anything in any language.

Knowing many languages is cool, it has value, it’s fun, it’s a good party trick (for some definition of party) I personally want to learn as many as possible.  But does it beat true mastery of any one language? I don’t think so. 

Great authors are not renowned for the number of languages they know, but for the mastery of the ones they do, and the beautiful stories they are able to tell with them.

Sep 4

SO SQL (part II)

Hi again, 

For those who don’t know, I’m trying to convince the world that it is possible to connect to a database from java without a standard ORM like Hibernate. I have done so. And if I can do it, so can you. And you should. You’re not good enough, you say? Well then you definitely should.  At least if you want to get better.  To be a great programmer you have to practice writing code, your own code, design stuff, try things, fail. Try again, fail again. Laugh about it, learn from it.
And for all you architects and managers out there - if you want a good team, you need to give them enough space to write some of their own code.  Maybe not on the most mission critical system, but something. Why should you pay them to write stuff that might not turn out that well, that might not result in great business value? Because it will make them better at their job. That has business value. And besides, maybe they’ll surprise you. Maybe they are awesome programmers and you just didn’t notice, because of their personality (or their gender?).

Now I stopped in the middle of explaining my custom DB-code last time, let’s see how far I get this evening.  I have to repeat that I’m not presenting a universal replacement for Hibernate/JPA here, I’m just showing you what I’ve done and hoping you might find some of it useful. I hope you can see that it can be done, that it can be fun and actually perform better than the official standard.

First a little recap. I’ve written some code that helps me connect to a relational database from java.  So far we’ve seen how to select stuff:

List<Child> children = db.runSQL(Child.class, “SELECT * FROM child where child_daycare_id = ?”, asList(daycareId));

Or, if don’t have any left joins or tricky where clauses, you can do the following:

List<Child> children = db.select(Child.class,
        new OrderBy(nickname, ASCENDING),
        new Where(child_daycare_id, ” = “, daycareId);

(To be fair, I didn’t mention the ORDER BY clause previously, but I bet you can guess how it works :-) )

We can update like so:

child.setNickname(“Luke”);
db.update(child);

Insert like so:

db.insert(new Child(“Leia”));

I don’t have a delete function, because I haven’t needed one yet.  I’ve only written code I have needed so far.  On purpose.  I’m a strong believer in emergent design. By that I don’t mean that a good design will emerge by itself. I just mean that designing should be a continuous part of your development effort. You should be thinking about design every time you put your hands on the keyboard.  And your fingers should be on your keyboard as often as possible.  Writing code. Changing code. Deleting code.  Designing too much up front leads to complex systems.  If I had sat down and created a design for my database API, I would most certainly have added a delete function up front. I would also have added left joins, fancy where clause handling that accepted groups of where clauses with both ANDs and ORs joining them.  I would have gone to town!  I wouldn’t have got started on the actual application until months had passed.  Whereas here, I am delivering business value at the same time as I’m working on my DB code. I’m always amazed by just how simply you can solve things, if you just stick to the problem at hand.  And unless you’re building a generic framework (shame on you :-) ), you can just stick to the problem at hand.  

I have a confession to make though. I also support aggregate queries in my “select framework”.  Just goes to show how hard it is to avoid designing stuff you don’t really need. I haven’t needed any SUM or AVG or anything like that, yet I still support them.  Here’s the syntax:

class DayCareChildCount {
  @Column(column=daycare_id) private Long DayCareCenterId;
  @Column(column=daycare_name) private String DayCareName;  
  @Column(column=child_id, function=COUNT) private long childCount;

… getters, setters, whatever
}

See the last column annotation? I have a function parameter there.  If you supply this class to the select function like so:

db.select(DayCareChildCount.class);
it will 
give you all daycare centers, with their id, name and the number of children in each.  I don’t have any HAVING clause-support yet I am relieved to report.  If I ever need this enough that typing out the sql each time becomes a hassle, I’ll think about adding it. 

Something I HAVE needed a lot though is linking items with many-to-many joins together.  So I HAVE created a utility function for this.  

public link(Object from, Object to) {…}

and 

public unlink(Object from, Object to) {…}

These methods look for the primary key in each object, finds the many to many relationship table that links them, and inserts or removes an entry from that table.

This means I can link entries together without having to create mapping tables for my many to many join tables.  In context, these methods are used something like this:

public void insertNewEvent(Event e, List<Long> childIds){
    db.insert(e);
    List<ChildPK> childPrimaryKeys = childIds.stream()
             .map(id -> new ChildPK(id))
             .collect(toList());

    children.forEach(child -> db.link(child, event));
}

Oh yes, I’m using java 8, by the way. Forgot to mention that. Love it!  What I also love is that since I’m connecting directly to the database. I let the database deal with all my state. I have no session cache to maintain.  My app doesn’t need much memory at all. I mean why do we need caches? It’s to avoid doing expensive data retrieval more than necessary.  Now what is the purpose of relational databases? To make data retrieval inexpensive.  If your queries make sense, there is no need to cache the data. Just leave it in the database. The only lists of data I have, are query results that go directly out to the client. I was a bit disappointed in a way. I was looking forward to using the new java 8 lambdas for what they were worth, but quickly found out that SQL does most of that already.  Why would I need to iterate over lists to extract certain fields, or update things based on certain conditions? SQL does that already. 

Another cool benefit of not having loads of cached data all over the place, is that all the clients can get database updates really fast. For this purpose I have made a BigBrother class, that I use for spying on certain rows in the database.  When a user logs in, the following statement is run:
myChildren.forEach(child -> spyOn(child, childUpdateListener));

myChildren is a list of children the currently logged in user is linked to.  By spying on them, the childUpdateListener will be notified every time any data on any of them changes. If the child changes their name, all users who are logged in, will see that change instantly.  What is more, if anything changes in something that has a foreign key reference to that child; a new event is added, that they have taken part in, they have been assigned a new grownup, whatever, the childUpdateListener also gets notified.   Whenever I do an update, an insert or a link, my BigBrother class checks if there are any spies registered to either the primary key of the updated class or any of its foreign key values.  All spies found get called with a suspectAltered(Object update) callback with the object that has just been inserted or updated as a parameter.  Straight away.  I just love it when apps are fast. 

I would put more code in here if it weren’t for the fact that Tumblr doesn’t make it easy for me :-( Need to get a proper blog.  As I mentioned already, the full project will be available for all by the time I do my JavaZone talk on this subject the 11th of September 2013. You can look over the details then :-)

 

Update: here is the code: https://github.com/christingorman/baxter (please don’t spend too much time, unless you want a laugh :), on the front end stuff, I’ve never really worked with javscript, HTML or CSS)

And here is my javazone presentation: http://vimeo.com/74354408