Friday, 29 July 2022

Embarrassing #3: Source Control

We spin far forwards not to around 2016; and the development manager wonders over to me and asks my opinion on source control software.  GIT.  Is my reply, just Git no other shenanigans.  But he wants a report.

I duly go take a look... I've suffered CVS, SVN and a myriad of other source control solutions, Git has always worked solidly for me, in over a decade I've had one fault with it - and was able to recover from that problem easily.  That is fabulous uptime for me and nearly zero support because anyone using my repo's could just learn (or google) a bit of git.

SVN was the other main source control solution I advocated, it's issues are many, but it worked for the problems I was dealing with (indeed on my youtube you will find subversion tutorials from back in the day).

This manager however wanted more than opinion, I wrote him a pro's and con's, I went to the public for their opinion and looked at a few closed source alternatives; like perforce.

Cost was a MAJOR issue for this company, the cost to install Git was zero.  The cost to install Perforce was nearly £27,800.  It was a clear win win for Git and vouched for it again, arguing it'd be better to pay for a whole other junior developer; or paying the ones we have now that little bit more each than going for Perforce.

(And I'm being harsh here, but I don't like perforce, I see the "game industry" using it as a default goto, but I do not see why, it has bitten me more than a dozen times in four years of heavy use - I compare that to once in over ten for git and it's just a no brainer even before the costs; and git will do the huge repo's and do them better than perforce can - which was the default argument before that git didn't do huge repo's or source tree's... erm, hello, Linux is completely on it and huge.... Microsoft have moved to it, so windows, edge and so much of their stack is all hosted on git repo's - stop arguing for perforce, it's embarrassing, seriously).

So this manager took away my report.

They bought Perforce, six months later, he's getting the nagware for license renewal, per seat.  £12,000.  This just beggars belief.

The manager was wrong, the money was spent, the company still disappeared with a whimper, it was a waste.  He should have been embarrassed by that; I doubt he was.

But the management should have been far more embarrassed letting him operate the way he did.

Friday, 22 July 2022

Embarrassing #2: Threads

The next story of embarrassment is one of my own, after my experience in my degree I literally specialized in the Borland implementation of the C++ compiler, and the Turbo Pascal one before it.  Java was new on the scene, and so my first job was to go port old Pascal programs into C++ all using C++ Builder.

At a trade show I was poached by the head of finance of another first, not a rival, a completely other market sector, but she wanted me to work for her... I therefore did.  And this meant a physical house move in the process.

This woman being the head of finance would be important later down the line, as she had an idea where I would sit in the business and I duly showed up.  In actual fact I showed up so early I entered the property without permission through an open door and caused a bit of a stir because I was all alone; and could have been anyone not just a new employee.

So I began work and the data processing they wanted was incredibly slow.  This was the era of the Pentium III being king, and my machine was a 400Hmz machine, not a slouch for that year.  But still it was very slow, you had to take a feed of data from IO and process it live; not all of it could fit into memory; so you often had the process spinning waiting on the disks.

I delivered the first iteration just like this, a single inline 1:1 just get her done.  It was horrifically slow.  My embarrassment?  I didn't even understand why it was slow, the manager looked at me; sternly, this kid he didn't really want, and pointed me to "BeginThread".

There wasn't any internet access, no stack overflow, you had to learn by the seat of your pants.  So I cracked open the windows headers for threading in Windows 95 (I forget the SDK version) and start to look at starting a thread.  I had to read about MFC too and a bunch of other stuff in this Microsoft compiler which was not in Borland's; or was different.

I don't think the engineering manager understood I could do all this in Borland, just not in Microsoft.

With these old eyes I look back at this episode and I laugh when kids today complain about std::thread, lambda's, Futures, Async dispatch.  You guys do not know how lucky you are!

And I was embarrassed by not knowing this stuff, worse still was going home to my machine at home, and not being able to follow any of this up, I could read about things, make notes, but not implement any of it; for my machine at home I only had the Borland stuff (and a pretty penny I paid - unbeknownst to me they would soon give away C++ Builder on PC Magazine cover discs).

Ultimately today, to me, this is a lesson in the history of compiler differences between vendors, but at the time I was mortified.  I promised myself I'd never fall behind or out of step like that again, and I've so far achieved it.  Though I had to admit to being off the boil with C++20 right now.

Friday, 15 July 2022

Embarrassing #1: Plagarism in Academia

It has been a while since a regular post series, so inspired by TheRegister's on call - and re-reading my own older "Rackmount Mistakes" stories I thought I'd share three true stories of embarrassment from my career; we're going to start with academic and go into my employment, we'll talk about times I was embarrassed, embarrassed myself or someone else embarrassed themselves.

And why am I doing this?  Well, in the move from immaturity to now I believe a true part of blossoming as a software engineer has been to embrace ones own failures and not repeat them, and identify them in others and work around them, encouraging them to improve.


Unfortunately my first story can't say it improved me or the person whom embarrassed me... We spool the clock back to 1997.  I was in the middle of my degree and I received a very worrying letter between two semesters, my exam results were on hold... Because of plagiarism.

This is presenting someone else's work as your own, I think I was and am a pretty decent software engineer, so I was a bit perplexed.  What was the topic, Data Structures?

This was a (looking back on it) rather inane module in my degree's second year and revolved around our implementing out own versions of the classic data structures, so yes list, linked list, map, doubly linked list and so on.  These were all really annoying things to write and 99% of sane people would today reach for the standard implementation of their chosen programming language than waste time writing their own.  I was very much of that opinion and well aware that C++ was receiving the STL at the time I had zero interest in implementing these things.

Luckily in 1994 when I began programming in Pascal there were no such data structures in Pascal, indeed I had written my own TPU in Borland Turbo Pascal with several of them in; and with a little fandangling I had them ready to hand in for this rather insane idea of a C++ based module.  Did doing this improve my programming?  No, did it teach me much?  No, it was all very old concepts and solved with code which was nearing four years old.

As you might image I didn't invest much in this project or module, I thought it would be an easy win.  Little did I know it would derail my belief in my whole degree course.

None of this is my embarrassment, no the embarrassment comes from the lecturer who reviewed the code.

For we were always encouraged to talk, swap ideas, swap concepts, and heck swapping four year old code solving for a very publicly already solved problem seems no issue, so long as folks understand where to source or have sourced a solution to the project I see no issue here.

This is after all the ethos of open software and open discussion in academia.

Unfortunately the lecturers, well they were solving for closed source, they were comparing like for like solutions and coming up with plagiarism accusations.

And this is embarrassing.  I look back at it and those lecturers, and they should have been embarrassed at the time and doubly so now.  They systematically stopped the whole cohort wanting to walk and exchange ideas, stunting our peer-review and inter-group working methods.  They picked on one of the strongest and most unique things about software and that was the concept of sharing it; and they should be ashamed.

How did they ascribe plagiarism?  Well, in the midst of my code was a very strange function... Here's the pseudo code:

boolean IsEven (value)
begin
    remove the 10,000's
    remove the 1,000's
    remove the 100's
   remove the 10's
   if ( equal 2 or 4 or 6 or 8 ) return true;
   return false
end

This is clearly weird and very odd and very much the thinking of a 16 year old who has no idea how else to do what he's doing because the "%" operator crashed his then only machine a 486 SX2 as it had no floating point co processor and the compiler he was using had no controls to stop the instructions being issued and he had no idea.

Fast forward those years and they present this code to me, and my first words are "Where did you get that from?"  And I told them exactly what this code did.

And you know what's more embarrassing?  The lecturer just said "why not modulo by 2" instead of asking WHY.

This is my overwhelming memory of my degree, lecturers who didn't ask why you had come to a solution, they had their concept of what their solution was and woe betide you if yours differed because you were marked down.  It was too much effort for them to think outside the box, too much effort to actually understand there was rhyme or reason in your solution.  No you were the student, they the lecturer, you learned from them very much not the other way around.

Its embarrassing to think how much that course was worth and how wrong it was in a lot of places; the few very good lecturers were often marginalized, or they were young and yet to be broken in.