back to article Dilettante dev wrote rubbish, left no logs, and had no idea why his app wasn't working

Bosses often ask IT pros to clean up messes made by amateurs, and in this week's On Call – The Register's reader-contributed tech support column – we have just such a tale to tell. We'll Regomize the source of this story as "Bryce," who told us about an experience in the late 1980s when he scored a job working as a developer …

  1. Anonymous Coward
    Anonymous Coward

    Divers log

    I used to work for an ROV (Remote Operated Vehicle) company that dealt with the oil and gas business.

    I was employed to "deploy" their time recoding system. Basically go to a ship / rig install a computer and add the software.

    The software was Sooo bad.. it was written in Paradox.. every report was formatted for letter where the regions I was to deploy it to was A4.

    So being young and helpful,and having studied computer programming, I tried to modify the reports.

    Every one of them used a different print routine.

    The "Developer" (I use the term loosely) couldn't figure how to do hours and minutes so used hours and decimal parts of hours (so 1 hour 15 minutes would be 1.25 hours)

    In his defence he was a diver before he became an ROV pilot and had written a tool to help himself which was then taken by management to be deployed world wide (my first real deployment was in Africa but that's another story).

    1. b0llchit Silver badge
      Coat

      Re: Divers log

      ...written a tool to help himself which was then taken by management to be deployed world wide...

      And there we have it, in plain writing: Management only makes things worse.

      1. Anonymous Coward
        Anonymous Coward

        Re: Divers log

        Speaking of plain writing... Whenever they try to do that, I always insist on getting a written signoff that I'm strenuously objecting to such deployment, and I do NOT, and will not EVER, under ANY circumstances, support the deployed item, in any way, shape, or form.

        AKA my "told you so" document.

        That has come in handy twice so far.

        1. b0llchit Silver badge
          Holmes

          Re: Divers log

          Been there, done that. And still get blamed. Not officially, but you are treated as the "bad guy" because you allowed that crap to get used, regardless of the warnings and cautions in writing.

          The definition of Manglement: Always blame someone else.

        2. Raoul Miller

          Re: Divers log

          I still remember very clearly where Barry <Lastname Redacted> brought a stack of printouts for each participant at the meeting with hard copies of the emails and white paper he had written to various PMs and Managers that his *short term* fix to the SiteMinder deployment should in no way be considered ready for production and was only installed as a courtesy to let other teams test their code. Of course 18 months later, it was still there, was about to be deployed to production, and he had been reassigned to other tasks when he requested time and resources to design and deploy a more robust setup.

          It was a master class in CYA and one that I have followed later in my career

        3. G.Y.

          Re: Divers log

          also known as a pearl harbor file

      2. TeeCee Gold badge

        Re: Divers log

        My favourite variation on that is to have a "best demonstrated practice" system. A place where business units can publish their home grown crap while extolling how wonderfully useful it is. Other BUs then pick it up and stick it live themselves.

        It took me quite a while to work out why shite, bug-ridden, insecure crap software was virally insinuating itself into our systems globally at random.

    2. Filippo Silver badge

      Re: Divers log

      >The "Developer" (I use the term loosely) couldn't figure how to do hours and minutes so used hours and decimal parts of hours (so 1 hour 15 minutes would be 1.25 hours)

      Once I had to make my program produce a CSV that included some durations. The client wanted the duration to be human-readable, so that 1 hour 15 minutes should display as 01.15. The client then proceeded to open this in Excel, have it sum the column, and complain to me that the sum was wrong. -_-'

      1. A.P. Veening Silver badge

        Re: Divers log

        The correct display should have been 01:15, perfectly human readable and Excel will sum it correctly.

        1. Anonymous Coward
          Anonymous Coward

          Re: Divers log

          The correct display format is locale dependent.

        2. Anonymous Coward
          Anonymous Coward

          Re: Divers log

          The correct display should have been 01:15, perfectly human readable and Excel will sum it correctly.

          Not as consistent over time as one might have thought.

          I was reading a crime novel published pre WW1 where the two Sherlocks after consulting their Bradshaw went to catch a train leaving at 1.5 pm. Puzzled YT for a moment as it seem odd that the £sd lb&oz thinking Brits of the time would render half past one o'clock (13:30) as 1.5 until the penny (sic) dropped that 1.05 pm was meant and that 13:50 would be 1.50. I have subsequently noticed the same in other writers of the period so I imagine it was a common convention in timetables (including Bradshaw) of the time.

          Just had a look at the digitised 1910 Bradshaw on Hathitrust I can see this was the case. Fascinating resource for the period.

          1. Richard Tobin

            Re: Divers log

            Bear in mind that in those days people were much probably much less inclined to treat numbers as decimals in general. We would write £1 2s 6d, 5' 8", 2lb 4oz.

            During the run-up to decimalization in 1971 one of the things that they (the government, teachers, the BBC...) tried to drum into us was that a pound and five pence should be written £1.05 and not £1.5.

            1. Anonymous Coward
              Anonymous Coward

              Re: Divers log

              That's amazing.

              I had no idea the decimal was so "new". This perfectly explains my old-man boss and his incorrect time accounting. I'd just taken decimals for granted, as a _given_.... I've never lived without them, from maybe the 2nd or 3rd grade. There never was anything else.

              :-O

              Mind, partly blown! But 1971 - there would be a *lot* of people alive today who had to make this very switch, and probably still have a strong bias for the whole/parts (1.5 -> 1lb 5oz). I'll most likely never forget this and if they make a mistake just quip it back to them about "One and its parts eh?" rather than fault them on "added wrong, huh?"

              1. that one in the corner Silver badge
                Windows

                Re: Divers log

                > - there would be a *lot* of people alive today who had to make this very switch,

                Cooeee!

                1. KittenHuffer Silver badge

                  Re: Divers log

                  Did I hear a 'Cooeee!' from the one in the corner?!?

              2. Will Godfrey Silver badge
                Happy

                Re: Divers log

                FX: waves

              3. Peter Gathercole Silver badge

                Re: Divers log

                Me too.

                I can pretty much still work in both, as long as I know the context.

                Learning clock arithmetic as it was called was required in primary school when I was there, just to get kids thinking in bases other than 10.

                1. John Brown (no body) Silver badge

                  Re: Divers log

                  Same here, my first 5 or so years at school include "clock arithmetic" too, as well as £SD money, so base 12 and 20 there, plus imperial measures and the various bases used there too. Aged about 8 or 9, we then started learning about the "new" decimal currency about to be introduced, so not just learning more intensively about decimals, but more importantly, how to convert base 12 pennies and base 20 shillings into base 10 £'s and pence (or New Pence as it was always called back then!)

                  (I do remember being quite disappointed when my "birthday money" from Grandma was 50p instead of 10/ and "only" worth 50 New Pence and not 120d or "old pence" :-)

                  1. Jou (Mxyzptlk) Silver badge

                    Re: Divers log

                    When was all that? Me, being from the continent, missed all that since we are metric since the time of the French revolution...

                    1. Anonymous Coward
                      Anonymous Coward

                      Re: Divers log

                      And the merkins still have problems with the metric system.... Ha Ha!

                    2. John Brown (no body) Silver badge

                      Re: Divers log

                      "When was all that? Me, being from the continent, missed all that since we are metric since the time of the French revolution..."

                      The money changed in 1971. Our history with metric measurements is long and varied with a number of false starts, some of which are still ambling towards the starting line, such as on the road where it's still miles and miles per hour etc.

                  2. The Organ Grinder's Monkey

                    Re: Divers log

                    I'm 59, just, so was 5 in 1971 & I clearly remember the fuss about decimalisation (or "dismalisation" as a particularly stubborn & recently departed friend was still referring to it on his deathbed) but not the actuality of making the change myself (which I'm slightly sad about tbh.)

                    I was taught "the metric system" by teachers that were utterly baffled by the new ways, & ended up in a bit of a limbo where I'm not a native of either system. Young people (anyone under about 55) that I occasionally have to work alongside get hugely frustrated if I measure a workpiece as 161mm x 4"

                    As I write this I'm reminded that the above mentioned friend had a government-issued record from the run-up to dismalisation with a catchy little tune on it explaining how to convert from one system to the other. Max Bygraves, no less:

                    https://m.youtube.com/watch?v=ncZihiuztvg

              4. gnasher729 Silver badge

                Re: Divers log

                My experience was that books for English learners in German schools had to be updated from pound / shilling / pence to pound and pence. And pounds with two decimals became a thing.

              5. Blofeld's Cat

                Re: Divers log

                <Waves hand>

                Yes, I can remember when a half-crown was 2'6 or 2/6 or 2s 6d. I also remember the farthing, but we won't go there ...

                The local bus company took some weeks to change over their ticket machines when the new decimal coins came in, so you used to tender fifteen new pence and be given two and a half new pence back for a half-crown fare.

                Incidently until just a few years ago the UK railway infrastructure still used miles and chains.

                1. Decay

                  Re: Divers log

                  Nautical applications still have fathoms (6 feet), nautical mile is 1 minute (1/60 degree) of latitude at the equator or about 6000 feet which makes converting knots (nautical miles per hour) relatively easy to estimate by dividing by 5 and multiplying by 6 e.g 30 knots is approx 36 mph. For more accuracy multiply by 1.15 so its closer to 34.5 mph

                  A cable length is 1/10 of a nautical mile or 100 fathoms. And as far as I know the Royal Navy still defines it that way while acknowledging its precise length is 608ft

                  And while I'm regurgitating useless facts thinking about this reminded be of how to estimate the maximum speed of a displacement hull (i.e. not planning) boat Take the length of the boat in at the water line (LWL) get the square root and multiply by a fudge* factor of between 1.2 and 1.4 typically assumed to be 1.34 and you get the max speed that hull can do in water. This results in some serious numbers for large ships and explains why aircraft carriers can bop along and how Atlantic passages by the QE2 etc can achieve those figures.

                  Example 80 foot hull = approx 12 knots (14mph)

                  USS Gerald R. Ford-class aircraft 1100 feet = 44.5 knots (51mph) QE2 is pretty close to that as well

                  Obviously horsepower windage etc all impact the actual top speed but those are the max numbers for hull length. The USS aircraft carriers have a nominal top speed of 30 knots but rumors persist that they can go a lot faster when the Captain decides F it I need to be there asap.

                  1. Daedalus

                    Re: Divers log

                    On the other hand if you're in a smallish motorboat you can easily exceed hull speed and wind up riding the front edge of your wave, commonly known as "planing". It's all fun and games until you cut the throttle and the back half of the wave hits the stern and pitches the whole boat forward, as I found out the time a friend let me pilot his boat. After that it was "ease off gently".

                  2. Herby

                    Re: Divers log

                    On Aircraft carriers top speed:

                    Yes, I suspect that the advertised top speed is 30 knots, the actual top speed is likely (is) classified. I suspect that given the right circumstances one could easily water ski behind it, or surf the waves generated by the wake. So, yes, if necessary they can get there at "warp" speed.

                    1. Giles C Silver badge

                      Re: Divers log

                      Most military performance figures are sanitised I remember reading that the SR71 worlds fastest plane did not run at full power for the record attempt.

                      Also several military jets can run their engines at 110% power.

                      And on a side note remember that guitar amps can go to 11….

                      1. Shred

                        Re: Divers log

                        The limit on speed for the SR-71 was not engine output, but the temperature (from friction with the air) that the cockpit windshield could withstand. From memory that limit was around 430 deg C.

                      2. Dagg Silver badge
                        Devil

                        Re: Divers log

                        And on a side note remember that guitar amps can go to 11….

                        Only for Spinal Tap

                        1. jake Silver badge

                          Re: Divers log

                          My 1959 Fender Bassman (bought new by my Father in 1960) goes up to 12. Occasionally :-)

                    2. WolfFan

                      Re: Divers log

                      USS Kitty Hawk once made a run where if you took the distance travelled and divided by the time taken you got an averge speed of 45 knots; Enterprise CVN-65 was essentially a nuke Kitty Hawk and was, in theory, possibly as much as 5 knots faster than the non-nuke Kitty Hawks. (a.k.a 50 knots...)

                      The Kitty Hawks, like all American fleet aircraft carriers since the Forrestal class, are officially listed as having a top speed of ‘in excess of 30 knots’. No kidding.

                      Allegedly the Nimitz class were faster than the Kitty Hawk class, though not as fast as Enterprise, and the Gerald Fords are allegedly faster than the Nimitzes. They all are officially credited with ‘in excess of 30 knots’ and Unc Sugar’s Swabies get annoyed if youn try to probe more deeply. HMS Queen Liz is, allegedly, at least as fast as a Kitty Hawk.

                      Yeah, you could use a carrier as the World's Biggest Ski Boat. Don't tell the Orange One, he'll want a waterskiing vacation from cheating at golf.

                      1. Grey Bird

                        Re: Divers log

                        When I was in, the USN had 6 hydrofoil boats. When I asked one of the crew how fast they could go, the answer was "That's classified, but they can run circles around US carriers going at full bell." So, fast. And since they're up on foils, the speed isn't limited by hull length the same way as described earlier in the thread.

                      2. PC Paul

                        Re: Divers log

                        He's never waterskied in his life! It requires strength, balance and coordination.

                    3. that one in the corner Silver badge

                      Re: Divers log

                      > one could easily water ski behind it ... they can get there at "warp" speed.

                      If you can waterski behind a ship being warped* then bloomin' 'eck, who've you got on board, Popeye?

                      * FYI warping a vessel is an old, old practice: tie a line onto a fixed object ashore, or drop a kedge or even a sea anchor (yes, yes, with a bit of rope attached to the anchor) then haul against that to get your vessel moving)

                    4. JWLong Silver badge

                      Re: Divers log

                      On Aircraft carriers top speed:

                      I was on the U.S.S. Midway towards the end of Vietnam and we were qualifying her because of a major casualty that had happen in #2 main engine reduction gear.

                      We had her up to 37.5 knots and she was screaming like a two dollar whore.

                      I was also station on the U.S.S. Kitty Hawk(also known as the Shitty Kitty) in 76. The big difference in the steam plant was that the boilers were 1200psi instead of 600psi like the Midway was.

                      1. The Organ Grinder's Monkey

                        Re: Divers log

                        1200psi must be in the territory of the invisible ultrasonic steam leak where the jet of escaping steam acts like an invisible scalpel on any meat-based material that passes by?

                        1. PC Paul

                          Re: Divers log

                          I recently started shooting modern PCP airguns and was shocked to find they run their tanks up to 250 Bar, which is 3625 PSI. That's a lot for something that you run around with in woods, with the aluminium or carbon fibre tank unprotected...

                  3. Bilby

                    Re: Divers log

                    nautical mile is 1 minute (1/60 degree) of latitude at the equator or about 6000 feet which makes converting knots (nautical miles per hour) relatively easy to estimate by dividing by 5 and multiplying by 6 e.g 30 knots is approx 36 mph. For more accuracy multiply by 1.15 so its closer to 34.5 mph

                    A nautical mile is 1 minute (1/60 degree) of latitude at the equator, or about 2km, which makes converting knots (nautical miles per hour) relatively easy to estimate, by multiplying by 2, e.g 30 knots is approx 60 km/h. For more accuracy multiply by 1.852 so it's closer to 55.6km/h.

                    1. Jou (Mxyzptlk) Silver badge

                      Re: Divers log

                      You forgot the irony icon...

                2. Phil O'Sophical Silver badge
                  Childcatcher

                  Re: Divers log

                  As a child I remember being outraged when a 5d packet of crisps became 2½p (6d) with no change in weight. It was the closest decimal value, but always seemed like a rip-off.

                  1. Doctor Syntax Silver badge

                    Re: Divers log

                    I thought we should have gone binary - 256p to the pound. Far closer to the old value of 240d and giving much less scope for that sort of thing. And, of course far more modern than decimal.

                3. Andy A
                  Thumb Up

                  Re: Divers log

                  Farthings had already gone when I was old enough to handle money. However I was surprised to find that there used to be a coin worth a THIRD of a farthing - 144 of them made a shilling!

              6. CorwinX Bronze badge

                Re: Divers log

                I was about ten years old when decimalisation came in. Had a fat calculator pen with dials or pins on it to do the conversion from Pounds/Shillings/Pence mechanically. Can't remember exactly how it worked now.

                The old system was batshit insane in the first place.

                If I rember correctly, it was 25 Shillings to a Pound and 12 Pennies to to Shilling. Insanity.

                Then there was Pounds and Ounces for weight of course!

                1. Wellyboot Silver badge

                  Re: Divers log

                  20 Shillings to the pound containing 240 pence, that's a nice number which divides neatly by 2,3,4,5,6,8,10,12 & 15* as everyone 10yr old before 1970 knew.* 100 only divides neatly by 2,4,5 & 10 (& 8 while 1/2p coin was allowed).

                  Yes, it's crazy because the 10 decimal numeric characters are used to show values in a system that swaps from duodecimal(b12) to vigesimal(b20) to indicate different magnitudes of value. That's what happens when for most of the last 1,000+ years most personal transactions were below the 1s boundary. The Groat (4 pence) shows just how much value a penny had several hundred years ago.

                  * Teacher wouldn't be happy otherwise

                  1. that one in the corner Silver badge

                    Re: Divers log

                    > The Groat (4 pence)

                    Pennies! The Groat is four pennies.

                    This is one of The Things About Decimalisation that was drummed into us during the conversion: pence for the new stuff and pennies for old money!

                    Plus the new coins are not abbreviated or portmanteau'd, which gets rid of the last vestige of confusion of that usage: we have "ten pence" in new, whilst only the crude old stuff has "fivepence"/"five pennies" and "thruppence" (and "thruppenny bit" has "penny" so it is clearly old). "Sixpence" is just one word, if someone hadn't heard you'd always say it slowly as "six pennies" (better yet, "tanner", of course, but let us not risk confusing the modern audience). Yes, for odd values as well: "sevenpence ha'penny", no pause after the "seven" (count yourself lucky you got the first 'e' in the "seven", even in the poshest places).

                    Which meant we could have sensible conversations about price changes without continually shoving "old" and "new" into every single sentence (allowing them to be kept for emphasis and sarcasm, very important to a British conversation).

                  2. Doctor Syntax Silver badge

                    Re: Divers log

                    "The Groat (4 pence) shows just how much value a penny had several hundred years ago."

                    It was also quite common to use pence for values greater than a shilling - it would be common to use 18d rather then 1'6d or 30s rather than £1..10s. In medieval and later documents it's not unusual to see sums given as hundreds of shillings. Then there was the mark, 2/3 of a pound.

                  3. Andy A

                    Re: Divers log

                    And in Victorian times there was a coin worth 1/3 of a farthing - 144 of these made a shilling!

                2. JWLong Silver badge

                  Re: Divers log

                  And let's not forget "Fluid Ounces".

              7. Doctor Syntax Silver badge

                Re: Divers log

                there would be a *lot* of people alive today who had to make this very switch, and probably still have a strong bias for the whole/parts (1.5 -> 1lb 5oz).

                We carry all sorts of fractions of in our heads too. For instance, 13s 4d is 2/3.

                As to pounds and ounces it's as well to remember that this was a handy binary subdivision (and for good practical reasons), none of your legacy decimal stuff. I always reckoned that the new penny should have been 1/256 of a pound - slightly less than an old penny.

                1. Andy A
                  Happy

                  Re: Divers log

                  ....and 6s 8d (a third of a pound) was the price of a 45rpm single in my youth.

              8. John Brown (no body) Silver badge

                Re: Divers log

                "a strong bias for the whole/parts (1.5 -> 1lb 5oz)"

                I'd not really thought much about it until this very moment, but here in IT land we have the same issue. Is the "." a decimal point or just a separator. Is v1.2 a newer or older version of software than 1.19? ie 2nd or 19th iteration of V1 or something else entirely? Although the general consensus now seems to be the "." is a separator between major and minor numbers, it certainly wasn't always so in software versioning and still isn;t in some case :-)

              9. jake Silver badge

                Re: Divers log

                Somewhat interestingly, at least to me, is that none of y'all have mentioned Sterling use in computing.

                My IBM 1401's basic Sterling system is not actually installed yet, and may never be[0]. It consists of some 267 extra SMS cards and attendant bits & bobs to make it all play nice. Some assembly required (I have the necessary manuals and schematics). It all tested OK when scavenged from a soon to be scrapped 1401 ... the old codger who helped disassemble it assured me that it would all work just fine in my '63.

                Yes, you read that right ... The IBM 1401's handling of Sterling was done in hardware! Not sure what IBM was smoking ... but it worked. Quickly (for the time) and reliably (even by modern standards).

                [0] The ol' gal claims Sterling notation makes her germanium itch something fierce. Maybe I'll have pity on her and find another unit to install it in.

              10. Andy A
                FAIL

                Re: Divers log

                I well remember visiting Austria about 5 years after the Decimal Switch.

                The official exchange rate was something like 20.03 Austrian Schillings to the pound. Converting prices was going to be easy!

                We had already forgotten, despite decades of 20 shillings to the pound,

            2. JulieM Silver badge

              Re: Divers log

              Well, obviously! Because £1.5 would be a pound and a half, or 150 pence; as opposed to a pound and a twentieth, or 105 pence.

              1. Martin an gof Silver badge

                Re: Divers log

                I may have mentioned this here before, but the situation is even worse in Welsh, and in certain regions, worse again.

                Bear in mind that Wales has two counting systems; there is the normal "decimal" system where "twenty one" is "dauddeg un" (two tens, one) and "thirty one" is "trideg un" (three tens, one) and there is the older system, still commonly used for time and dates where (amongst other things) "twenty one" is "un ar hugain" (one on twenty) and "thirty one" is "un ar ddeg ar hugain"; one on ten on twenty.

                For most of us, "50p" in Welsh is "hanner can ceiniog"; half a hundred pennies (or just "pumdeg ceiniog" - fifty pence - of course). But for one of my school teachers it was "darn chweugain" (I think that'd be the spelling); a six-twenties piece.

                In old money there were 240d to the £, so half a (money) pound was 120d and one hundred and twenty is, indeed, six twenties.

                Took my 11 year-old self a few minutes to work that one out during registration one day. Can't remember why it came up, suspect she was asking us for money for a school trip or something.

                M.

                1. goblinski Bronze badge

                  Re: Divers log

                  And I thought that soixante-dix, quatre-vingt, quatre vingt dix are the summit of perversity, and was always wondering how the French can dare considering the Belgians silly, when said Belgians have septante, ocante, nonante...

                  1. Ken Hagan Gold badge

                    Re: Divers log

                    Certainly not just a French or Welsh thing. English had "four and twenty blackbirds" and German still has ein-und-zwanzig for 21. Of course, 121 is hunderteinundzwanzig so they aren't consistently little-endian.

                    tldr; humans have been innumerate and illogical since the dawn of time.

                    1. Doctor Syntax Silver badge

                      Re: Divers log

                      Well, obviously. Tou couldn't use "twenty four blackbirds" in the rhyme; doesn't scan.

                  2. Martin an gof Silver badge

                    Re: Divers log

                    Even Cumbrian shepherds have a slightly odd counting system. A vague base on 20 seems reasonably common in parts of Europe, and it's possible in Welsh, as in French, use "pedwar ugain" (four twenties) for eighty. There is also some slight confusion in the high teens, so while in both counting systems, 11 to 15 are "one ten and <n>" (new) or "<n> on ten" (old), in the older system sixteen is "un ar bymtheg" (one on fifteen), seventeen is "dau ar bymtheg" and nineteen is "pedwar ar bymtheg", but eighteen is "deunaw"; two nines.

                    Regularity also depends on the speaker and I have heard some people eschew the tongue-twisting "pedwar ar bymtheg ar hugain" (four on fifteen on twenty, i.e. thirty-nine), not for the modern "trideg naw" (three tens, nine) but for the slightly perverse "deugain namyn un"; two twenties, except one (or "less one")!

                    I love this stuff, that it's all mixed up.

                    I regularly get into arguments with my children, who have never known anything except decimal counting and measuring systems, about the beauty of systems based on 12 or 20 (or 16 or...). They don't like 360 degrees in a circle or 16 ounces in a pound, despite me pointing out that 360 divides nicely into halves (down to 45 anyway) or thirds (down to 15) while 400 or 500 just wouldn't. (actually, 400 halves to 25 very well, the equivalent of 22½ in the 360 system, but it doesn't do thirds at all). And, of course, 360 meshing well with our 24 hour day made up of 60 minute hours and 60 second minutes.

                    Odd numbering systems are excellent mental exercise for young minds, though I accept that some people never quite get it. I know someone who left school, struggling with English and Maths but able to cope, but utterly unable to read a normal clock or calculate time differences in any representation.

                    M.

                    1. Doctor Syntax Silver badge

                      Re: Divers log

                      Give your children the task of working out how, with a simple balance, to produce an ounce of sugar (for example) given a pound to start with. Then how to get a hundred grams starting with a kilo.

                  3. Julian Bradfield

                    Re: Divers log

                    Try Danish: 80 is "firs", a dramatically compressed 'four times twenty', and 70 is "halvfjerds", half way [from 60] to four times twenty.

              2. Will Godfrey Silver badge
                Coat

                Re: Divers log

                Shirley, it would be 24 oz?

                OKOK don't push.

              3. The commentard formerly known as Mister_C

                Re: Divers log

                "as opposed to a pound and a twentieth, or 105 pence."

                I believe Sir is referring to One Guinea, aka 21 shillings.

                1. John Brown (no body) Silver badge

                  Re: Divers log

                  I'm in my early 60's and the only time I recall ever hearing reference to Guineas in "real life" was at the end of The Golden Shot[*] where the jackpot prize was in Guineas. It possible, although I'm not sure, I might have seen adverts in newspapers and magazines which priced in Guineas, or they may have been old papers/magazines I remember seeing/reading (eg drawer liners etc :-))

                  * Gratuitous link to images of Ann Aston. Those in the right age bracket will know why :-)

                  1. Peter Gathercole Silver badge

                    Re: Divers log

                    You ought to attend livestock sales in the UK, especially horses. They still mostly use Guineas for horses, even today.

            3. that one in the corner Silver badge

              Re: Divers log

              > We would write £1 2s 6d

              We would write £1 2/6 or "One and six over a Guinea? Here's a quid and a ten bob note, keep the change dear boy".

              1. Wellyboot Silver badge

                Re: Divers log

                7/6 change, You're a Gent sir !

                1. John Brown (no body) Silver badge
                  Windows

                  Re: Divers log

                  Hells bells, that's a days wages!!!

            4. Antron Argaiv Silver badge
              Thumb Up

              Re: Divers log

              Lived in Australia as a kid, we returned to the US just as they were transitioning from pounds-shillings-pence (which I had picked up easily only a few years earlier) to decimal Dollarbucks.

              Never quite understood the "stones" thing. Why humans should be weighed differently than other things confused me. And stone wasn't always used, either.

              1. Robert Carnegie Silver badge

                Re: Divers log

                Your explanation puzzled me a bit. You mean that Australia was switching from Hogwarts money to an Australian decimal dollar, when you left there. But a pound weight is 454 grams, and 14 pounds makes one "stone". I think the U.S. still uses pounds, but only pounds. And pints are funny, and maybe ounces are funny, A British pint is 568 grams of water and a not very quiet word with the barman. :-)

                1. IvyKing
                  Headmaster

                  Re: Divers log

                  Ahem - a pound weight is 4.44 Newtons, a pound mass is 454 grams.

                  1. Robert Carnegie Silver badge

                    Re: Divers log

                    You're quite right. And quite confusing, unfortunately. Weight varies with gravity, although to make gravity vary significantly isn't easy, e.g. travelling to the Moon, to Mars, etc. And I was just thinking of quantities in my grocery shopping. So, a mass which weighs one pound - (1) on planet Earth and (2) "close enough" - is 454 grams.

                  2. Decay

                    Re: Divers log

                    For some reason unknown to me*, your comment sparked a recollection of the injustice served on me by a science teacher many, many moons ago who marked my answer to the question ...

                    "Is the mass of an object on the Moon different from on Earth?"

                    I answered no.

                    She marked it wrong and when I questioned it said "You silly boy, the Moon only has 1/6 the gravity of Earth so of course the mass will be different!"

                    Now if I can only remember her name, track her down on social media, and visit her nursing home, I'm going to give her a piece of my mind I tell you!

                    *Isn't it weird the oddball connections your brain makes.

                2. Doctor Syntax Silver badge

                  Re: Divers log

                  "And pints are funny, and maybe ounces are funny,"

                  Sigh.

                  Pints from gallons and ounces from pounds are, respectively, 8 and 16.

                  Is there anything about numbers that you recognise in an IT related context?

                  If you then think of the practicality of dividing the gallon or the pound with the simplest of weighing equipment do you recognise why such schemes were used? And the further subdivisions into halves and quarters when smaller amounts were needed?

                  Binary schemes always were - and still are - good practical schemes. Decimal schemes are good for people who count on their fingers.

                  1. Mark #255
                    Boffin

                    Re: Divers log

                    A British pint is 20 fluid ounces, a US pint is 16 fluid ounces.

                    But beware, a British fluid ounce is 28.41ml (the volume of an ounce of water); a US fluid ounce is 29.57ml, a 4% difference.

                    1. ZX8301

                      Re: Divers log

                      Ah, that’ll be why ten gallon hats overflow after just eight.;-)

                      1. Robert Carnegie Silver badge

                        Re: Divers log

                        Because it's funny! ;-)

                    2. JWLong Silver badge

                      Re: Divers log

                      Don't confuse fluid ounces with ounces of weight.

                      16 fluid ounces are a pint. 16 ounces of weight are a pound.

                      And don't blame us(the U.S.) for this, we inherited it from the Brits. /s

                      Got to blame someone so might as well the Islanders.....

              2. that one in the corner Silver badge

                Re: Divers log

                > "stones" ... Why humans should be weighed differently than other things confused me

                As lady acquaintances of mine have commented on this "you try carrying one around in your belly, you'll be using stones as well!".

                PS you'd buy a stone of potatoes as well, or flour, to keep the family going. Dog biscuits by the hundredweight, though.

            5. Doctor Syntax Silver badge

              Re: Divers log

              We would write £1 2s 6d, 5' 8", 2lb 4oz.

              Also 10/6 or 10'6 would be ten shillings and six pence.

          2. tinman

            Re: Divers log

            damn your eyes! I thought I'd have a quick look at that and I haven't got past the adverts yet!

            I'll have to keep it for after hours.

          3. Richard Tobin

            Re: Divers log

            Another point - when I was at primary school, the way we were taught to write decimals was *not* 3.14159, but 3·14159 - with a middle dot. That makes it even less the case that 1.5 would be naturally interpreted as a decimal.

            1. Robert Carnegie Silver badge

              Re: Divers log

              I'd forgotten about that style of decimal.* And mostly, about ÷. On the other hand, I think that what can be written in "Roman" characters has been affected by what is provided on a typewriter or computer keyboard. And mechanical typewriters particularly were built economically, each key added to the price. I remember typing .' ! together to make ! And actually using O because the machine didn't have a 0. And lower case L for 1.

              * According to Wikipedia "Numerals in Unicode", either Unicode or its locales eliminate a special decimal point - mostly. I quote -

              "Unicode has no dedicated general decimal separator but unifies the decimal separator function with other punctuation characters. So the "." used in "0.25" is the same period character (U+002E) used to end the sentence. However, cultures vary in the glyph or grapheme used for a decimal separator. So in some locales [most or all of Europe], the comma (U+002C) may be used instead: "0,25". Still other locales use a space (or non-breaking space)" ...

              It's quite interesting, and Arabic actually does "still" have in Unicode - this says - a special mark for "decimal". Unicode also has a special "fraction slash" division symbol which looks like / and theoretically allows fractions to be written like ½ but I think the symbol that I have here isn't that, it is one symbol which looks like 1/2.

            2. Martin an gof Silver badge
              Happy

              Re: Divers log

              I said almost exactly the same thing back in 2018.

              M.

            3. Doctor Syntax Silver badge

              Re: Divers log

              The divider for real money was a double dot £1··5d is equivocally 245d. We were also encouraged to use a dash as a separator for funny money so that £1-5p is unequivocally 105p although £1-05p would be preferred.

          4. A.P. Veening Silver badge

            Re: Divers log

            Not as consistent over time as one might have thought.

            Excellent point, but at least valid in the time period in which people are using Excel.

          5. druck Silver badge

            Re: Divers log

            Not only was the zero left out of 1.5pm but there wasn't even a zero on most type writers, you used an 'O' instead. Which is where saying 'oh' instead of zero in things like telephone numbers - "dial oh one for London".

      2. Anonymous Coward
        Anonymous Coward

        Re: Divers log

        At my first job back in high school, I noticed one day that the boss was entering my hours into Quicken as #.##. 12 hours and 15 minutes -- 12.15. I asked him why he did _dot_, and his response was "it takes hours and minutes." I asked him, why not type it in with a colon, hours and minutes? He entered it into the field, 12:15, and it changed the number to 12.25. This looked correct to me.

        My boss said nono, that's wrong, and changed the number back to 12.15. "Well it's just numbers, as long as I'm not under-paying you. :-)" I smiled at him and dropped the topic. It's no more than half an hour per week difference, after all, for which the time sheets were added up. (Mental math of minutes was in his head, and would've properly accounted for 60 minutes to an hour. At least, thinking back, I never saw him entering "1.15 + 2.15 + 2.30 + 3.45 + ..." into a calculator.....)

        1. Jou (Mxyzptlk) Silver badge

          Re: Divers log

          You should have asked to enter 12:45...

      3. Anonymous Coward
        Anonymous Coward

        Re: Divers log

        Our HR system here works in decimal hours so my working day was once "7.4 hours" and is now "7.14 hours". I think they put me down from a 37.5h week to a 35h week at some point but as I only work 25 anyway the upshot is that I get paid the same but my holiday entitlement (which is counted in hours, not days) has gone up by the equivalent of (just about) one day. At least I think so. They're probably diddling me some other way.

        1. PB90210 Silver badge

          Re: Divers log

          Same here (until retirement). I worked a 'nine day fortnight' based on a 35hr week and HR insisted on decimal hours on the timesheet. Bank Holidays and leave days were different amounts and booking everything could be a nightmare... luckily my hours were (generally) standard, so I could book a month or so ahead and make changes where necessary

          (others worked different patterns, like a straight 35hr week)

      4. Herby

        Re: Divers log

        On time having periods as dividers:

        The problem when entering time is that the ":" key is not on the numeric keypad. I wrote a program for entering timecard values and to make it "easier" separated hours and minutes with a period on entry (it made my sister-in-law happy). I printed out the times with a colon (as I recall) to make it consistent. Probably not the "best" way to do it, but I did get it to work. It also assumes that the hours below 6 were PM, and the hours above were AM.

        Old work now. I don't know if I'd do anything different.

    3. Joe W Silver badge
      Pint

      Re: Divers log

      We had a "professional" (pro in ... herding cattle?) named John or Clint (or one of the other cowboys). Charged external consultants rates.

      Did not know about the type "date" or "datetime". The guy converted all dates to strings.

      Lots of dynamic SQL just pasting unsanitised input together.

      Views using views using views "views all the way down"

      DB had no keys. At all.

      DB had no index. At all.

      And some colleagues still treat his code as gospel. I woudl like to do some "maintenance" using a stake and holy water. And on the data base as well.

      (and I'm not even a good programmer, or a DB expert or formally trained in these things, or.... but I can still see these things

      I actually and honestly prefer Fortran 95 or R)

      I need one of these to numb the pain --->

      Thankfully I'm now responsible for other parts of the project.

      1. Robert Carnegie Silver badge

        Re: Divers log

        "And some colleagues still treat his code as gospel."

        I think a word that came to many of our minds after your description is "Christ!", so, not far off. ;-)

        "I would like to do some "maintenance" using a stake and holy water."

        Should work, that's what holes in the top of the server are for. :-)

        "And on the data base as well."

        Ah, I assumed... well, you have reason to set your priorities that way around.

    4. spuck

      Sigh...

      How often and how quickly "quick and dirty" test code becomes "mission critical" production code...

  2. Michael H.F. Wilkinson Silver badge

    The code was well structured but ...

    I started working on extending an image processing tool set developed by a previous researcher, and on the whole, the (mostly Pascal) code was well structured and neat, except ... comments were "sparse", and most often limited to

    (* oops! *)

    or the more mysterious

    (* wulf! *)

    The latter was an odd catchphrase of said researcher if something unexpected occurred. Furthermore, most variable names were most often single letters, with the worst offender usually 'l' (lower-case L, so easily confused with '1'). In later years I could always tell that a piece of my own code was written shortly after a visit to my former colleagues work, because variable names were (considerably) longer than usual, and the density and clarity of comments were considerably higher.

    1. DJV Silver badge

      Re: The code was well structured but ...

      A place I worked at 25 years ago had a Perl programmer who tended to write obscure (even for Perl) code with a complete dearth of comments, apart from one central and essential part of the code that contained the following gem:

      # This is a skanky hack

      His replacement found it easier to rewrite the code from scratch rather than attempt to figure out what it actually did.

      1. Stevie Silver badge

        Re: a Perl programmer who tended to write obscure (even for Perl) code

        We had a consultant who wrote seriously obfuscated perl and used it to suggest to mgmt that everyone but he should be fired as the staff were incompetent.

        He got fired instead, but his code stayed.

        When I was given the 'difficult to understand' code to maintain I, the only non-exclusively-unix staffer in the shop, fed the code into Scite and the shenanigans were made manifest and easy to understand.

        Styling editors, lads 'n' lassies. Beats the obfuscators every time.

        1. Blofeld's Cat
          Devil

          Re: a Perl programmer who tended to write obscure (even for Perl) code

          "He got fired instead, but his code stayed."

          I got landed with trying to sort out some code that had been hacked together by such a consultant.

          Developed using the Borland C IDE (remember that?), his masterpiece mixed bad C code with blocks of embedded assembler "for performance". Comments were of the "you shouldn't get here" variety.

          I wasted half a day going through something that couldn't possibly compile, let alone work, only to find that the genius had excluded that particular source file from the Make with an obscure command line switch.

          1. Stevie Silver badge

            Re: a Perl programmer who tended to write obscure (even for Perl) code

            Had one of those too. Was asked to take over Project Millstone from a consultant who had rigged the compile process to fail unless manually tweaked after 'gather underpants' but before 'profits'.

            I tried to address that systemic problem but by doing so made an enemy of our manager who preferred to have everything break so he could rush in and fight the ensuing fire in front of *his* managers.

            So he gave the project back to Mr Shirthead.

            Who then did something so unspeakably unethical he was told to not come back from his vacation.

            Wherein the now-panicked Mr Manager decided to ask me to take over Project Millstone again, and was astounded when I politely declined the 'honour'.

            There followed a couple of months in which Mr Shirthead's projects (which were manyfold) were turned over to various people who actually knew what they were doing (rather than being miserable hackers who gaffer-taped stuff together), who then threw appalled hissy-fits and spent a shirtload of money 'making good'.

            But Project Millstone went to someone else, I'm glad to say.

      2. Matt Korth

        Re: The code was well structured but ...

        > His replacement found it easier to rewrite the code from scratch rather than attempt to figure out what it actually did.

        Been there. Done that. My manager asked me to evaluate some data migration code written by *her* boss, involving Microsoft Access .mde files and a database with a single table, where the columns were Data1 through Data75. Looked at that database, looked at the code (VBA, naturally), tried to figure it out, and went back to my boss and said that the code was beyond hope and should be rewritten.

        It turned out that her boss had been embezzling - those migrations were supposed to have been contracted out, and he was pocketing the cash and writing the stuff himself.

      3. Andy A
        Holmes

        Re: The code was well structured but ...

        # This is a skanky hack

        Reminds me of a comment I found in the ICL 2903 Executive (basically the low-level OS) listing. In the several inch thick folder of assembler code was:

        # CAUTION - THIS CODE IS BASICALLY WRONG, BUT HAPPENS TO GIVE THE RIGHT ANSWER BECAUSE THE SPOOLFILE HAS 2-BLOCK BUCKETS

    2. Anonymous Coward
      Anonymous Coward

      Re: The code was well structured but ...

      I try hard to properly comment my code. One bit at work even has something like:

      /* [Simple one-liner that looks like it would do the job of the next 2 dozen lines of code] */

      /* Nope, you can't do it that way because [explanation] */

      The above was after I went to modify/port my original work, realized I could do it as a one-liner, and promptly spent half a day trying to find how to set an option in that one-liner that was absolutely required for our application - but wasn't supported by the function I was calling. Which I think I did the first time too.

      One one occasion, I wrote something like:

      /* Don't modify this next bit unless you really, truly, deeply understand how it works. Here be dragons. */

      Be kind to the next maintainer by writing lots of helpful comments - it may be you!

      1. Doctor Syntax Silver badge

        Re: The code was well structured but ...

        /* Nope, you can't do it that way because [explanation] */

        I'm reminded of the saying that beginner programmers write comments that say what the code does, journeymen programmers write comments that say why it's doing it that way, great programmers write comments that say why it shouldn't be done some other way.

        So congratulations.

  3. GlenP Silver badge

    The Worst...

    The worst bit of report writing I've seen wasn't even by an amateur, it was from a professional consultant (who'd probably reused it from somewhere else).

    Instead of using the VAT value field from the data table he'd used a calculated field of VAT = VALUE * 0.15, which wasn't necessarily the case when the report was written and certainly failed when the standard rate changed to 17.5%.

    There was another report which wasn't working and apparently this was preventing final sign off of the ERP implementation* so the consultant decided to come in to our office and, "Could I bring a junior with me for the experience?" That was fine with us, except that they then billed us for two people, for a day, at £1,100 per person per day when one had sat around the whole time with a bemused look on his face and the other had spent all day working on the report and still failed to fix it. Despite my lack of knowledge of the ERP system and reporting services (I'd come from AS/400 environments and was new to SQL Server) it took me about two hours to find and fix the problem. I rejected the invoice but I think my boss paid up in the end just so the project was completed.

    *I'd come in after the implementation was supposedly complete, it took another two years before I resolved most of the issues.

    1. MatthewSt Silver badge

      Re: The Worst...

      > one had sat around the whole time with a bemused look on his face and the other had spent all day working on the report and still failed to fix it

      Which was which...?

    2. MiguelC Silver badge

      Re: The Worst...

      What about IF YEAR > 50 MOVE 19 TO CENTURY?

      This hack created a million jobs between 1997 and 1999

      1. jake Silver badge

        Re: The Worst...

        "This hack created a million jobs between 1997 and 1999"

        No, that had been almost entirely fixed before 1990 ... the kludge you are thinking of that was creating jobs in that time frame was HTML.

        We won't talk about the dot bomb bubble ... nor today's AI bubble.

    3. spuck

      Re: The Worst...

      the consultant decided to come in to our office and, 'Could I bring a junior with me for the experience?'

      And then they had the audacity to bill you full-rate for this "junior"'s training time? Wow.

      A few months ago we had Dell in to repair and perform an update on a storage array. They quoted us 2 days labor for an engineer. After the engineer spent the first day on a journey of self discovery between the rack and doing research in his car in the parking lot (for Internet connectivity), the next day 3 of them showed up. And all three came back the next day. And the next. And again on Friday. After a full week of work, the array was finally back in action.

      We haven't seen a bill yet; I want to believe it's because they've decided to waive it because of the bumbling around, but I suspect it will be discovered and delivered by the end of the quarter...

    4. J.G.Harston Silver badge

      Re: The Worst...

      When I did some work experience in the 1980s I did similar, cost=item*quantity*1.15. I thought "vat" was some weird latinate name for some wierd constant, like "dozen" or "gross". Telling me to make it a variable was like telling me that pi was a variable, changable at the whim of politicians.

      1. Doctor Syntax Silver badge

        Re: The Worst...

        For some politicians that's what pi is.

    5. Anonymous Coward
      Anonymous Coward

      Re: The Worst...

      That's when you don't just reject the invoice (since they didn't get the job done) - YOU bill THEM for the two hours of fixing their mess!

    6. Andy A
      Pint

      Re: The Worst...

      In my first job (all mainframes in those far off days) we had a subroutine which was included in hundreds of COBOL programs. It took a value, a transaction date and a code which indicated the type of VAT to be applied (standard, exempt, zero-rated, luxury goods) and returned the VAT applicable. Depending on the transaction date, it could even report the rate for "Purchase Tax", which predated VAT.

      With Budget Day approaching, I was tasked with being ready to make a speedy update. I read the code and was amazed how inefficient the original author had made it.

      A single variable was used to index into the tables of dates and applicable VAT rates. It was defined as "PIC S99".

      Incrementing this variable meant converting to binary (taking notice of whether the first character was "+" or "-", adding one and then converting back to characters.

      Changing this to "PIC 99 USAGE COMPUTATIONAL" (no sign, because the index could never be negative) caused the compiled size of the routine to reduce by 95%.

      There was no change in the VAT rate that Budget Day, but we made certain that every possible recompilation used the new version. Time, memory and disk space all saved!

      Then it was off to what was described on the office phone list as "Canteen (Duke of York)".

  4. 42656e4d203239 Silver badge

    Confession

    I had to help remediate a coding nightmare that I made...

    Years ago I wrote some shonky code - not surprising it was shonky, as all my code is sub-par; I am not a good programmer. This code was a quickish hack to get someone off my back cos they didn't have a scooby how to solve a problem. It involved Adobe API calls from a MS Word Macro IIRC to take RTF documents and draw them rather more prettily than they started and output a PDF.

    Needless to say, years later, someone plonked their arse down beside me and said "this code you wrote doesn't work any more"

    My initial position of denial of any involvement didn't stand up well in court, owing to the comment at the top of the macro claiming I wrote it. Never mind, deflection of blame is second best!

    "Not surprising" says I "Adobe changed a load of stuff between then and now. No one paid to maintain the code. I haven't looked at it in years. Tough titties"

    Then came the dreaded statement "Well 'we' are going to fix it, we just need you to explain how it works". Much mirth and hilarity ensued and I learned never to add my name to anything I wouldn't stand by many years later.

    Guess I shot my own feet by not bothering with copius comments... I had to unpick how it worked was supposed to generate the reports and they re-coded it, I trust rather better commented and structured.

    1. Mishak Silver badge

      Best plan

      Always put someone else's name at the top...

      1. Dan 55 Silver badge
        Holmes

        Re: Best plan

        That's why I always compare the name against svn/git blame...

        1. KarMann Silver badge
          Trollface

          Re: Best plan

          And my .git/config file always starts with name = Dan 55 under [user]. Problem solved!

          Yours,

          Dan 55

          1. klh

            Re: Best plan

            And after one experience with that at one job I sign all my commits and turn on checks for that everywhere.

        2. C R Mudgeon

          Re: Best plan

          That's fine nowadays when there's source control. Go back far enough and there wasn't.

          No "blame", no revision history, no commit messages -- just the current state of the code. *Shudder*

          1. Anonymous Coward
            Anonymous Coward

            Re: Best plan

            That's fine nowadays when there's source control. Go back far enough and there wasn't.

            No "blame", no revision history, no commit messages -- just the current state of the code. *Shudder*

            Unfortunately, I know some people for whom the use of the past tense in describing that horror situation is sadly untrue.

            Yes, and despite my constant reminders, they often still develop their stuff on 'live', completely outwith the repo, even though I thought I had won the battle (it shouldn't even have had to be a battle!) for separate dev and live, and the use of repos, years ago. OK, it's small(ish) project, small team stuff, but it still infuriates me. Sadly they "outrank" me and there's nothing I can do...

            1. C R Mudgeon

              Re: Best plan

              I've upvoted your comment, but dang, do I want to downvote the people you're talking about.

      2. Anonymous Coward
        Anonymous Coward

        Re: Best plan

        Always put someone else's name at the top...

        Even better than the plausible deniability of anonymity. Superlative if the moniker is of chap who was already deceased when he wrote it.

        1. Anonymous Coward
          Anonymous Coward

          Re: Best plan

          selected randomly from last weeks obituaries column?

          1. Anonymous Coward
            Anonymous Coward

            Re: Best plan

            "Hey, did we really have David Bowie writing code for us?"

            (cough) "Of course, that is we have bugs the size of dogs, with fleas the size of cats; this isn't code, this is genocide!"

    2. PCScreenOnly

      Re: Confession

      Many moons ago I was maintaining and on prem ITSM system, and as with many, it is easier to use direct queries for reports than anything provided. So I wrote a whole bunch of stored procedures.

      A few years down the line and someone was still pulling some data from that system's DB - no idea why, we moved off about 4 years prior. I was asked "Is this one of yours?" I looked and knew damn well it was. It took me ages to work out what it was doing and to make the changes.

      At the time I created the Stored Procedure I could write things like that so easily. 4 years down the line and not doing any SQL work - arggh

      comments would not have really helped on that

    3. jake Silver badge

      Re: Confession

      I used to put my name at the top of most of the code I wrote ... right alongside a disclaimer which said plain as day that I was not responsible for the content, the performance, any loss of user data, upgradeability in the future, and about half a dozenish other things, some of which changed with the weather and/or the client.

      I still occasionally get email asking if I could help with shit I wrote three or more decades ago. I always reply with my standard rates. Strangely, they rarely get back to me.

      There is code I wrote for University course work that I do happily update (for free), when asked. That's becoming rare these days, alas.

    4. Anonymous Coward
      Anonymous Coward

      Re: Confession

      Years and years ago I wrote a simple bash script to harden Ubuntu installs. Simple stuff like add a functioning firewall, ssh rate-limiting, disable prompting for new OS versions (you'd not believe how many users click YES to anything then break machines... OK, maybe you would) and so on. All in a bash script that would fail safe and give error messages where needed.

      Because, as we all know, a simple bash script is what you use when you want the same sequence of commands to be run the same way in the same order every single time.

      Much later on, up pops a manager with an Idea. Not having a brick hammer to hand to quell such things, I asked him to explain. Apparently he thought (there isn't an English word for not-thinking a solution) that turning the script into a list of instructions for techies to follow was a very good idea, and he wanted my help to accomplish this great leap backwards. Grudgingly I was forced to do just that, although I made sure to include the use of ed to edit lines, just to convince anyone trying to use the abomination to look elsewhere.

      The manager has now left, and my script has been quietly retired, as has his epic work of stupidity.

  5. Anonymous Coward
    Anonymous Coward

    Nuke from orbit

    Many years ago I worked as an IT analyst at a UK University's Psychology department. I provided tech support, maintained a few basic servers and also did programming for experiments (programmed in C++, accessing external button boxes via parallel port and utilising DirectX to ensure millisecond-precise timing).

    One of the PhD students had been given a program by his supervisor (a senior lecturer) for him to tweak as part of an experiment he was planning. The PhD student couldn't get to grips with it and asked me for help. Foolishly I agreed.

    Good god, I've never seen such a spaghetti-mess of code. No consistent indenting, no comments, one massive and convoluted block of code without any supplementary functions, numerous bugs - including two bugs that ironically ended up cancelling each other out such that the program just about limped through the supervisor's original requirements. I scratched my head over it for 20 minutes or so before deciding that the best (and quickest) thing to do was to nuke the entire site from orbit and re-write it from scratch.

    So that's what I did. Got the requirements from the student and wrote the program from fresh ensuring it had proper indenting, used well-defined functions, a header file with constants clearly labelled so that the poor PhD student stood half a chance of being able to subsequently tweak the code and parameters for future use. Final program worked a treat and it was certainly a lot easier writing good code from scratch than trying to salvage the pig's-breakfast I was presented with originally!

    Some code is simply beyond saving...

    1. Anonymous Coward
      Anonymous Coward

      Re: Nuke from orbit

      So many time, in my brief (5 years) career in dev, have I learnt to press the NUKE button !

      Every time because of a poor sod with 0 understanding of programming and even less of the language he was instructed to use, was long gone & no-one had a clue how to update this ... Write once, read or update NEVER.

      I remember a Fortran program (/spit on the floor) used in particle collision research, used to scan tapes used to collect events, looking for specific event.

      All spaghetti code, use & abuse of goto, functions ? what is that ? The thread of it all was undecipherable to the point I thought part of it was actually never reached !

      Worst of all: the program was having a fortran source as parameter that it would compile & run on each event !

      Performance was atrocious which triggered the need to review it.

      2 days in this mess & I nuked it and rewrote the whole thing in a 20th century language (aka, C) ...

      1. jake Silver badge

        Re: Nuke from orbit

        A lot of the code written for the various particle physics labs was written in Fortran. It wasn't all bad. If it was, I wouldn't have spent as much time as I did at SLAC ... Some of it would have undoubtedly benefited from being re-written in C, but the folks actually using the code day-to-day only knew Fortran.

        They still use Fortran in that world. It's not everywhere, perhaps, but it's pretty common. When in Rome ...

        1. Herby

          Re: Nuke from orbit

          Fortran...

          Yes, Fortran 66 (as exemplified in Fortran 4 level H on the S/360) is an improvement on all Fortran compilers (past and future). By god, have you seen the things they've put in to Fortran 90, or later "standard" ones??

          Of course, the Fortran G compiler was pretty good as well. Faster to compile, but didn't produce as efficient code.

          1. Cheshire Cat
            Go

            Re: Nuke from orbit

            My very first paid gig was Fortran66! (Summer internship)

            In my lunchtime breaks, I also wrote a boulderdash game in Fortran66, which was a challenge because it did not support recursive functions.

            1. Jou (Mxyzptlk) Silver badge

              Re: Nuke from orbit

              Well actually: If you do anything recursive on machine of that time you are doomed. I had several fractal-recursive logic programs from magazines which broke the 12277 byte free limit of my C16. So I implemented it as either life-iterative or as list-depth-state style. By that time still in basic. That allowed "recursion" depths a lot more deeper than even the 64 KB variant (with 60671 bytes free) could handle, while needing less that 4 KB at the same time. Simply 'cause each "recursion" step more only required about two bytes (or four 'cause 16 bit INT ?)

    2. Wellyboot Silver badge

      Re: Nuke from orbit

      Poor code - just needs tweaking, this is a classic common decision process repeated across the IT world many times daily.

      But this is from a Psychology department senior lecturer, are you certain you weren't being used as a problem test subject?

      1. Mast1

        Re: Nuke from orbit

        "... you weren't being used as a problem test subject"

        These days only "minor deceptions" tend to be allowed in ethically-approved experiments (and the deception has to be revealed at the end).

        Despite these safeguards, I am still shocked by how desperate people are to appear on television "reality" shows that they will submit themselves to being a test subject in an otherwise completely unethical setting.

    3. Anonymous Coward
      Anonymous Coward

      Re: Nuke from orbit

      "Some code is simply beyond saving..."

      I would dispute the some. "Most" would be more accurate.

      As a BoFH in an academic environment one is presented with code that would make your eyes bleed if not actually melt in their sockets†. Generally the best approach was the sergeant Schultz response "I know nothing." About the only language I wouldn't have seen would be Algol 60 or 68 (if you don't count Simula 67.)

      Very, very occasionally a talented student would write beautiful code but trip on some subtle feature of the system, the toolchain or the language. Assisting those rare few was almost as satisfying as the defenestration of the many. ;)

      † the best scene from Raider of the Ark. I can nominate a few latter day Nazis the Ark is welcome to incinerate.

    4. KarMann Silver badge
      Facepalm

      Re: Nuke from orbit

      I must admit, as I was reading, I was really expecting more and more for it to end with something along the lines of '…and then, I realised I'd written this code 8 years earlier!' or something like that.

      1. Dave K

        Re: Nuke from orbit

        Heh, I wrote better-organised code than that when I was an 11-year-old being taught to program in Pascal by my dad on our old 386!

  6. Tubz Silver badge

    Back in my youth, was working for local council computer department when they had a full mainframe rig, was tasked with writing some Cobol code for the benefits section and was told off for putting in extensive comments, as they complained how much extra memory it would take when running on the mainframe. They couldn't grasp that the code was compiled, and comments ignored, so being the junior, I ripped out all the comments. I had a phone call from my old boss a few years later after I had left asking if I knew why such and such was misbehaving after they had done some code updates but they couldn't follow the source code, now leaving on good terms with him, hoping to return if possible, I told him I left a copy of all my code in my notes folder, hidden at the back of the old fire safe that held tape backups and disaster recovery stuff. Met up with him the next weekend and he got me well and truly wasted on fine ale.

    1. jake Silver badge
    2. therealpieman

      You forgot the Beware of the Leppard sign

      1. Wellyboot Silver badge

        Was it Def ?

        1. John Brown (no body) Silver badge
          1. The Organ Grinder's Monkey

            Def Leppard, dreadful big-hair metal band from Sheffield (?) noted for their one-armed drummer (consequence of a particularly nasty & difficult to achieve incident involving a car crash, a seat belt & leaving at speed through the sunroof, or that's how it was explained to me, anyway.) He had the full set of arms when he started with them.

            1. John Brown (no body) Silver badge

              Yeah I know who Def Leopard are.

              See the icon :-)

              Def = Deaf :-)

  7. Ian Johnston Silver badge

    Let's not forget that Horizon, Birmingham Council's Oracle implementation and every IT fuck-up in the NHS were all written by professionals. In IT, as in so much of life, Smol's Law[1] applies:

    A professional knows exactly how bad a job they can get away with, while an amateur does the best job they possibly can for the love of it.

    [1] I first heard this expressed by the wonderful Gaby Smol.

    1. jake Silver badge

      Yeah, but ...

      ... professional WHAT, exactly?

      Professional fuckups?

    2. Bebu sa Ware

      "A professional knows exactly how bad a job they can get away with, ...."

      "A professional knows exactly how bad a job they can get away with, while an amateur does the best job they possibly can for the love of it."

      Could apply with even greater applicability to a very much old profession.† Moll's Law?

      † arguably both trades involve a soft something and invariably f...ing that something.

    3. C R Mudgeon

      "... knows exactly how bad a job they can get away with..."

      I had a friend who worked as a welder for a ship builder. His metric was: work just hard enough to keep your boss from getting in trouble from *his* boss.

  8. Evil Auditor Silver badge
    Mushroom

    That "developer" was in the limbo between knowing enough to break stuff and not knowing enough to get something done. And, possibly, believing they "know stuff". Developing-wise, these were some of the most dangerous people I've met.

  9. C R Mudgeon

    The guy I worked with...

    ... (not closely, thank the gods) who thought that he was finished his assignment when he'd found a set of inputs for which his code worked. The idea that he had to keep going until he couldn't find a set that didn't work was utterly beyond him.

  10. AlanSh
    FAIL

    At least I got something out of it

    Back in the late 70's, I was asked to find a payroll program for my company. Another company made a proposal which we accepted. Once in place, we were given the source code. It was all wrtten in Basic and was awful. No comments, lots of "goto"'s to jump over code or jump back somewhere. I then found it was written by someone who'd been on the same university course as me. God knows how he passed his exams.

    So, I ended up rewriting it - with extensive phone calls (because I knew nothing about tax codes etc.) to my friend. But he did one good thing - introduced me to the Hitchhikers Gude to the Galaxy, which was just being broadcast on the radio.

    Alan

  11. GeekyOldFart

    A notable exception

    At one point I was asked to make some minor tweaks to some code written by one of these untrained types. I griped, hard, about being assigned the task, I knew what I was going to get - spaghettified, uncommented, the kind of mess that's been related in all the other comments here.

    To my surprise this was not the case. The comments in the code were comprehensive and clear enough that the source truly was entirely self-documenting. Even where I found myself raising an eyebrow and thinking "I wouldn't have done it like that," what the original author had done, and why, was perfectly clear. Making the required tweaks was an absolute doddle as a result.

    A few months later, I actually met the original author and complimented him on it. His response?

    "Oh, I know I'm not a good programmer so I lay out the entire design as comments first, then just write the functional bits to match what the comments say it should do, one piece at a time."

    "Keep doing that." I replied. "It works."

    1. spuck

      Re: A notable exception

      I once had a wise co-worker with that approach. Only after there was nothing left to write in English was it time to start writing in Computereze.

    2. John Brown (no body) Silver badge

      Re: A notable exception

      "Oh, I know I'm not a good programmer so I lay out the entire design as comments first, then just write the functional bits to match what the comments say it should do, one piece at a time.""

      Back in Uni, some decades ago, we were introduced to Jackson Structured Programming as an alternative to "traditional" flowcharts, which is essentially what you describe IIRC.

  12. disgruntled yank

    """

    reviewing the documentation.

    Not long into that effort, he noticed it contained an executable, tested it, and found that it produced perfect reports.

    ""

    The documentation mentioned an executable? One commonly found on all Pick machines, or how?

    I will say that it would be useful for all programmers to encounter a system like this early in their careers. There is nothing quite like puzzling through somebody else's undocumented, ill-structured code to give one an appreciation for documentation and structure.

    1. Robert Carnegie Silver badge

      I think it's that the documentation for this reporting requirement comes with specimen program code and/or a binary executable standard implementation, and that was all that the job needed, or was 90% of it. So that the consultant-written version was completely unnecessary. Though if the consultant was asked and told to write it, then that's what a consultant does.

  13. Screepy

    Myself

    "Who was the least qualified person you've had to clean up after?"

    My younger self

    1. jake Silver badge

      Re: Myself

      The current code in the one greenhouse that hasn't been updated to AtMega 328 yet is still running software that I started writing about 50 years ago, and finished about 40 years ago[0]. I think I got my money's worth out of the original Z80 & S-100 bus ... that system is now being emulated on a headless Slackware laptop. The code is pretty ugly, especially the very early stuff. Looks like it was written by a kid ... but it works.

      [0] Yes. Software that is finished. Really. Running untouched, with no troubles, for around 40 years. It can be done.

      1. agurney

        Re: Myself

        ...started writing about 50 years ago

        I wrote a program that takes Dover HW and LW times and creates tide tables and corrections for a variety of locations on the Scottish west coast for sailors .. I only run it once a year so have never bothered converting it from QBASIC .. hence having a rarely used Windows 98 (or is it '95?) VM. If it ain't broke don't fix it (there be dragons!)

    2. Already?

      Re: Myself

      Mine too. Years ago I was a half decent COBOL programmer; ahead of a new project was asked if I knew ASP. Sure I confidently breezed before quietly borrowing the then current VS install discs to spend the weekend figuring it out. By Sunday I had a working web app. Over time the web app became a useful resource for my personal use and as new technologies arrived - ASPX, and VB.Net, then C#, newer versions of SQL Server etc - it became a test bed for getting to grips with them.

      On my (semi) retirement a couple of years ago I planned to rewrite this now quite expansive and v useful web site properly, in MVC as that had been my last project. Trouble is that a) it’s huge, b) awful in places but works, and c) runs off a huge number of stored procs that I could rework as LINC etc but really CBA. I’m retired. Spending the next 6 months or so at a PC making it slightly better? No ta.

  14. Anonymous Coward
    Anonymous Coward

    Vibe AI

    I was at an event this week talking about venture capital and innovation. There were panellists with tens of millions, hundreds of missions and actually billions under management. They all equated innovation with using AI. They had just begun to "digitise" then were using "ai". All were very proud that they had saved money by getting this work done by interns or junior staff rather than paying for expensive information architects or data engineers. None mentioned the models they used, the training they had created, hallucination or data security. They did mention GDPR and regulations, as things stopping them from using more AI. There was a lot of energy and excitement in the room. I was reminded of the scene in 2001 A Space Odyssey where the apemen discover they can use a bone as a tool.

    1. Robert Carnegie Silver badge

      Re: Vibe AI

      Arthur C. Clarke revisited the subject in "3001".

      Apparently the apemen absolutely weren't meant to do that with their new tools. Big black rectangles are judgemental. I'm not sure exactly how the timing works, but when news got back to the Great Rectangle, 500 light years away, it concluded that we were trouble. And you don't want to be on the wrong side of the Great Rectangle.

      1. Robert Carnegie Silver badge

        Re: Vibe AI

        Afterthought: in Clarke's 1946 story "Rescue Party", his first sale to "legendary John W. Campbell, Jr.", space travellers discover a planet whose evolutionary and scientific progress was extraordinary... until the star got ready to explode. At slight risk of spoiling, I don't remember that the story includes any suggestion that this was done on purpose.

        Clarke also wrote "The Star", which I do spoil, in which explorers from Earth discover a formerly inhabited planetary system whose star's explosion was seen on Earth at around the time of King Herod. The system's inhabitants were philosophical, and their library was carefully preserved at a safe distance, but that's all that's left.

  15. Tommy G1

    So you forgot how your code worked... hold my beer

    I'll go one better

    While trying to write some code to interface with a particularly fussy CNC spindle controller, I did what all normal humans do, searched online to see if someone had already solved the problem.

    Found a repo that did almost EXACTLY what I was trying to achieve and started copying. Half way through I started to get a vague sense of deja vu and checked the name of the repo, it was my own!

    I'd written code to do the same thing about 5 years previously and had completely forgotten.

    1. KittenHuffer Silver badge

      Re: So you forgot how your code worked... hold my beer

      Been there ..... forgotten that!

    2. BenDwire Silver badge
      Pint

      Re: So you forgot how your code worked... hold my beer

      I had a similar experience when completing a mountain of paperwork for the EU bureaucrats (back in the day). I had set aside a whole day to do the task, and completed it well before home-time. However, when I came to file it away, I found that I'd already done the work a few weeks earlier. I had no memory of doing it at all, despite it being a complete ball-ache to do.

      At that point I decided that I was no longer up to the job of running a company, and chose to retire - one of my better decisions!

      Ooh! It's beer O'Clock!

    3. Timo
      Pint

      Re: So you forgot how your code worked... hold my beer

      Good thing you took the time to post the solution online. Its like a letter to your future self!

      Once you've solved the problem its too easy to not do the final wrapup and just jump into the next problem to solve.

    4. jake Silver badge

      Re: So you forgot how your code worked... hold my beer

      A couple of years ago I was called in to help with memory timing issues on a DEC PDP restoration (was an early, DEC FSE installed, core-to-DRAM conversion), so to refresh my wetware I cracked into the dusty, not opened in probably decades, manuals that came with the kit ... and found the answer immediately. In my own handwriting. I have no idea when I wrote it, but it was before I started dating such scribbling, in 1983 ...

    5. the spectacularly refined chap Silver badge

      Re: So you forgot how your code worked... hold my beer

      I've done that before. The scary thing is when you read the notes and it still doesn't click:

      "Yes, I've thought that too..."

      "I've noticed that..."

      "Yeah, that's the same approach I take..."

      "He knows what he's talking about this chap..."

      Then you reach the sign off and only then notice it was something you wrote a decade previously.

      I'm not sure if it should fill me with confidence or be ashamed of a lack of personal development that I've never found myself disagreeing with me.

  16. Just Enough

    Dangerous fix

    It's a fix, but a dangerous one. If all "Bryce" did was by-pass the last developer's code to get to the original executable, he'll never know what the last guy's code was supposed to be doing. It may have been dreadful, but it wasn't there for no reason.

    Chances are it was fixing, badly, a bug that will rear its head again in due course. Or adding something new that's absence will become noticed within the following year. If Bryce really wanted a gold-star, his next job would be to try to work out what the crappy code was supposed to do, and just as importantly, why.

    1. Anonymous Coward
      Anonymous Coward

      Re: Dangerous fix

      Very likely, the last guy's code was doing exactly what the executable provided with the documentation was doing, as he hadn't found it. But very, very badly.

  17. Electronics'R'Us
    Holmes

    No error returns

    Back around 1999 / 2000 I was doing diagnostics for a video on demand system. Quite an impressive beast.

    This newer system was based on a 3U compact PCI rack with our own designed cards apart from the control processor (a power architecture). It communicated with a host over sockets.

    The initialisation was not particularly complex but did have to do PCI enumeration and then initialise all the cards in the rack.

    One fine day when I was looking at this fairly new system, I was rather surprised to find that none of the initialisation code (including the enumeration phase!) tested for successful completion. After a (failed) initialisation that was totally silent, I would be met by an error message that the system could not be reached.

    I set about rectifying this by adding a status word that cleared a bit for each part of the initialisation when it succeeded. At the end of he init, that status word was returned to the host. If it was non-zero, something had failed but just what was obvious as it would be the first non-zero part of the status word.

    Took me about 4 hours or so [using ioctl() over a socket]. That as eventually added to the production version because the customers were complaining of silent failures.

    Even back then, we had the 10 commandments for C programmers many of which apply elsewhere, in particular number 6.

    Sheer laziness imo.

  18. Stevie Silver badge

    Bah!

    Many years ago I took my first contract at a small printing plant to write code in Applications Manager.

    That language was a list of parameters that a central program would decipher into VT-> Mainframe applications. Not in any way man-sensible (to use a phrase current at that time).

    The method of making these things was to construct a 'logic chart' of drop-thru conditions and then turn that into the code.

    The department was very small, and the DPM was well-loved. He didn't use logic charts, so no-one did. And they really needed to.

    I was asked to debug one of tghe programs and offered extra hours to do it, and for a week I took over a really long table (printer, remember?) and opened up the yards of greenbar carpet, crawling down it with a highlighter.

    The programmer had obviously started an idea train, worked it all day, then come in the next day and completely forgotten what they were doing, so started anew. There were entire paragraphs of code that were never accessed, but it took ages to discover that with enough confidence that they could be cut out. In retrospect I should have just asked for the spec and rewritten it.

    Part of the problem lay with that spec, which had several different functions bundled into what should have been a bunch of single function transactions. Well, analysts and programmers were all relatively new to the job.

    Eventually I had it all sorted out on a Friday, and I left the resulting code in the library to be promoted to production, and left to take up a weekend of drinking.

    Monday morning I was approached by the boss to ask if I had any backup copies.

    "No" I said. "Why?"

    Because my suffered-over and laboriously edited code had been overwritten - by the original mess. The mangler responsible had not made a backup of anything before they started Operation Maximum Destruct.

    I shrugged and politely said there was no time now to do it over, because my contract was ending in a couple of days, which were to be filled with the finishing of my other scheduled work.

  19. Colonel Mad

    We had a Pick OS greybeard in out branch in the 2000's, apparently it requires a great deal of silent contemplation and a near horizontal seating position.

  20. UCAP Silver badge

    The flip side of the coin

    Nearly 20 years ago I did some work for a customer during which I wrote some C code that was used to generate derived telemetry parameters for a satellite system that was, at that time, being developed. When I finished I delivered a comprehensively documented, carefully formatted C module along with the test results that proved beyond a shadow of a doubt that it worked. A fun couple of months.

    About 18 months later I got a call from the lead developer asking if they could have a couple of weeks of my time since the satellite had been launched, but the code I had written needed to be tweaked because some bugger had wired a part of the system incorrectly. The satellite still worked fine, but the derived parameters where generating incorrect values. Unfortunately, I was busy on another project so I had to tell them that I could not be made available for about 6 months. The response I got was: "that's all right, I had a look at your code and it was so well documented that I could figure out what I needed to change in about 2 minutes - it's working now".

    1. Robert Carnegie Silver badge

      Re: The flip side of the coin

      Remembering the initial state of the Hubble Space Telescope, you could have got a ride up to the sky to fix your work if you hadn't done it so well the first time! But then again, remembering "Independence Day", it isn't purely a pleasure.

  21. AdamWill

    That was below the belt, El Reg

    "Self-taught coders who work in HR and have a doctorate in English tend to do that"

    Please skip the insulting stereotypes. A lot more professional programmers have arts degrees than you might guess, and a lot of us are perfectly good at it. And there are plenty of computer science grads who can solve the travelling salesman problem all day long but are terrible at writing real-world software.

    1. midgepad

      It isn't actually harder

      ...to output properly formed grammatical English messages in and from programs, than to be overly terse or obscure.

      A Humanities type might be good at that, but there's no reason the rest shouldn't be.

    2. Anonymous Coward
      Anonymous Coward

      Re: That was below the belt, El Reg

      Indeed. I know a guy who, before retirement, was one of the top 25 AI researchers in the world. (Real AI, not the overhyped probability machines currently called "AI".)

      He has a Bachelor's in chemistry.

  22. Androgynous Cow Herd

    OMG Pick!

    Never thought I'd see reference to that anywhere...

    One of my earliest, learn ingest jobs was, in the 1990s, maintaining a Pick system used in royalty tracking by the music industry - by that point, the application had been ported over from minicomputer to RedHat lLnux (pre RHEL, MUST be 7.2, neither &.1 nor 7.3 supported), but in order to get the thing to print the phone book sized reports then in vogue, THAT in turn had to be grafted onto a Windows system to use the printing subsystem...because, I guess, the vendor found CUPS to be too hard.

    Any firm engaged in royalty tracking or enforcement would have a subscription to the service - which came with a weekly or biweekly update of the data, delivered on tapes (DLT I think) that had to be restored into the system for the usage and licensing info for every published song in the database. IT was an enormous amount of data for the time with records that went back to the 1920s at least (one of our clients had royalties streaming to his grandchildren because he had died in the 1950s...)

    I wasn''t a developer, just an admin/fledgling DBA who had this steaming pile of legacy, non-OBDC compliant crap dumped in his lap. The software was incredibly expensive, the support cost was egregious - but the underlying application from the Stone Age of computers was the sole source of truth for royalty payments that apparently was in use by most all of the entertainment industry. Because of the huge amount of data in a decidedly non-portable schema, it would not surprise me in the least to learn that it is STILL in use by the music industry -

  23. J.G.Harston Silver badge

    An "app"? In the 1980s?

  24. billdehaan
    WTF?

    Least qualified I've cleaned up after? Too many candidates to choose from

    I did contract work since the 1980s. We didn't have the terms then, but I was what today would be called a "duct tape programmer", and most of my work was fixing/recovering from/undoing the work of what we call "architecture astronauts" today.

    There was the $BIGCORP who bought a $SMALLCORP an inhaled their codebase. The $SMALLCORP had a self-taught BASIC programmer, and a $BIGCORP Pascal coder was ordered to recode the BASIC into Pascal. Unfortunately, it looked like the $BIGCORP programmer understood neither BASIC nor Pascal.

    The original BASIC coder had tried, I'll give him that. GW-BASIC ("gee whiz") didn't have data structures or boolean variables, so the BASIC code had added int FALSE=0 and int TRUE=1 at the head of his 8,000 line program, and there were lots of int ValidInput = FALSE; and if (ValidInput = TRUE) then constructs. It was actually quite readable, given the limits of the language.

    The Pascal code, however was not. The coder had basically just copied over the BASIC into Pascal, compiled it, failed, and cut out what didn't compile. Because Pascal does have boolean variables, int FALSE=0 failed to compile, so the code fixed it to be int NO=0 and int YES=1. And so all of the boolean logic was done in integers, with if ( booleancondition = YES ) code to get around the pesky problem of not being to use TRUE or FALSE "properly".

    The coder also "improved" the basic code by using negative logic. This was "hurts my brain to read" negative logic. Where normal humans would say if ( x or y ) then z();, he would write if ( not x and not y ) then do nothing; else z();. He also didn't realize Pascal can do character and string operations, so he did everything in ASCII numerics. With negative logic.

    Here's a simple function. Forgive my Pascal syntax, this is from a 40+ year old memory. Also, apologies for the formatting being a mess, el Reg's HTML editor throws away all of the code formatting, no matter what I do.

    function validchar( c : char ) : integer;

    var

    i: integer;

    rc: integer;

    begin

    i := int(c);

    rc := NO;

    if ( not ( i >= 65 and i <= 90) and not ( i >=97 and i <= 122) ) then

    (* do nothing *)

    else

    rc := YES;

    validchar := rc;

    end;

    For those whose eyes glaze over at that, all it's doing is this:

    function validchar( c : char ) : boolean;

    type

    ValidChars = set of 'A' .. 'Z', 'a' .. 'z';

    begin

    if ( c in ValidChars )

    validchar := true;

    else

    validchar := false;

    end;

    And I'm not doing his original code justice, as the if/then/else nesting reached a depth of 40 levels, so trying to pair the else with the if that was 13 screen pages above was a nightmare.

    The original BASIC was 8,000 lines. The original Pascal code was over 40,000 lines, and he'd spent five months of the six month project on it, and it didn't work. I ignored the Pascal, took the original BASIC, and wrote a clean Pascal version of it in about a day and a half. It was under 1,200 lines.

    Then there was the architect who'd written the company's custom database. His code was already legendary. I once spent two days debugging two lines of a switch statement. The lead coder asked me why I was taking so long, and I showed him the code:

    switch(tecsrch(*(TEC**)(id[*f].ttype),id[*f].var,&s,s=3D=3Dstr?(*str?str:="[a-z]"):NULL,func1=3D=3DF02?1:0)){

    case -1 :

    s=3D(*id[*f].tecfnc)(*(TEC**)(id[*f].ttype),id[*f].var);

    if(*s)

    ...

    Thankfully, this was C, not C++. He hadn't started using templates yet. However, he did make extensive use of the SCO Xenix C compiler, which was a problem, as we were trying to convert his code to Linux (Red Hat) gcc. It turns out that gcc is (or was) "far too limited" to handle his code. For example, do you know that if you make a function call in gcc, it only passes the first 128 parameters? Everything after that is not passed on the stack! Do you have any idea how much code that breaks? For most people, the answer would be none, but he had over 800 function calls that used between 140 and 200 parameters.

    I was able to migrate some of his utilities to readable, coherent code, but much of it was unintelligable, and there were no requirements as to what it was even supposed to do. Fortunately, he was still with the company, so execs made him clean up the worst of it. He estimated it to take 2-3 weeks; when I left the company, he'd been at it for almost three years, and wasn't even half finished.

    The scary thing is that those two examples may be the most vivid, but I can name at least a dozen others.

  25. CorwinX Bronze badge

    At least we still have Pints of beer

    Though of course (quouting wiki)...

    "UK pint being 568 ml and a US pint being 473 ml."

    I think the same goes for Gallons of petrol/gasoline?

    And the Aussies have Schooners of beer which isn't quite the same as a Half-Pint.

    1. John Brown (no body) Silver badge

      Re: At least we still have Pints of beer

      ...and in the UK, there is a schooner of Sherry, about 100ml or so. Possibly it might be popular in Oz with the Sheilas to go with the truck load of XXXX :-)

      1. jake Silver badge

        Re: At least we still have Pints of beer

        In parts of Canada you can order a schooner of beer that contains 32 oz ... here in the US, we call that measure a quart.

        Yes, the standard American unit of liquid measure called "the pint" contains 16oz, However, almost all bars that serve pints of beer serve it in standard, British made (or reasonable facsimiles thereof), 20oz pint glasses. At least the bars that I've been in over the last several decades. I have also noticed in the last dozen or so years that many bars are keeping 22oz glasses on hand to decant the 22oz bottles which many/most micro/craft breweries ship at least some of their brews in.

        This might be a West Coast thing. I haven't been in a bar East of the Rockies in decades.

  26. CorwinX Bronze badge

    Haven't done much coding but it should be self documented

    Pseudo code...

    Function (Acme)

    # This Function does the Conversion from X to Y and is Called by Z

    Xxx

    Xxx

    Etc

    Properly written source code should require little external documentation for another coder to pick up the reins, other than an overview of functionality and usage.

    1. Jou (Mxyzptlk) Silver badge

      Re: Haven't done much coding but it should be self documented

      > # This Function does the Conversion from X to Y and is Called by Z

      Yeah right. "# This function adds 1+1" - without telling why or what it is for because it is so "bloody obvious where it gets used".

      You know the saying "me and God know how it works, a few months down the line and only God knows" - if you haven't learned that yet, you will if you continue coding. That will also teach you what comments you really need - well, I hope it does.

  27. Anonymous Coward
    Anonymous Coward

    Many years ago I developed training courses using a language called TenCORE. It had line numbers and goto statements that could be easily abused.

    I was asked to make changes to one course for a client. Looking through the code I found a goto that didn't go to a line in the same module. Not even a line in a different module in the same course. It jumped out to a line in a completely different course to the one I was working on.

    Once I managed to get the code for the other course I found a block of functionality the original developer had obviously decided they wanted to use in a whole bunch of other courses. So they all jumped into this one. It then queried system variables to find where it had come from so it could jump back to a target line in the original course.

    This obviously made things a bit tricky as changing any line numbers made the whole thing collapse.

    I fixed the insanity by pulling the code out of the target course and making it a subroutine in the course I was actually working on. After completing the changes and explaining to the client why it took longer than expected due to the insane dependency we were then asked to fix all the other courses as well, before being asked to build replacements.

  28. ColinPa Silver badge

    Covid

    Having read all of the comments, it made me think about the software used to guestimate the spread of Covid. It had once worked... and then been added to multiple times, by many people, and after it was "improved for publication" it was still hard to follow.

    They had problems like - run it twice with the same input, it gave different results. So there was clearly some problems ( because if you run it twice you should get identical results).

  29. trevorde Silver badge

    Stringly typed code

    Worked for a major CAD company, many years ago, doing API development. One particular API, written by a long departed predecessor, took a single string as a parameter with all sub-parameters separated by spaces. For the non-technical, this is very poor practice & only something a complete novice would do. The only thing we could do was to document the sub-parameters & point users to better designed APIs.

    Later on, we got hold of our major competitor's product, which also had an API. They also had an identical, stringly typed API! They had a chance to do it properly but deliberately chose to copy our stupid mistake!

  30. D-Coder
    WTF?

    For those of you who enjoyed these comments and may not be aware of it, TheDailyWTF.com publishes WTFs of various sorts but frequently bad / unintelligible code four days a week (and screwy screenshots on Fridays).

  31. Philo T Farnsworth Silver badge

    Self-taught

    The subhed in this story, "Self-taught coders who work in HR and have a doctorate in English tend to do that," made me wonder whether the editor has ever worked with physicists.

    I once had to maintain a FORTRAN program written at one of the US National Laboratories that had a 10,000 line main program that was a computed GOTO nightmare.1 And these were literal bomb guys who would travel out to the Nevada test site to watch things go BOOM in the night, back in the days of yore when we still did such tests.

    ___________________

    1 The code itself was not classified, was only tangentially related to weapons, and had other civilian uses.

    1. jake Silver badge

      Re: Self-taught

      "back in the days of yore when we still did such tests."

      This was from before we had our modern concepts of computers and programming. Remember, these guys were winging it, at best. The theory of "computer theory" didn't exist as yet, not really. These were the guys and gals who taught the folks who later taught us, and helped out with what we now call "the internet" in their dotage. Of COURSE it was crude back then! What else would you expect?

      Did the guy who first knapped a flint arrowhead immediately conceive of a modern firearm? How about a muzzle loader?

  32. Anonymous Coward
    Anonymous Coward

    Large law firm who's managing partner had given the IT admin job to his self taught son,

    His son had discovered group policies and set about improving security across their AD domain by locking out out *every* user, including all admin accounts.

    Across 3 offices with at least a hundred users per office.

    Fortunately he hadn't discovered EFS.

  33. anonymous boring coward Silver badge

    I'm sure that with AI this will never again be a problem...

POST COMMENT House rules

Not a member of The Register? Create a new account here.

  • Enter your comment

  • Add an icon

Anonymous cowards cannot choose their icon

Other stories you might like