Got something to say or just want fewer pesky ads? Join us... 😊

[News] Post Office Scandal -



KZNSeagull

Well-known member
Nov 26, 2007
19,835
Wolsingham, County Durham




withdeanwombat

Well-known member
Feb 17, 2005
8,699
Somersetshire
I lost contact with code when Morse died.

But surely it’s . . . - - - . . . time for Post Office management and protecting the brand?
 




Shropshire Seagull

Well-known member
Nov 5, 2004
8,510
Telford
One for the nerds. This is buried on a report and is a code extract from part of the system.

View attachment 173102

Although the code "works", any idea what the developer could have done instead ?


Just substituting a couple of values for d to work it through.
Using d as -5 the code will return +5 [the Absolute value]
Using d as -10 the code will return +10 [the Absolute value]
Using d as zero the code will return zero
Using d as +5 the code will return -5 [5 - (5 * 2)= -5]
Using d as +10 the code will return -10 [10 - (10 * 2)= -10]

So all the code is doing is converting a positive value to negative or a negative to a positive
So, as @Brovion says simply multiply d by -1 will do this, simples.

So we have an extra 8-line function that could have been written by a single line of code : d = d*-1

This is either a) a commercially astute programmer being paid either by lines of code written or maybe number of functions delivered [smart]
OR
b) a crap programmer [not smart]

Hmmmmm ....
 


clapham_gull

Legacy Fan
Aug 20, 2003
25,341
Just substituting a couple of values for d to work it through.
Using d as -5 the code will return +5 [the Absolute value]
Using d as -10 the code will return +10 [the Absolute value]
Using d as zero the code will return zero
Using d as +5 the code will return -5 [5 - (5 * 2)= -5]
Using d as +10 the code will return -10 [10 - (10 * 2)= -10]

So all the code is doing is converting a positive value to negative or a negative to a positive
So, as @Brovion says simply multiply d by -1 will do this, simples.

So we have an extra 8-line function that could have been written by a single line of code : d = d*-1

This is either a) a commercially astute programmer being paid either by lines of code written or maybe number of functions delivered [smart]
OR
b) a crap programmer [not smart]

Hmmmmm ....
d=-d
 








cunning fergus

Well-known member
Jan 18, 2009
4,747




Bentswood

New member
Jan 8, 2024
11
Lazy PO thinking of scrapping Saturday delivery. That's a scandal. Most services make improvements the PO just keeps going backwards. Thats a scandal.
 










Milano

Well-known member
Aug 15, 2012
3,378
Sussex but not by the sea
Whilst this is appalling, and not unsurprising, I was worried that they would start to find 'lower level' scapegoats. Whilst coming across as scum this scandal is not this man's doing, it is due to the sociopaths higher up, but they will now happily throw this guy to the wolves, he'll potentially be on criminal charges (probably rightly so) but the real culprits will slip away to another dark boardroom.
 


The Mole

Well-known member
Feb 20, 2004
1,095
Bowdon actually , Cheshire
One for the nerds. This is buried on a report and is a code extract from part of the system.

View attachment 173102

Although the code "works", any idea what the developer could have done instead ?


Apart from making a really simple piece of code very complex, who uses a variable name called “d”? It is nearly 30 years since I did any serious coding so styles may have changed to make code as unreadable as possible
 




Shropshire Seagull

Well-known member
Nov 5, 2004
8,510
Telford
Apart from making a really simple piece of code very complex, who uses a variable name called “d”? It is nearly 30 years since I did any serious coding so styles may have changed to make code as unreadable as possible
Indeed. In one company I coded for, developers had to do a 3 month secondment to support to appreciate the value of understandable code and use of comments in code to help.

Also, we were trained to use "Hungarian notation" for all variables, e.g.
dBirthDate, cName, nAge, lMarried which also helped with debugging code.

Late 80s - mid 90s, so similar.
 


maltaseagull

Well-known member
Feb 25, 2009
13,032
Zabbar- Malta
Computer Weekly did a good job as well, casting doubt on the Horizon software. Basically, no software can ever be proven to be bug-free, and there was ample evidence that the majority of problems were with the system, and not the users. The Post Office has knowingly acted in an outrageous manner all along.
Watching the series at the moment. I cannot recall a TV programme that had made us both very angry. The disgusting attitude of the P.O. and is staff dealing with this deserves every one of them being sued in a civil court even if there is no criminal case for some.
The helpline staff saying you are the only one reporting a problem was a downright lie and no action against them. The CEO must have been aware and if she claims she wasn´t , then she was incompetent at the very least.

The settlement should have come from their pensions and not the tax payer. Will never happen though!
 


beorhthelm

A. Virgo, Football Genius
Jul 21, 2003
35,315
changed my view. seems Vennells was involved in covering up and damage limitation, rather than resolving the problem.
 
Last edited:


North of Robertsbridge

Active member
Sep 22, 2023
96
East Sussex
It does but code also has to be easy to understand for support reasons. Multiplying by -1 is potentially more obvious to someone reading that code for the first time.
I guess that’s why we now have 16-core CPUs. They are being told to do multiplication on values of unknown complexity instead of flipping a bit in a register :) Although a decent compiler should optimise
 






Badger

NOT the Honey Badger
NSC Patron
May 8, 2007
12,790
Toronto
Indeed. In one company I coded for, developers had to do a 3 month secondment to support to appreciate the value of understandable code and use of comments in code to help.

Also, we were trained to use "Hungarian notation" for all variables, e.g.
dBirthDate, cName, nAge, lMarried which also helped with debugging code.

Late 80s - mid 90s, so similar.
This is something I am always trying to drum into my team of developers. I don't do much coding myself these days but whenever I look at our project, if I don't see any comments and/or can't quickly figure out what a piece of code is supposed to be doing, I will call it out. It's so much more important to make code understandable than it is to use the latest clever coding technique.
 


Albion and Premier League latest from Sky Sports


Top
Link Here