Thursday, July 24, 2014

[coding] Making the Enemy Come to You

Previously, I may have written about someone that I got in a fight with at work.  That, or I wrote an unpublished draft and then just complained in person at parties.  I do that a lot now.  Anyway.

The person I got in a fight with is kind of a big deal.  He is basically a manager;  that's not his title but that's the basic role he does.  One of the things he manages is an Android app that uses the thing I own.  We'll call his team "Partner #2."  This guy knows nothing about Android.  It got as far as him being on a call with a bunch of super important people, telling people in my organization that we should rewrite the WebView control.  In two weeks.

Anyway.

My real beef with him wasn't actually the stupidity.  I mean, stupidity by itself?  That's just like a normal Tuesday in the corporate world.  No, this guy decided to (or was told to) use the software my team owns in the android apps his team makes.  So I can understand if he's not happy about that.  I mean my team has literally spent a year and a half corrupting our code for partner #1.  However, instead of talking to us about Partner #2's needs, he had his team just take our source code and fuck around with it.  Then he did come to us, to tell us what we should to with our component, and also to tell us that we should use the same development tools as those fuckers, to make it easier for them to fuck around with our code.

Given that I'd had a constant stream of headaches and a six month project delay caused directly by Partner #1 fucking around with our code, I wasn't about to allow a second partner to do it.  I jumped all over this situation, trying to quash it.  Unfortunately, this guy was better at politics.  He called me defensive or embarrassed or something, so I gave him a list, from memory, of every single problem that happened because partner #1 fucked around with our code, and he ended our conversation.

That was then.  Since then, a bunch of bullshit with partner #1 happened.  We are, theoretically, shipping our crap to them a mere 6 months late.  I've stayed at the office past midnight on a number of occasions in order to make that happen.  I still don't believe that it is going to happen.  For example, those layoffs in the news?  Yeah, they fired the entire test team.  During the test pass.  For the release that is 6 months late and which will slip another two months if we don't get it out in a certain window.  Its cool, though, man, because...because "test automation."

So partner #1 is placated for the moment.  Back to partner #2.  According to the PMs, partner #2 was breathing down our necks for an early drop.  So I burn the midnight oil once more and get the feature working a week and a half ahead of schedule.  And this is where things get interesting, and this is how I accidentally learned a very specific political move.

One of the tricks I used to get the feature done earlier was to not use Test Driven Development (TDD) and, to actually not write any unit tests (yet).  I just coded the entire feature in one shot and  ran a few tests by hand to know if its working.  Without unit tests though, I can't check in the code.  I can only provide the built version by email (obviously since M$ didn't write Git we have to use a centralized source control system instead of Git, and this source control system is allergic to java, so...email becomes a surprisingly key component of our build system).

Sounds like a simple detail, right?  It is.  But it becomes very, very important when you are dealing with a team that needs to stop sticking their fat fingers into your source code.  They need this particular feature I wrote, badly.  They need it more than all of the bullshit reasons they made up to fuck with my code without talking to me first.  And the only way they can get this feature is if they integrate with the thing I own properly, using the built jar file I provided.  This, my friends, is called leverage.  

And, sadly, I literally didn't realize that a strategy like this could exist until I did it by accident.

So, I doubt, dear reader, that you will ever need this exact strategy.  I am simply sharing it to add to the knowledge base that you will draw on for your own political battles.

Unless you work in one of those places where all you do is write software.

They should really make a version of the office, but for jaded corporate programmers....

Monday, July 21, 2014

[fiction] Damaged Goods Part 4

There were a number of horse drawn carts in the street that night.  Fog swelled up from the banks of the river, spillover over railings of the bridges and choking the torches that attempted to light the streets.

It was through this murky scene that a dark red kawasaki ninja 650 burst.  It flew along the ground at unbelievable speed, approaching carriages stuck in mud and careening off the path and onto the frozen river, which made for a much less crowded method of access.

The rider wheelied and slammed the vehicle down in anger.  There was fireglow on the horizon.

Many leagues away there was a castle under siege, its outer walls broken by hellish engines, its battered, starved, and tired knights bending under the blows of ugly, foul, and green skinned but humanoid monsters.  The inner keep, once unassailable, was decorated with assault ladders and potmarked from stone projectiles.  It was only a matter of time.

The captains rallied their troops, falling back, back, back from the hellish green tide.  But then something happened which they did not expect.

The previously mentioned sportbike shot through the outmost gates.  Something had upset the delicate two-wheeled vehicle, and both machine and rider were flung tumbling across the flagstones.  The rider, however, caught the upswing of a trebuchet and, by letting go at just the right instant, modulated the force propelling him in order to fly over the inner walls and land at just the right spot in the courtyard.  He landed, rolled, and skidded to a stop, ripping of the motorcycle helmet and bashing it into the face of a nearby monster.  The man underneath worth a strange, silly hat that looked like a money with white patches.  Pom-poms danced around as he whipped his head around, aiming a shotgun at the far wall.  The first blast leveled three of the invaders at once.

The rider ran up the steps to the inner keep, firing his gun three more times to clear orcs out of his path.  He reached the next level and saw an orc standing over a soldier in plate mail, about to strike a killing blow.  The rider blew that monster away and ran.

Above, he could hear the scream of a dragon.

The rider dove into the thick of the battle, engaging the enemy at point blank range, occasionally parrying a black axe with his shotgun.  Over and over again a pack of monsters would turn a corner and be leveled, one or two or three at a time, until the last remaining would  have hit skull blown apart less than a meter from the business end of the shotgun, body in the air and arm still swinging some melee weapon.  The rider fired again and a again, reloading on the run, until he was out of shells.  Moonlight gleamed off of his motorcycle armor as he pulled his sidearm out and began shooting with that.

The dragon flew around a tower and bathed combatants in flame, not really caring which side they were on.

"I'm coming for you," said Snow Monkey.

He ran, up, up, up, through the inner keep, to its roof, up more stairs through towers, more stairs, more towers, and then up to an impossibly high and long bridge.  His quarry was ahead, occasionally appearing out of the black smoke, only to disappear again with the beat of its wings.  He had it.

Snow Monkey reached the edge of the platform.  He readied his gun, sprinted, and prepared to leap, until--

An enormous bright glow ushered out of the clouds, accompanied with a ringtone--10 notes of a poorly synthesized flute.  It was a giant cell phone, and the screen said "Incoming Call ... Dave."

Snow Monkey slipped falling backwards, but he had too much momentum.  The gun flew out of his hand moments before he slid off the end of the ledge, falling face first into the black-


"Snow!"

Snow Monkey burst upright in bed, nearly colliding with Nika's head.  Outside, a storm raged and rain poured down the windows.

"Are you ok?" asked Snow.

"Me?  You were practically screaming in your sleep."

"I was just chasing a dragon."

Nika looked at Snow with that mixture of disbelief and ambivalence that he knew so well.

"If you're having trouble sleeping," he said, "we can cuddle, but you take big spoon."

Nika slapped him, hard.  Then she pointed in his face.  "Go the fuck back to sleep, and be ready tomorrow.  I want top five."

"Good night pumpkin," Snow Monkey called out as Nika left his hotel room via the adjoining door.

One day, he told himself, he would catch that fucker.

Monday, July 7, 2014

Ride or Die

There's not a lot you can do after working 10 hour days at your current job.  But there is some.

Well, really, its 10-12 hours days, plus often 1 day on the weekend for the day job.  Then I spent whatever is left of my brainpower on the startup.  Then, we are also trying to get around to unpacking boxes and buying more shelves.  I literally don't have room to unpack more objects until I buy shelves.  And then, also, we are trying to build a social life, starting almost completely from scratch.

Fortunately, I'm pretty damn sure I can do this.  My current situation at work...well I'm the one who got myself into this.  Yes, we have a demanding client that expects bullshit from an invisible spec, and teammates who didn't know you couldn't really put mutable fields on enums (FUCKING HELL), and yes we have some project managers that seem to be in constant denial.  However, well...let me make an analogy.

Picture yourself coming up to a yellow light on a motorcycle.  You slam on the brakes, stop way faster than a car could, and come to a rest just before the line just as the light turns red.  You watch the cars about to cross the light when BAM some idiot in a car (and not a duck boat--if it was a duck boat...fuck those cunts) runs you over.   Whose fault was it?  It was your fucking fault (again, unless it was a duck boat, in which case we should trade information so I'll have more incidents to report the next time I proactively contact another victim's lawyers).  The universe doesnt care who was legally at fault, and its not going to unsnap your spinal cord just because you followed the rules.  No.  You got on a fucking bike and drove on public roads, with all the idiots in cars.  You should have known better.  You should have checked your mirrors and possibly ran the red instead of stopping.  You should have tapped your brakelights on and off when you slowed down.  You should have sat with your hand squeezing the clutch, the bike in gear, and your eyes watching the car behind you approach in your rear view mirror, ready at any second to punch it and get the hell out of there.  It was your fault.

In the same way, my project situation is my fault.  I knew that Shitty Customer #1 was not going away, and I knew that the mediocre dev who is barely able to absorb their interference was going on my vacation.  I also knew that my predictions were falling on deaf ears.  Still, I made a schedule that would assume I could dedicate all of my time to Customer #2.  Yes, the schedule was padded generously, but generously wasn't good enough.  What I should have done was push my estimates to the breaking point, padding them to such a ridiculous extent that my manager almost overrules me, and everyone--or just the test guys--think I'm  full of shit but can't prove it.  That is what I will do next time, because I will learn from this, and this isn't happening again.

My current predicament will last until the end of July.  That's when my code is supposed to be done for Customer #2.  So, yeah, I fucked up and it cost me more than a month of my life, but you gotta learn from this and move on.  So the schedule after July can be fixed.

Until then, we're gonna have to keep it pretty damn simple.  The programmer I contracted for the start up is...sadly...not quite good enough.  I trust him with small, easy to code features, and that's about it.  So I guess I don't have a great plan for this one.

However, the social thing...that's simple.  Obviously I'm going to continue playing volleyball, and then whatever sport comes next, and after July I'm going to find a salsa or bachatta class.

July is not going to be fun.  I'm going to be overworked, and I'm going to be alone, and every time I feel sorry for myself I'm going to remember that I'm the one who didn't pad my estimates enough, I'm the one who made the schedule, and I'm the one who is about to make overestimating tasks an art form.  Of course, "overestimating" isn't really the right word if the end result is simply working a reasonable 8 hour day.

Friday, June 20, 2014

[coding] Code Crime

Please, consider the following:

public enum EventType {

    SOME_EVENT,
    ANOTHER_EVENT;

    public long timeElapsed = -1; //and this fucking gets set at multiple places in the code
    //and why the fuck does this compile?!?

}


That is all.

When asked why we can't do this, a monstrous, unstoppable tide of righteous anger smashed into an immovable bastion of self control, and I ended up growling "Its an enum" through gritted teeth.

Monday, June 16, 2014

[coding] Fucking Programmers, Part 2

Continuous Integration is a subset of Continuous Deployment, that sexy thing that programmers managers love to talk about getting it.  I actually had a service called Pokey that was fully on Continuous Deployment, and had a checkin-to-production time of 6 minutes.  Unfortunately my manager, Mr. Crankypants, told us to turn it off for unrelated reasons, but I still remember how easy it was to get there.  So, I went ahead and designed a continuous integration system for my current team.  You check in, it auto builds, and it automatically runs the tests.  My manager was super impressed, and this was probably the biggest contributor to a promotion.  Unfortunately (foreshadowing), no one else on the team seems to understand or recognize the point of continuous integration.

Anyway.

I was only gone for three months.  In that time, the team managed to:
  • make dozens of sloppy changes without any regard to design
  • introduce a feature that only works because of a memory leak
  • broke continuous integration, and never fucking checked it, so that
    •  we can no longer automatically build the drops to give to customers
    • and the tests no longer run automatically
  • broke the command line form of the build, which prevents us from automatically generating documentation, and also is going to look make us look like fucking morons as soon as anyone outside the team finds out
  • broke the unit tests
  • broke the test ads by commenting them out, instead of moving them to the test project
    • including a special test ad that I spent a week convincing a team to write for us specifically so we could automate more testing
Again, this shit was working when I left, and it is now broken.    They pretty much broke everything--everything automatic.  There is this test framework that you have to run manually.  Its called "automated test framework," so that's funny.  The manually automatic framework does work a little, except for the broken tests.

I am gaining a very interesting perspective on software development.


Friday, June 13, 2014

[coding] Fucking Programmers

At work:

Intro:  one of the devs--my only dev--seems to have improved considerably during my absense.

Foreshadowing:  seems to

So, he copy and pasted one of my unit tests, and then he uses a FIVE MINUTE THREAD SLEEP in his fucking test.  Who the fuck thinks that's acceptable?  That's worse than a broken test.  When a test is broken, you look at the error message and figure out why.  When a test thread sleeps for a whole 5 fucking minutes, you start to wonder if the ADB bridge went down, or maybe Eclipse put itself in a deadlock, or maybe your fucking phone crashed.  Who knows?  You don't, because you're just sitting there reading reddit with the frozen junit test in the corner of your eye.  The entire test run takes--or should take--less than 5 minutes.

And the most annoying thing is, it doesnt have to be 5 minutes.  I've already written the configuration override gear that lets you change the timing values in the unit tests.  In fact, the lines that change similar config values were part of the shit he copy & pasted from the test that I wrote.

Five fucking minutes.

At the Startup:

The contractor I asked to integrate dropbox functionality has managed to find some kind of mysterious Android SDK that does not appear anywhere on the fucking dropbox website.  I don't even--wait, I just figured it out.  Man that just goes to show:  if you want to solve a mystery, start bitching about it on blogger.

Anyway.  Dropbox thought it would be fun to have one API on their website, complete with documentation, and then another, completely different API, in the .zip file that you download when you download the SDK.  I'm not even kidding.  There isn't a single class file here that matches anything on the website documentation.

Normally, when I write java code, I use a special javadoc website called google, where I just type something like "java InputStream" into the magic box and the javadoc is the first thing that pops up in the search results.  Unfortunately, "java AndroidAuthSession" does not return anything useful.    I'm going to have to actually manually navigate this javadoc folder in order to find the documentation I need.  What am I, Amish?


Conclusions

My accomplishments for the day include fixing the unit tests that someone else broke for the second day in a row, and also finding a javadoc hidden in the bowels of a zip file.

Monday, June 9, 2014

Imagine

Today, one of the devs on my team sent me an IM.  He mentioned a current issue we are dealing with, and then referenced a specific line of code.  For a brief moment I experience some kind of profound joy.  I thought to myself, "this must be what it feels like to write code with other people!  I want to do this more!"

Then my coworker proceeded to suggest that we solve a performance non-issue by introducing a race condition.

I'm going to remember that feeling though, and I'm going to find good people to work with, somewhere, somehow.