- Feature Articles
- CodeSOD
- Error'd
- Forums
-
Other Articles
- Random Article
- Other Series
- Alex's Soapbox
- Announcements
- Best of…
- Best of Email
- Best of the Sidebar
- Bring Your Own Code
- Coded Smorgasbord
- Mandatory Fun Day
- Off Topic
- Representative Line
- News Roundup
- Editor's Soapbox
- Software on the Rocks
- Souvenir Potpourri
- Sponsor Post
- Tales from the Interview
- The Daily WTF: Live
- Virtudyne
Admin
Even the finance people don't need Maths. Why do programmers need Maths?
TRWTF.
Admin
This is the first time that I saw the
else
indented one level deeper than theif
as opposed to the same level.Admin
No
End If
s? It this code written in VBPython? Or does the finalEnd
closes the wholeIf
tree?Admin
Simon seems mighty happy to multiply floating point numbers together in a financial application. Maybe he's setting himself up for some future work.
Admin
Arithmetic, that magical part of computers.
Admin
I've seen financial arithmetic, and simple it usually ain't. I think we're looking at this effect.
Admin
I had once the pleasure of fixing an Oracle query that had to display average and standard deviation. It turned out that the input to the system was an average and a standard deviation (per time unit), and the original dev had taken simply taken the average of all averages and the standard deviation of all standard deviations.
Admin
This one reminds me of an experience I had way back in 1989. I was on-site in a small town in California installing a billing/monitoring system for a small power station (burning wood chips and other biomass). The system used a non-networked SCADA system to extract counters and such from the digital control system that ran the boilers and generators. (/context)
So, we were building the second instance of this (at the end of the week, I went back to the first instance to help fix it up to the same standard...), and the counters didn't exist in a working fashion in the DCS. So off we went to build them. That particular DCS had a sort of semi-assembler, and the guy who knew how that worked (not a programmer in the conventional sense) knew exactly enough to make it do the work he needed, and not a single thing more. It grated to look at the existing code and see "load a value from memory, do a single part of a calculation, store it, load it again, do the next part, store it, load ...". He let me construct the part we needed, and I had less than half the code that the existing style would have needed, and worked perfectly well. (I didn't see anything that suggests he didn't understand what I was doing, but it was clear he wouldn't have done it that way himself.)
This sort of person isn't necessarily stupid, but doesn't really understand programming, nor any of the higher-level software design issues, and in particular things like abstracting and factoring.
Admin
Admin
Waiting for Part II where things start to fail.
Admin
I asked my local Finance person, who said "What pattern between the raw rates and the percentages?"
0 ⇒ 0 1 ⇒ 10 2 ⇒ 20 15 ⇒ 15 16 ⇒ 16 125 ⇒ 12.5
Some of them become bigger, some stay the same, some become smaller. There's no pattern at all!
Admin
Now to repeat your example using the data from the article: 1.0 => 0 1.1 => 10 1.125 => 12.5 1.15 => 15 1.16 => 16 1.2 => 20 And the pattern is obvious.
Admin
What about if i format the numbers this way?
000 ⇒ 0 100 ⇒ 10 200 ⇒ 20 150 ⇒ 15 160 ⇒ 16 125 ⇒ 12.5
Admin
FTFY
Admin
but i didn't put a leading 0 to trigger octal syntax....... DISCOURSE!
Admin
In an accounts section in 1991 I was setting up spreadsheets to replace the manual system we had.
The old manual system was paper-based: people would enter sales in appropriate fields and use a mechanical adding machine to total them.
One amount, a rebate, would normally arrive as a negative quantity. On the paper system, the users had always been told to remember when totalling they must subtract it.
So when I came to do the spreadsheet for this one, I told the users they could enter the rebate as a negative number (it was indeed shown as a negative quantity on documents they input from), and the spreadsheet formula would automatically total things correctly. The users were more than happy with this.
But when I showed the formula to the head of section — a qualified accountant — he didn't like it at all. He just would not accept that the spreadsheet formula =SUM(G22:G43) could correctly deal with a negative number. I tried saying "minus a minus is a plus" etc. to no avail he couldn't see it.
So he required me to alter the formula to =SUM(G22:G37)-G38+SUM(G39:G43), and the users were told to enter the negative number as positive in cell G38. OK, it was a bit annoying having to mangle the formulas unnecessarily, but it was mathematically equivalent.
The users, however, got very, very confused at having to enter this negative number as positive, because sometimes other amounts would be negative (refunds), and they had to enter those ones as negative. The head of section never saw the dissonance.
Admin
I think you're are missing the point.
This is exactly what @foobar's finance guy saw:Admin
In that case, which dumbfuck hired a finance person that doesn't understand numbers?
Admin
Probably Verizon.
Admin
Admin
Later that day, Simon's changes were rolled back, and he was called to his managers office to be reprimanded for "removing tried and tested code and replacing it with an untested formula that nobody can understand"
Admin
Admin
FTFY
Admin
FTFFY
Admin
It's like, a meta-average and a meta-standard-deviation!
Admin
Simon's new code now produces 14.999999999999991 instead of 15 and 10.000000000000009 instead of 10 for inputs of 1.15 and 1.10 respectively. I don't think finance would be happy about that.
Admin
Admin
Did I forget to mention that our fine Finance friend's previous job was personal secretary to the Vice President's daughter, and he was hired here based on glowing recommendations from an enterprise DBA named Nagesh?
Admin
Worse case scenario, given no other technological options.
int.Parse((1.10).ToString().Substring(2)) still works.
That's of course, disregarding that 1.15 isn't perfectly representable in float anyway.
Admin
That can't be right ...
Are you sure it wasn't The President's Daughter?
@presidentsdaughter, have you ever had a personal secretary?
Admin
"As Simon moved on to the next project, he wondered whether the report's author hadn't spotted the pattern between the raw rates from the database and the desired percentages, or whether simple arithmetic was beyond the capabilities of a member of the Finance team."
Most likely both.
Admin
Whatever numerical storage technology that can't correctly produce 20 from 1.2, cannot store 1.2 either.
Take 1.2, multiply by 2 until you no longer have a decimal. Now you know your binary representation. The number becomes the right part, and the number of times multiplied becomes the exponent.
Keep multiplying 1.2 by 2. You'll always have a decimal.
Admin
If this story reminds you of that for the reasons mentioned, shouldn't every story on this site do the same?
Admin
Not per se, it was more like a personal dragon.
Admin
@foobar: Is this Finance friend currently, or have they ever previously been, a dragon? Do they have any draconian tendencies or features?
Admin
QFT, although I bet other people have by now.
Admin
You should've put that in 2- or 3-column table, with each column right-justified.
Aaaand oh Discourse no. (I got lazy and LMGTFY'd it. Reading the original is probably funnier.)
Admin
YOu say that like it's--hold on, eff you, Discouse toaster--sorry, back--an improvement.
My daily use language has a decimal data type that supposedly supports 50 significant figure numbers with 10 decimal places.
Admin
Admin
No, I consider where we are as well. I'm not sure of the value of pointing out the buttumption you're pointing out, although I'd defend to somewhat less than death your right to do it.
Admin
+1 for predictive genius.
Admin
I've seen that, too; but usually as a one-off. The guy in your example was not a programmer; he was something else and had to learn a minimum of programming to do his job. If he didn't go beyond that, meh.
However, it seems to me that accountants should have some minimal conceptualization of how business math works: Percentages, positive and negative numbers, for example, are things I would expect them to understand, because those are their job.
Before they take the job, actually.
Admin
Wouldn't this convert commission_rate to an integer if it was ever ported to C, C++, C# or Java? Then all commissions less than 100% would become zero. To be on the safe side, I would have used this, regardless of the language:
Admin
({commission_rate} - 1D) * 100D
Admin
"Good riddance" said the manager. "He was a loose cannon anyway - glad we caught him before he did more damage"
Admin
(1) Programmers in the by-profession sense rather than the de facto sense in which all Excel users are programmers. (It's entirely reasonable to say that Excel is the most widely distributed programming system on the planet.)
Admin
Fun story, the guy I used to do work for, it was a standing joke that he had his math licence revoked - precisely because of an escapade like this that involved converting ratings around.
Last time this was a thing, he had to convert from one database system backend to another for the apps he was bridging, where he needed to go from a rating of 1-4 where 1 was the highest, to a rating of 1-5 where 1 was the lowest.
This took me 15 minutes, he'd spent 3 hours wrestling with it...
Admin
All of this reminds me of a "simple test": Write a subprogram (your choice of language) that takes as input the numbers 1 & 2. The output is the opposite number (1->2, 2->1). This can lead to ALL SORTS of answers.
Admin
Like this?
Admin
No, like this: