v/funny confidently fails at understanding good software engineering

0    05 Mar 2017 15:00 by u/darkofthemoon

v/funny had a highly-upvoated submission link to a twitter screenshot about the supposed differences between male and female programming. The point of the submission was to show that women don't understand programming by preferring the code on the right to the code on the left. (Probably those women had never studied programming.) Well, it looks like the presumably male audience at v/funny fail to understand too.

It kind of bothers me.

The code on the right looks like a Computer Science student's first or second homework assignment, because women can't program on a high level or something, except the author with explicitly-stated intention decided to have wrong program behavior when the numbers are equal because women's behavior makes no sense or something. (Let's not get into that.) There is also a pointless comparison. The code is clear and self-commenting and also has copious comments, just like Computer Science programs want it. Even a beginner student can understand that code and fix it.

The code on the left is advanced black magic, but much less impressive once you learn that it's implementing a pre-existing algorithm. The original code from had comments, but the comparison removed them because men never write comments or something. This is a clue that the original comparison was making fun of men too, or at least I hope so.

The code on the left comes from actual complex production software (DOOM), which means that its lack of maintainability is a serious issue, especially if the entire program is written like that. Among the highlights are a constant named "threehalfs" - with a value of 1.5, or three halves of number one - that is used exactly once - and a mysterious hexadecimal magic number 0x5f3759df that appears without an explanation or a name that could give a clue about what the number is about. (Maybe the original code bothered to give an explanation.) If the original author had happened to make a typo writing that number, I can only imagine how hard it would be to debug the function, even by the original author himself after some time had passed.

So I think both examples are bad in opposite ways, but at least the example on the right was clearly written to be a joke. I think the moral of the original graphic was that both extremes are bad, or at least that's what I get from it. It's possible that the graphic maker didn't understand software engineering either, I suppose.

0 comments

No comments archived.