18 December 2014

Chemical Reactions

Thus far on this little experiment, I've:

  • Overslept by 1 hour.
  • Completely lost track of time innumerable occasions.
  • Discovered an odd blurring & vibration in my vision.  Generally, it feels like I'm looking through a tunnel or a straw at the world.
  • Had insatiable cravings for caffeine and sugar.
  • Hyperfocused on assembly language programming and exercism.
  • Generally feel like I got hit by a truck--slow, plodding, etc.
On the bright side:
  • Mood is much better.
  • Sleep is much better.
  • Laughed more (that is, some!)
The next 2-6 weeks look to be rocky, but we'll see.  Some things have to change, and my brain chemistry's going to have to come along for the ride.

Fun with Assembly

I still remember an interview I had around February 2001, in which +Ron Garnett talked about how his team wrote code:
We write stuff in Assembler, because we're too lazy to write stuff in C.
Wait...what?  I thought the whole purpose of C was to have portable Assembly, so you could control the bare metal correctly.  I did get an inkling if you were that good, assembly could be seductive in your ability to do whatever you want.

This came to mind again when +Seth Moore posed a similar question on Facebook the other night:
Pop quiz:When you run this, what prints out? 

int i = 5;
int j = 10;
while (--j) { printf("%d %d\n", i, j); } while (--i); 
Basically, the above is a quiz to determine if you understand loops, expressions -v- statements, and the pre-decrement operator (--).  Pre-decrement specifies that the lvalue of the expression is the current value minus one and the post-state of that variable is assigned that decremented value.  Post-decrement has the same result (decrementing the value), but the lvalue of the expression is the PREVIOUS value.

As is my wont, I got the above wrong, but that's not the point.   To check my answer, I sucked it into quick c program using vim:
Compiling that program and using mac's otool to dump the assembly gives you this
Some things to note in the above:

  • The compiler has done a faithful job of translating exactly the program (as-is) to assembler:
    • We load the variables in lines 9 and 10
    • We have the first loop in lines 11-22
    • The second loop (despite being a no-op) is in line 24-29

Things get slightly more interesting when you pass the -O (optimize) flag

Some things to note:

  • This looks nothing like the C code.  There are no loops (or indeed, branch instructions) at all.
  • The compiler determined the second loop to be a no-op, and compiled it away completely.
  • Our stack variables are gone.  The compiler is using x64 CPU registers exclusively. 
  • The compiler has analyzed the loop and unrolled it into discrete calls to callq for the printf function.
Lastly:  The answer to the quiz is in the assembly if you look hard enough:

5 9
5 8
5 7
5 6
5 5
5 4
5 3
5 2
5 1

Pretty cool....I never get to look at assembly in my day-job, so getting this close to the CPU is neat.

17 December 2014

Rant: Stacked Ranking at Yahoo...yet another failure

From this article:

Mayer also favored a system of quarterly performance reviews, or Q.P.R.s, that required every Yahoo employee, on every team, be ranked from 1 to 5. The system was meant to encourage hard work and weed out underperformers, but it soon produced the exact opposite. Because only so many 4s and 5s could be allotted, talented people no longer wanted to work together; strategic goals were sacrificed, as employees did not want to change projects and leave themselves open to a lower score.
One of the uglier parts of the process was a series of quarterly “calibration meetings,” in which managers would gather with their bosses and review all the employees under their supervision. In practice, the managers would use these meetings to conjure reasons that certain staff members should get negative reviews. Sometimes the reason would be political or superficial. 

If anyone believes Vitality Ranking works, especially with knowledge workers, you're sadly mistaken.  The system breeds paranoia, malaise, and mediocrity:  

  • Paranoia, in that the employees know the above scenario is inevitable--calibration meetings must occur in which they're judged against their peers and forced into a distribution.  If your organization is rife with dead wood, man-up and fire them.  Otherwise, understand that forcing your "healthy" employees into a bell curve is akin to cutting off good tissue after you've excised a gangrenous limb.
  • Malaise, in that the employees know there's a sad inevitability to the process.  Everyone knows who the "golden boy" is in your rank.  Generally, he's the sycophant, workaholic who's constantly the smartest guy in the room.   He's the '5' in the above scenario.  You also know who the loser is in the group, the "Well, I'm not as bad as ______." He's the 1.  He's dead meat.  So, ensure you're not last and you "win," sort of.
  • Mediocrity,  in that this system makes you continously gaze INWARD.  Managers don't like it...they spend inordinate amounts of time doing QPR's, paperwork, and susbstantiation.  Employees obsess about it, because they might be on the chopping block, so you start funneling "achievements" to your manager so he has ammunition for the calibration meetings. INWARD looking means You're not competing.  That's fine for GE (oh wait, no it's not), but for any company without a substantive monopoly and barrier to entry in their field, it's the first step towards destruction. 
If Mayer instituted this at Yahoo, then the company deserves to go down in flames.


14 November 2014

Spotify Model, the Darkside

Ah, the Spotify Engineering Culture.

We've all heard the gloss:  Small, independent Squads organized into buzzwordy terms like "Tribes," and "Guilds." These terms hearken to days past in humanity, days of community and craftsmanship.

Here's what I take from the above:  None of that fricking matters.  What really matters is a throwaway blurb at the very end of the video, starting at 12m 30s.  Transcribed here:
We've learned trust is more important than control.  Why would we hire someone we don't trust?  Agile at scale requires trust at scale, which means NO POLITICS.  It also means no fear.  Fear doesn't just kill trust; it kills innovation.  Because, if failure gets punished, people will be afraid to try new things.

 There's the secret sauce:

  • Hire the right people.
  • Trust them.
  • Dump the politics.
  • Expect failure and deal with it appropriately.
* * *

So here's the thing with the above:  I question whether it's sustainable by any organization of human beings.  Organizations have a natural succession, like a forest.  When the forest is just beginning, certain types of plants and animals thrive.  As it moves towards being old-growth, those new plants just don't fit anymore.  Then, a fire comes and kills the forest, and the cycle begins anew.

Spotify seems dedicated to keeping itself in that 'Succession' phase, with maximal growth and competition.   Can it sustain that?  

The dark side of the model is, ironically, that it is so trusting of individual performance and correct behavior.  That is:
  • Talented individuals need to be in all the roles. (To the "Hire the right people" statement)
  • The organization must not apply too much control.
  • The org must staunch natural human social behavior (read: politics).
  • The org must embrace failure and not blamestorm.
Said a different way, the Spotify model trusts human beings to be "good."  Once sociopathic behavior emerges, intractable egos, or other issues emerge, there's no indication how to deal with it.  I'm sure there's a copout in there somewhere: "You're doing it wrong." (e.g. you made a bad hire, etc.)  

Look, one bad hire should not crater your product delivery, okay?

The tagline occurs to me is this:
I don't trust the code I WRITE.  Because of that, I write unit and integration tests.  QED: People are fallible.  The spotify model asks me to trust a conjoined web of dependencies to ship my product?!

02 November 2014

My Longstanding Battle with Skating Continues

Me: "Hey Joey, what would you like to do today?"

He: "Let's go iceskating."


She: "Dad doesn't do iceskating."

Me: "I can do it if I have to."

* * *

Ah famous last words.

I've been working alot lately.  Let me rephrase:  I've been working roughly 9:30->8pm M-T-R-F.  I haven't been working late Wednesdays because of Church, and not Fridays because something usually comes-up.  I haven't been able to spend much time with my son, and we're both missing it.

But...skating?   I hate ice-skating.  I actually went into our marriage with two agreements:   Whitney doesn't have to go on any ski-lifts or high places and I don't have to skate.

Then somehow it became a matter of pride and I said we were going.  Besides, we had a coupon for 1 free skate with another paid admission.  So, we went.

Joey was having lots of fun, and I made it it around the rink 2 times in an hour without falling.  So far so good.  My feet hurt and my lower-leg muscles were fatigued. (Yes, we're talking two slow circuits of the rink here, pathetic as it sounds).  I sat down and decided I was done, then like a punk with something to prove, I got up for a 3rd time.

The third trip didn't go so well.   In an attempt to help my throbbing feet, I loosened my laces too much.  I somehow missed my wife's texted admonition to "keep the ones a the top tight."   I made it maybe 15 yards onto the rink, then I fell pretty hard, backwards.  I tried to twist on my side like they tell you, but managed only to bang my shoulder, wrist, and right forehead.   I lay on the ice feeling like a class 'A' idiot, and everyone was looking at me.  My head was bleeding.  Not bad, but it didn't look good.  I didn't get a concussion or anything, but I was a real asshole to the entire staff and concerned onlookers.  

"Er, did someone cut in front of you or something?" a well-meaning 60-ish skating coach asked me as I sat down awaiting an ice pack.

"No...I just CAN'T SKATE, okay?"  Then I threw my skates off like a 5 year old disenchanted with the toy whose batteries had run out.  

Then the manager came over, "Sir, I'm Mr. Dewflotchy and I'm the manager...do you need anything?"

"Yes, you can LEAVE ME ALONE."

I wasn't mad at them.  I was mad at me.  I felt humiliated for yet another FAIL at the ice rink.  I knew I was fatigued and that I'd reached my limits.  

Worse, this is another in a string of 16 years of incidents at this very same place.

So we left.  I felt woozy, then got home and Whitney suggested I visit the ER.   Three X-Rays and a Band-Aide later they sent me home with a clean bill of, "That's gonna hurt in the morning."

* * *

At this point, I've no idea if I'll ever get on a rink again.  I'm pretty fed-up and I've got nothing to prove to anyone.  God bless you folks who like to glide across frozen water; it seems I'm not fated to become one of you.   I've spent maybe 3 hours total on a rink in my life, and hated nearly every second of it.

All this makes me really sad, like I'm a quitter.  Mostly, I regret how I've acted after the incident.  I was a real dick to the people at the ice center who were just trying to help.