Tom, Dick & Harry
jasq.org
jasq.org
So I quit, and here at my current employer, once again I mess around with monoids, rings & vector spaces, though I'm not really sure how any of this adds to my employer's bottom line:)
Matter of fact, my latest pull request (http://bit.ly/14EXMaA ) allows you to do weird shit like
add("twenty three",
"two million three thousand four hundred fifty five")
to get "two million three thousand four hundred seventy eight", because add is defined like so -
def add(a:String, b:String):String = EnglishInt(EnglishInt(a).asInt+EnglishInt(b).asInt).get> Tom was a PHP/JS programmer. He worked on rapidly prototyped web-apps and didn't give a rat's ass about efficiency.
Although I'm happy you quit and did not get fired, know this now does pull some of the poetry out of the above line, which I had previous read as some sort of backhanded a compliment given the other (fictionalized) ending.
Perhaps I'm being overly-sensitive but Harry comes off as really looking down your nose at "good enough". For example, there certainly seems no love lost on you and Tom fictionalizing (?) the character as Dick's "secretary."
Anyhow, if we're playing at parables, chances are Harry took advantage of the job market and his knowledge and went to work for a trading shop or hedge fund, making more money than any developer at the old company (150,000, really?) and not being hated for knowing stuff. And hopefully using a nicer language like Haskell or OCaml.
Also, if Dick's a "systems" programmer, chances are his code would actually be written in C, longer than the monoid Scala code and harder to read. It would be fast though.
Yeah, just pick 'a'; if he was in the database before 'b' chances are that he is the one who has been with the company for the longest time; and if that's a lie then is just as random as math.random anyway.
And he'd have written it over breakfast, while Harry was still pondering the side problem of analytically defining the volume of his bath tub :)
(As I pointed out in my comment: http://www.jasq.org/2/post/2013/01/the-mathematician-the-mon...)
Oldest guy who has been at the company the longest time? If I got a requirement like that I would first push back for a clarification, i.e., if employee A is older but employee B has been with the company longer, which is more of a candidate for elimination?
Tom (sorted version): 1510ms
Dick (min-linear version): 113ms
Harry (monoid version): 995ms
Fun performance graph: http://i.imgur.com/2rOvb6V.png
If that isn't the point, then I don't know what the point is meant to be.
[1] Assuming that there aren't any duplicate elements, in which case it technically isn't either a lattice or a monoid, unless you consider equivalence classes modulo attribute equality.
"Well", Harry said, "If you are asked to add
two employees, return the guy who is older. But
if both of them are the same age, then return the
guy who has been with the company the longest.
But if both guys have been working for us for the
same number of years, then return the guy with the
lowest salary. But if they both earn the same as
well, then just randomly pick one over the other"
I didn't think that was very hard to understand or verify.The key point is: Once you can define a binary operation which is associative, and an identity element I for which A • I = A, you can consider using monoids.
The basics of abstract algebra need to be disseminated more widely. These are not hard concepts.
Adding employees means exactly what it was defined to mean in the article. It's an associative binary operation.
One of my favorite quotes about software development is that the hardest part of it is not being clever. The flip side, though, is that even the simplest things can seem clever to those who don't have the same breadth of knowledge. In this case, Harry had a solution that seemed clever, but really wasn't that crazy at all. None of his colleagues understood it, but they should have, because it was actually extremely simple.
What's ludicrous about Harry's account isn't his solution or his notion of "adding" employees. It's that he understood these concepts and still took a day to put it together (or that he completely glossed over the more obvious approaches). He wasn't productive at all.
Anyway, as for the terminology, it's just a common name for an associative binary operation on a set with an identity element. If you've never seen it used in this way, I agree that it can seem bizarre, but the more you think about it the more you'll realize it is in line with a generalization of the sort of addition you do on integers.
To me, your complaint is like someone saying it's inappropriate terminology to discuss time complexity in big-Oh notation, because we're programmers, not mathematicians.
That being said, the manager asking a math major to do an information science task seems a tad incompetent.
Let me put it this way: If I was the boss and Harry had spent the day learning about functional programming then okay sure whatever. But if he knew all the concepts he was using and spent the entire day just to pick one then there is a serious problem.
Anyway if spoilers employee number 7435 was the boss and they have 10K employees and none with more than 6 years of tenure or making over 150K, Harry is lucky to be out of that place.
Now, admittedly, it's a little baity in that people who click might expect an age discrimination screed, rather than a programming parable. But even so, I think it's obviously better than "Tom, Dick and Harry".
And, if you're in the U.S. and the employee is over 40 years old, you automatically set yourself up for an age discrimination suit.
However, they brought in a new HR director and CEO that wanted to "shake things up" and the HR guy had a buddy from his former company that wanted to come in and work with him and happened to do a similar job that my dad did. You can probably guess what happened next, my father was fired without much of a reason. Those in executive positions that could have stood up for him were either in the minority or retired, so he had little help to back him up.
My family pushed him to sue, but he felt pressured into taking their severance package because he had to support my brothers and my mother and was worried about his prospects of getting a job in his 50s at another company (despite having a Bachelor's and Master's degree from well-known schools). He ended up taking the severance and waived his right to sue (at least according to the agreement he signed). He was also afraid that suing would blacklist him from employment elsewhere and it was hard for him to bring himself to sue the business he once loved. Coming from the age when many were loyal to their companies, even if the company was not loyal to them, he just couldn't do it.
Since then, he's applied at numerous employers for similar jobs to his own as well as other ones he could segue into. However, no one wants to hire him basically because of his age despite no intentions of retiring anytime soon. Now, he works a low wage job he could get without a degree from a university and it just kills me to see him like that. My only wish is to eventually grow my own business enough I can hire him myself so he can do something more respectable. He's not a huge tech guy like me so getting him into software development with me is a bit more than possible, but he's a smart guy that would fit into many other business and training related roles. However, those roles are something I can't pay for when I'm either working for clients, my own projects or with a friend right now.
Although age discrimination is against the law in the US, it's much more complex than it appears for most cases and suing is a difficult question that could hurt as much as it could help. I've always been reluctant to talk about my father's ordeal, but I felt I had to get it off my chest at some point.
edit: few grammar errors
The boss thing is cool, but it just doesn't fit with the suspenseful and ironic narrative that is being set up.
What sort of terrible, euthanasia-based, Logan's run-like, horrific fascist company are you describing in this bizarre little parable, and how come more of you people aren't looking at this with horror?! Are you so interested in the maths that the fact that the narrative surrounds it is so completely fucked invisible to you?! It's like a bloody survivalist post-apocalyptic zombie horror company. I'm surprised none of you are advocating mulching the thirty-five year old and using him to fertilize the office plants!
Why don't we shift it around a bit, Republicans are a bit dumb, right? And they care about money a lot. So if they're not earning 100k, they're definitely shit! Or maybe women? Not many of them are engineers, so clearly if they're earning too little, it's probably because their breasts get in the way of the keyboard.... Oh hang on, no, those things I just said were crazy insane. Like firing a thirty-five year old who doesn't earn very much.
There are people in the world who don't want loads of responsility, don't want to rise up a company and still do good work. People who want to spend time with their family and not work twenty-four seven and still do good work. There are people who are valuable holders of institutional knowledge, but are content to be junior engineers or whatever. If they do a good job, who the fuck cares how old they are?! How is that even relevant?!
And while we're at it, have you ANY idea how entitled this makes engineers in Silicon Valley sound?! I mean, engineers in the rest of the US don't make half as much money as the ones in the Bay Area. Even in London, a very expensive city, most engineers are not earning the equivalent of $100k within a few years of leaving college.
This story and the responses to it WEIRD ME OUT. It sounds like something that young dicks in the banking industry would talk about to make themselves feel really important. "Yah cos like he was only bringing home like three-hundred grand and he was like thirty five, so what a loser, right? Ha Ha. We totally got him fired and laughed at him because he's like totally old and by the time I'm thirty five, I'll be totally different because I'm really amazing and special and important, right??"
This whole thing is so depressing. Ive been wondering to myself for a while why it is that such a large proportion of twenty-somethings in tech around SF behaved like such idiots, and this has made me wonder even more. I'm halfway seriously thinking after reading this that all sensible companies should start thinking about how you should always fire any engineer under thirty earning more than 100k because, lets face it, they're fucking precious, self-important, entitled, whiny little unproductive fuckers who can't keep their genitals to themselves, get drunk too often during the week, and who've never had to do an honest days work for a reasonable salary and will remain smug, boorish twats until the day a proper grown up gives them the spanking they so clearly need.
What you are apparently so shocked by, and what you describe as "unbelievably dickish," is actually fairly common throughout the United States. A concurrent problem is the difficulty older people have in finding jobs after such a thing.
Do I agree with it? No, I'm not saying that. But your other examples are much more outlandish and, frankly, not on the same level of injustice. You seem to be crying out against this with the same passion that consumed many people during the Occupy Wall Street protests - this has been happening for a long time, it's not a recent development, and just now you are demonizing it to a much greater degree than it needs to be.
Again, I'm not saying you should be happy about it. But your parallel examples aren't parallel at all. It's age discrimination, yes, but what are you changing by posting this huge rant? And whose mind are you changing?
The author of the blog post wasn't trying to implicitly advocate for ageism. He wasn't make it a de facto axiom of proper business protocol just because he included it in his example. It's just a real world example.
My underlying point here is, in your shock at what is really a common phenomenon, you seem to have missed the point of the post itself. In fact, you have the opposite reaction...it was actually supposed to be a bit amusing, my friend.
I share most of your sentiments and I see why this article triggered this response from you, but I think it's out of proportion to what's actually being said in this particular article. This is 99% thought experiment, 1% bad humor, and yes, you have to read the whole thing to get to the joke.
It's being a bizarre privileged idiotic pre-teen that I'm pointing out is dickish - holding these beliefs, thinking they're even vaguely sensible or reasonable - to me these are people that need to be told that they're behaving poorly.
You may think its just the way of the world, but I'm suggesting, you know, maybe not being so self-involved and maybe recognizing that being in the first fifth of your career does not make you de facto the best person in any given room, and more importantly, something that you'll pass through relatively quickly before you get another forty years of being patronized by children.
It probably doesn't matter much since it's a throwaway problem and the database is known not to be empty, but it bugs me.
If a math major was interested in programming itself, in the meaning of programs or in neat abstractions for programming, they'd be in theoretical CS instead.
Do real math majors find the category theory in physics pretty dumb too?