I have made it... Douglas Adams would be proud.
A blog about my rantings, including Games, Game Development, Gaming, Consoles, PC Gaming, Role Playing Games, People, Gaming tips & cheats, Game Programming and a plethora of other stuff.
Sunday, 7 June 2020
Friday, 5 June 2020
Worst Idea in Development Ever
I'm casting back a long long way, over 15 years to be imprecise as I can, and talk about the worse idea in software development ever.... To perform a group code review once a week.
But before I can do that I need to talk about the good way to do this, code reviews should be non-intrusive for the majority of team members, they should be able to dip in and out, they should fit it into pieces of their day which are spare or otherwise dead time, and it should be use as a tool to not only review the code but introduce familiarity to other people's work & progress to everyone else.
So what was wrong 15 years ago? Well, the important point about the good way of reviewing code was to actually be able to see the code.... When this new review process was introduced all those years ago... the code was on a machine, whilst we were all in a meeting room and the programmer stood up and verbally described the code to us.
Yes, verbally describing what took all WEEK to do, neither conveyed to us what was being done not shows us how, we were unable to help debug or sense check the logic, and it gave zero oversight into how the code was built, was it efficient for example (we'll come back to that topic in a moment).
And of course the planned one hour meeting was excruciating to be in... and only one developer got to speak in the first session.
There were 6 staff programmers and we were augmented with 6 contract programmers, the "lead" if you could call her that programmer went first... and her presentation was on the hardware to database connection.
It used a Marathon database, which I've just googled and humorously I can't find any references to that product. And the "lead" had been using it at her prior role on Java based programming, here in C we were a little perplexed by her approach.
For she presented that from the high-speed buttons and lights on the hardware, which had to flash fast and had to be responsive to touch, she had written a system which took the impulses and inserted the values into a "Buttons" database table. And then another on a loop which polled "SELECT * FROM LIGHTS;" and pushed the "on" or "off" states of the resulting list (from left to right) to the hardware.
Of course was immediately obvious to all but the lead, the manager and her office buddy, would not fly and the three different members of the team, all infinitely more familiar with the hardware and the C language than this lead, pointed out that it would be slow and unresponsive. That we were on a single core machine so you couldn't just ignore that the database driver would wonder off and do it's own thing, as well as be constantly interrupted by the processing of our system, and the system itself was to be host to third party software which we could not ourselves fully control, so they might run with a tight loop starving our system and especially starving (what was then) a low priority database driver service.
All in all it sounded a REALLY bad idea.
But, she'd already done the work. The manager had already signed off on her idea in a series of closed doors conferences with her, and her lone office buddy made it clear he was on side.
It was 3 staffers verses 3 "senior" staffers.
It was fact, this was going to happen.
Which brings us to an obvious fault in this "Code Review" no-one could actually get anything changed, we were really there to be told of the fabulous innovation from behind the green curtain. We could not divert, advise nor simply appreciate the good, bad or ugly in this system.
So it was revision one (of twelve) was issued and immediately a real piece of content (a game) was played on the system... This game already worked on the old system we were replacing, so its behaviour was well established. And immediately all the lights started to behave badly, they would he updating visually, we could see, from left to right... rather than all coming on together and going off together.
This was puzzling the micro-controller sending the light signals was a 32bit register, you just set the binary representation, and the micro almost immediately lit or extinguished the bulb... Why was it showing this left to right behaviour?
The three of us whom had descented said "are you going through that lights query as a list and applying it left to right?".... "No" came the reply, but she soon disappeared and came back with version 2.
Which STILL turned the lights on left to right, but subtly so, we could see it and the experienced play tested protested it was, but to the uninitiated it was just about passable. So it went into test proper.
And they reported the same, but opposite feel to the buttons, that they lagged from right to left, and lag they did.
To her credit the "lead" didn't dismiss them and went to actually play the machine, yes she'd not played it until now... and immediately version 3 was issued.
Again, as with the lights, the lag was still there, the left hand most button was the most laggy, and that would make sense if there was a loop which was working through their being updated from right to left for the buttons and left to right for the lights.
But she insisted that there was no loop.
And we had no oversight on the code, even though we had "reviewed" it.
The next morning we walked into find her already present, version 4 had gone down to test. The tester had put a different game on, which did a different series of light patterns and reported "It doesn't look right at all" (except he'd not been as polite) spurring the new version.
One of the more vocal of our group went to the manager and said "this going through a database is the madness, no matter what she's actually doing in the code, it can't be fast enough to feel like the old direct to hardware system, we need to remove this layer and just go direct".... but the manager didn't want to upset the "lead" so persisted with the database thing.
Release 5, 6 and 7 went down later that day, then about lunch a machine was hoisted up the fire escape stairs and into the office wheeled all the way and plonked next to the lead, she was to debug this properly.
Release 8, 9 ad 10 went only to this machine next to her and the tester was duly dragged up and into the room to sit, painfully, next to her explaining how it should plan and indeed he insisted the old system be wheeled up and plonked right next to the new borked on.
The two boxes side by side it was immediately obvious the new database driven system was really Really REALLY slow compared to the old one.
"It's the database" voices said.
"It's the loop" others called out.
"There is no loop, and the database is fast!" She persisted.
None of us from the C side bought this, and still could not see the code (code revision control is a topic for another day).
Finally, it was Friday, version 10 had remained for all of Thursday, but Friday came and something had to be done. The engineer responsible for the board, the actual micro-controller was brought in, and he immediately ran his test routine on the board showing the lagging and we saw it being solid behave correctly and work, despite the lass having decried her board was faulty.
The hardware engineer had a view none of us got, he could see the code, he sat beside her and with us all gathered around he blinked, looked at each of us and then looked at the code, then turned to the "lead" and said "you know you can just sent the unsigned 32 bit integer directly to that register, all in one go?"
She looked at him and asked what he meant.
"Well if you want to turn it all on, send zero"... if you want to turn them all on send 4,294,967,295"
She blinked and looked at the code and then back at him, "I don't follow".
The hardware engineer looked at all our eager faces, three of us knew what was coming.
"Well, you don't need to loop through each boolean and bit shift them one at a time into your register sending them one at a time, you can still loop and bit shift them all in if you like, but you can sent the command once, set the lights to the value in the register once".
Three of us left the room, the manager looked dumbfounded and a little thunder struck, her office pal was notably quiet.
Version 11 came out about an hour later and the hardware engineer went to leave, popping his head into the office of the 3 of us on the C side... "Why wasn't this picked up in review?"
* Throughout you've seen me put "lead" in air quotes, this is intentional, the lass was not a lead, not as we'd describe today, she was just the loudest voice in the split office, she was furthest from the manager and had this knack of making you feel like she had ALWAYS been there and always been in charge.
I strongly believed she had been at the company for years when I started.
It wasn't until years later that I discovered she had only been in her role two weeks longer than me, two weeks in which she had moved from direct hardware peek & poke to via database.
* Version 12 : Yes you guessed it, version 12 was to remove the database from the hardware interactions completely, an abstract layer was built holding a representation of the hardware in memory and that representation was twiddled from the database side and it's representation imposed on the hardware by directly poking.
Labels:
bad,
Code,
Development,
dumb,
History,
life,
management,
myself,
People,
process,
programming,
projects,
Review,
silly
Thursday, 4 June 2020
When the Manager Went Fishing
A long time ago in a work group far away there was a bunch of problems coming up in a code base whilst the manager (who had written the very code we were debugging) was up to his knees in a Scottish stream on a salmon fishing holiday....
So yeah, the code didn't work, it was a statemachine implemented in a bunch of "if" statements a smattering of switch statements and flags which were not properly mutually exclusive... so it was a statemachine in name only really.
This particular piece of code was responsible for paying money out of a machine, and as such came under scrutiny when customers started to notice that it was either paying out more than expected or the players of the machine noticed it was paying far less than expected. A double whammy.
This problem was looked at first by a chap in the team who didn't really get along with anyone else, and he asserted he had solved the problem... I wasn't his manager, but we accepted his word on the matter and issued a release. This turned out to be the start of a series of problems, for with the focus on this problem the test department took it upon themselves to actually test this fault to within an inch of it's life, and of course they found the problem persisted.
The wheels then came off this development train.
For the technically senior person in the department didn't get on with the chap who had looked at this problem first, they did not get on at all... not one jot.
And I ended up sitting between these two as both a debugging sounding board but physical altercation deterrent, which it's a great place to stand between coworkers who really just needed to grow up.
The debugging progressed from the mess of code into a rewrite of one function, and this started with a large discussion around a 10 foot white board (I love working on a whiteboard).
We came up with the expected behaviour, worked out the inputs we knew and then how to get that expected output to physically happen, and did so.
It worked, it would have taken that one day.... The test department were happy with their results.
The problem? All releases had to go through review and the binaries built and packaged by one specific person... The Manager... who was still scaring salmon with a pointed stick.
We had to get on the phone to him, do you know how patchy mobile reception is in the highlands?... No... Well, "VERY" is the best way to put it. We managed to speak to him twice, but then had to get his permission at every step, "Do the work" it's done, "build the binary" it's built, "package the update" it's compressed, "create the release notary" it's written...
All these calls back and forth to stitch together what should have been my simply putting the package on a flash stick and handing it to the test department (because they tested everything off of our network to be as real to our operating environment as possible).
It was a nightmare... An utter break down in co-worker communications between the other two chaps, the manager not releasing the reins of control*... The slow turn around of a build and messy nature of the codebase we had to edit... not to mention that the problem was subtle and caused by a miss-understanding between the true behaviour of a physical device compared to the expected virtual representation of it within the system's view.
There, that's what happens when the manager went fishing.
* In the hope of accruing himself come modicum of job security by appearing to be a key man.
Labels:
bad,
C#,
Coding,
debug,
Development,
entertainment,
error,
gambling,
hardware,
History,
People,
silly,
team,
whiteboard,
work
Thursday, 28 May 2020
That Work Life Split Under Covid
With the lockdown and working from home I'm finally doing something I always thought I wanted to do, work from home. I'd always had the niggling thought I could be more efficient and it would be really good to be able to work from home. Oh my... Oh Me Oh My How wrong was I?!
The first elephant in the room, work-life-balance, I work in my home office, my home office where I write this blog and make silly videos and play and read... And... so when I've been in it 8+ hours a day, I don't want to look at it any more... I don't sit at my office desk craving to be home chomping on some private project, because I'm already at that home desk and the lines have been blurred.
Second, the family... Specifically (sorry love) the wife... She's no concept of being in the zone, as a programmer, when you're in the zone and been doing something niggly all day and everything is finally falling into place, no matter the time, you stick at it to get done... No, my wife can't comprehend this, she doesn't understand everytime she shouts "Come on now"... It's another 20 minutes because you just mentally ravaged my trail of thought... Put headphones on?... Yeah you don't know how loud my Mrs is.
Third, hours... I touched on it a little above, but there's no quantitative way to express what you're up to. I feel, quite strongly, that if you're not producing something (like code) and being seen to, you're looking absent from the work place... You're at home, not right there doing your thing. Recall, I'm quite used to sitting typing for hours on end with folks wondering quite why my keyboard is so loud. I get a lot of feedback from that presence in the moment in the office. Without that feedback, I'm feeling more than a little fraudulent, especially as when software engineering tends to do, things go awry and you're then asking for more time... I've literally had 2 weeks on a project, then a week off (yes, I had a week off at home) and then I returned and asked for another 2 weeks... and I'm pretty much about to ask for yet another... based on the original 2 week estimate I over egged this pudding... But I have been working frenetically, except I feel on the other side... they might not see it that way.
Fourth, being somewhere else, this might sound obvious, but I'd never appreciated it, rolling out of bed stretching, getting a coffee and walking a few steps into my chair always felt like bliss, when I did it of a weekend and got on with some project it always felt so right and clean. Now, it's sullied, it's forced upon me, it's the norm... and to be honest, it's doing my head in. I miss the commute, the hour to decompress either way.... I miss that moment where I get to just be in my own head, in my own space in the car on the tram or just walking.
Whether that last part of the pre-virus world ever returns, I could not say.
Sunday, 17 May 2020
By my But
I'm a little tired of my touch typing being out of practice, having been coding for a long time, I've let my actual narrative writing fall by the way side, and I've noticed a decline in the accuracy of my typing that must be addressed.
This will mean time, time writing, time throwing things on this blog perhaps!
However, the biggest problem at the moment is my fingers being asked to type the word "by" and I'm often caught out typing "but".
Which is very very annoying.
Saturday, 16 May 2020
Welcome Readers and Unwelcome Spammers of Turkmenistan
I've had a rather large influx of viewership from Turkmenistan... Welcome....
Unfortunately this has been accompanied by a campaign of dross appearing in my comments, span and junk and all sorts of dubious links.
Friday, 15 May 2020
Goodbye Childhood Confidence
My best game of charades got crapped on... This is a grudge, a very old grudge, for this happened when I was 8... Yeah, I don't let go easily.
It was a life lesson, which put the nail on my opinion from experience that as a child adults can be dumb and remain so outside of their own specific fields of interests, and will miss no opportunity to knock a child's confidence.
What was this about? Well, it came after a string of little things where adults put me down, my mother would not accept that "ambulate" is a word... And before you start to say "why didn't you just google it and show her?... well, there was no google, this was the 1980's. There wasn't even a dictionary in the house!
She'd also in correctly corrected my mental arithmetic on numerous occasions, which set me on the path of a life not trusting my own number skills for life.
TL;DR; I'd had a load of adults putting me down...
Anyway, the story.... I go to school this day, you know school; where all the teaching staff encourage learning and being clever like.... Well... No.
On this day, we were all given over to full charge of the schools one teaching assistant, because the teacher herself felt very ill, the teaching assistant, who I will call Mrs C, had no idea what to do with us so we played charades.
Each child was asked to think of a TV show they had watched the night before and to come up with a sign or gesture for it without speaking and we each had to guess the show. Recall there were only 4 TV Channels at this time, and most of us played out right after school or our tea, so pickings were slim.
Eastenders was signed by one girl pointing east and clapping the drum motif.
Coronation Street was signed by a boy making out a crown on his head and walking about a bit.
Things dried up a bit, "The Bill" was two lads walking around slowly flicking their heels a bit, we all thought they meant a dance show.
Then after a lot of silence, and I was a shy child, I decided to give it a go with the last show I was allowed to watch.
I stood and I performed a wave to everyone, waving and blowing a kiss across the room, then bent down and stroked an imaginary dog at my heels... A pet dog.... A wave goodbye and a pet dog.... A goodbye and a pet...
I thought this quite clever, I remember watching the men in the show in their bunk room, never really paid any mention to the plot nor story, it was something on the TV and I knew that the words were "goodbye" in German and "pet" was added to affect a geordie accent.
And the teaching assistant, clearly knew what I meant and rather than be encouraging, as she had been to the other kids, who worked in pairs or made only strange motions to intimate their thoughts she shat all over mine.
Like proper shat on me from a great height. "Don't be ridiculous, how was anyone going to get that?"
Was it my fault you lot can't speak English, or work backwards from "petting something" to "pet" to.. Oh the only show on one of the 4 measly channels last night has the word Pet in it, even if you don't know the funny foreign words because you're 8 English and this is the era before the Berlin wall came down and Germany was a distant ignored memory from old war films and Grandad's recollections of their not liking it up them.
I've never let this go... Not even now.
Subscribe to:
Posts (Atom)


