Showing posts with label Delphi. Show all posts
Showing posts with label Delphi. Show all posts

Monday, 15 June 2020

The Mystery FTP Clocking Machine Project

During my very first programming job I was given, late in the day, a unit which gathered user data.  It stored this data in CSV plain text and according to the manual you were to FTP into the unit and retrieve the file.

I had an FTP client, I had an FTP implementation (in Dephi) and neither could connect to the device, standard FTP commands didn't work, they just didn't work.

We could confirm it had an IP Address, see the device within the DHCP list and indeed we could ping it, so it was responding to ICMP, but no matter what the FTP client, as described in their manual, would not connect.

A TFTP client similarly could not.

We had no internet, so after going home that evening, on my own initiative I downloaded three more FTP clients and even downloaded an FTP class for the C++ IDE we could use "Borland C++ for Windows".

In the morning I tried all of these, nothing, nada, naught.

I went to get another from the pile of 30 of these we had sat with customers waiting, nada.

I plugged away at this for a week and in the end arranged for an engineer from the vendor to come see us; the chap came, he had a peek and a poke at my code, saw nothing wrong, tried this test routines, they all ran... so we were at an impasse.

Nothing we tried worked except their test routines, so I of course wanted the code to their test routines.

They were very reticent to deliver it but after a lot of prodding and some negotiation over lunch it was agreed that their own engineer could receive the code, look at it on my machine, even copy and paste a few critical parts and get us up and running with connect, disconnect and that would be it, we could then have to do all the other commands, but their engineer would sit there whilst I did at least "list".

No internet, so I took this engineer to my home address (luckily within walking distance of the office) and over my modem (yes, I'm that old) we downloaded this code to a floppy disk (yes, I'm truly that old).

We headed back to the office, set up and opened the code next to my IDE window, their code was in C, so I would have to transliterate it into Delphi later, but whilst he was present we stuck with the C code, he called his programmer and the chap confirmed it should build in Borland C for DOS.  Which I had.

Sure enough their code seemed to compile fine and it ran in debug and connected, did a list and pulled all the files off the device, deleting them after.

Their engineer did this, then he looked at the code, and he smiled, and stared at the code, then smiled at me.  Remember we've wasted my time, his time, like a week in total here.

He consulted their own operators manual, looked at the bottom of the device, smiled again, then picked up the phone.


"Is there another version of this model?"

<squiggly reply on 1998 Motorola Razor>

"Sure, sure, but is there another version?"

<Squiggly voice>

"Right, right, can you send that?"

<Loud squiggly voice>

"Yes"

<Squiggly no>

"Yes"

And he hung up.

"Sorry gentlemen, he was addressing me and my boss, but ah... it would seem you've got the wrong device".

And he arranged for them all to be collected and returned without explaining himself, he personally returned with another unit, which to me looked identical and this worked instantly.

I have never found out quite what the issue was, but the next morning 29 more of these boxes arrived and we could deliver to our downstream clients the next week.

Wednesday, 2 May 2018

The Best and the Worst : Working with Genius Programmers

A long time ago, in an office far away from where I now sit, I once worked with a chap I still refer to as the best programmer I've ever met.
This was a guy who could take the whole code base, in Delphi, home and over a single weekend re-write it in Java.

This was a guy who I saw, from scratch, write a C controller for an embedded PIC to capture an image from a supposedly incompatible TTL driven camera and then an analyzer for the captured images which would detect and show motion, making for our common employer their best ever selling product a cheap security motion detection system, which didn't rely on relatively expensive high resolution cameras.

It was awe inspiring as a newly graduated programmer, whom had a huge background in DOS programming, but whom had never worked in Enterprise level development before.

I sat next to what I still regard as near genius.

This very same chap was also the worst programmer I've ever worked with.

Because he was so highly functioning he never needed to document his code, fine I hear you cry, good code should be self documenting; and you're absolutely right; the problem?  This guy also got bored so so quickly, so he used to tell himself stories in his code.

Yes, Robert Jordon eat your heart out, this guy wrote epic fantasy on a grand scale, across hundreds of thousands of lines of code, in Delphi, C, C++, Java and even in HTML which I saw him churn out, it was all a gobbledygook puddle of story telling rambling mess.

But the code worked, the managers didn't care that it was gibberish; at least not at first; because they could churn out product to the anticipating masses of customers.

Such a prolific talent, he had so many fingers in so many pies, he was invaluable, key man, the man, the one person every project started with.

The result?  Every single code base he touched was tainted with this un-maintainable morass of code.  Which an ever increasing march of cheap graduate programmers, like my then self, had to then decipher, maintain and coral.

Often the time it took to bring a project into some semblance of order would be three or four times more than it took that one original chap to write, this did not go unnoticed and managers rightly pointed their fingers to ask the question "How could you not keep up?"

I however was the first such junior person with a voice, I've always had a voice, and I pointed right back "How could you let us get into this mess?"

I dated to question, sweep, and change the code, I dared to spend time even just aligning the code correctly.  No JetBrains formatting (or resharping) tools, very few tools existed to cover the whole pantheon of mess we were now wrestling to stay a head of.

Daring to question, change, read and challenge the talented one resulted in his changing his ways, he returned to some of the projects I had lead re-working, he saw the structure and the discipline within he saw that you could quickly pick up and get to work without needing to load all the software into ones wetware in a laborious re-read.

This skill, this willingness, to press the boundaries is somewhere I've oft and continue to take projects, and I do ask those I throw code at to feedback to me where they think anything needs reviewing.

I deplore any project or maintainer whom takes the grounding that they must keep things secret and keep things safe.

Drop, the epic fantasy, you're not Gollem, share, review and open the boundaries.