Comment On Wordy Invoice

The daisy wheel stabbing at green-lined sheets could have been Satan’s fanfare, but Andy was long accustomed to tuning out ambient printer noise. It was 1982, and he spent most of his time before his Commodore PET 4032, churning out useful things in 6502 Assembly. Most of the code was for printing invoices, much like customer invoice currently printing and making all of that racket. [expand full text]
« PrevPage 1 | Page 2 | Page 3Next »

Re: Wordy Invoice

2012-11-06 08:10 • by bluesman (unregistered)
2.5000 is the new 2.500?

Re: Wordy Invoice

2012-11-06 08:12 • by db2
So TRWTF is that Andy can't handle fixed-point math?

Re: Wordy Invoice

2012-11-06 08:13 • by Andrew (unregistered)
Once the sales manager cleared the scene, he rounded his desk, gathered up the invoices, and reached for his nearest resume.

FTFY

Re: Wordy Invoice

2012-11-06 08:14 • by fanguad (unregistered)
I'm personally curious how he managed to store 2.5 in a 16 bit int.

Re: Wordy Invoice

2012-11-06 08:15 • by Retsila (unregistered)
The sales manager had a row with his boss & then he took the sales managers word on it without speaking to his boss directly?

That really is stupid

Re: Wordy Invoice

2012-11-06 08:23 • by Leo (unregistered)
5000th post!

Re: Wordy Invoice

2012-11-06 08:24 • by Rodnas (unregistered)
Aaah, the good old days of 6502 assembly. I still have a C64 hidden somewhere in my house for sentimental reasons. Ofc in those days i didn't have to worry about invoice printing. I was just a kid trying his hands on this new thing called personal computers and programming. Which meant playing Fort Apocalypse, Impossible Mission and Aztec Challenge a lot. Until the boredom set in and i wanted to make my own games. That is how it all started for me. In the end there was no great games programming career for me, but now there a customers complaining about the layout of their invoices. I should get back to work.

Re: Wordy Invoice

2012-11-06 08:24 • by PedanticCurmudgeon
394226 in reply to 394223
Retsila:
The sales manager had a row with his boss & then he took the sales managers word on it without speaking to his boss directly?

That really is stupid
I was also wondering about that. People who think that nothing's impossible if you yell loud enough and for long enough generally are also more than willing to lie when it suits their purposes.

Re: Wordy Invoice

2012-11-06 08:31 • by Wody (unregistered)
He's obviously not very smart, all he had to do was write a single line to the invoice 'all tonnage values must be multiplied by 1000 for actual values'

Re: Wordy Invoice

2012-11-06 08:31 • by TheRider
"Figure it out, and give my customers a readable print-out!"

I only hope that all the sales manager's personal customers are clearly marked in the database. Otherwise that feature request is impossible to implement...

Re: Wordy Invoice

2012-11-06 08:33 • by Mike (unregistered)
This is a very sad story.

Re: Wordy Invoice

2012-11-06 08:34 • by Tim (unregistered)
394230 in reply to 394227
Wody:
He's obviously not very smart, all he had to do was write a single line to the invoice 'all tonnage values must be multiplied by 1000 for actual values'


Or just "all values are in European standard kilotonnes"

Re: Wordy Invoice

2012-11-06 08:34 • by GettinSadda
So many WTFs!

But in the article itself...

I can't understand why anyone would write invoicing software for a PET 4032 in assembler, when the built-in basic handled that sort of task perfectly well. Writing assembler for a PET was not trivial - machine code directly entered in hex was not uncommon for speed, but assembler generally required a whole load of messing around.

Also, I wrote accounting software at about this time and I never saw anyone print invoices on green-lined paper!

On top of all of this - thinking that "adding three zeroes" to the number would give the correct answer makes Andy TRWTF!

Re: Wordy Invoice

2012-11-06 08:37 • by flop
394232 in reply to 394222
> I'm personally curious how he managed to store 2.5 in a 16 bit int.


What's the problem? 2 in a byte, 128 in another - voilá!

Ever heard of fixed-point math?

Re: Wordy Invoice

2012-11-06 08:38 • by the beholder (unregistered)
394233 in reply to 394226
PedanticCurmudgeon:
Retsila:
The sales manager had a row with his boss & then he took the sales managers word on it without speaking to his boss directly?

That really is stupid
I was also wondering about that. People who think that nothing's impossible if you yell loud enough and for long enough generally are also more than willing to lie when it suits their purposes.
I was thinking the same thing. I guess I've been close to sneaky bastards long enough to learn not to trust customers or cow-orkers on spoken words alone.

Also TRWTF is that Andy can't handle fixed point math. The least he should do is check how many zeroes actually must be appended for a correct conversion.

Re: Wordy Invoice

2012-11-06 08:40 • by Doo-doo Facial Hair (unregistered)
394234 in reply to 394231
TRWTF is someone writing that kind of software in the early 1980s for an 8-bit computer in something other than Basic.

And the only kind of green-, blue-, or brown-lined paper I remember from back in the day was used to print out source code or listings, not documents for customers, but maybe such a thing was done somewhere vOv.

Re: Wordy Invoice

2012-11-06 08:41 • by ewanm89 (unregistered)
The easiest option, is multiply the quantity by 10 and convert to int, then add 2 0's hard coded into the printout.

Re: Wordy Invoice

2012-11-06 08:48 • by Grumpy (unregistered)
When I was your age, everything was greenbar and we liked it!

Then some weenie invented 8 1/2 x 11 white paper, with perforated strips along the edges that you could tear off. Which was all fine and dandy, except the printer was wide enough for greenbar and the white stuff didn't fit. Then you needed adjustable roller thingies. Then someone would spool a job without realizing there was white paper in the printer, and it would print right off the edge. Devil spawn, I tell you! Give me back my greenbar!

You young 'uns missed out. Why you could walk around with a wad of greenbar tucked under your arm, and it was as good as a roll of hundred dollar bills. Chicks instantly realized that you were in the big-money computer business, a rising star!

Re: Wordy Invoice

2012-11-06 08:51 • by Fred (unregistered)
I call shenanigans! Anyone who was there knows that every report had as much info as possible crammed into the inflexible limit of 132 columns. There's no way you could add three zeros, or even one, to anything without running out of room.

Basically any requirements session boiled down to "if we cut off the last name at 8 characters we can add four digits to the zip code -- is that what you really want?"

Re: Wordy Invoice

2012-11-06 08:52 • by @Deprecated
394238 in reply to 394221
Andrew:
Once the sales manager cleared the scene, he rounded his desk, gathered up the invoices, and reached for his nearest resume.

FTFY

Hardly. Sales guys tend to have higher turnover than most.

Should be, "Gathered up the invoices, shredded them, restored the code to the original form, and then went home for the day. Later that week, the sales guy tried to get Andy fired, but ended up having his ears thumped by management. Everyone else was happy!"

Re: Wordy Invoice

2012-11-06 08:58 • by Mike (unregistered)
394239 in reply to 394235
The easiest option is to multiply by 1000!

Re: Wordy Invoice

2012-11-06 08:59 • by Abico (unregistered)
Sorry, but Andy is in the wrong here. Maybe the guy was as much as a dick as his story says, but he did nothing to explain the problem. And on top of that, his solution was wrong.

Re: Wordy Invoice

2012-11-06 09:06 • by Smug Unix User (unregistered)
This is why nothing should be changed without getting people to sign off in writing. Also having a nice three week minimum turn around for change requests typically reduces the amount of issues that really need to be worked. Didn't review the changes in our test environment? Guess you will have to live with it for a few weeks.

Re: Wordy Invoice

2012-11-06 09:06 • by Smug Unix User (unregistered)
This is why nothing should be changed without getting people to sign off in writing. Also having a nice three week minimum turn around for change requests typically reduces the amount of issues that really need to be worked. Didn't review the changes in our test environment? Guess you will have to live with it for a few weeks.

Re: Wordy Invoice

2012-11-06 09:13 • by Chris (unregistered)
So, without the decimal place, 2 becomes 2000 but 2.5 becomes 25000, that there is the REAL WTF!

Re: Wordy Invoice

2012-11-06 09:15 • by NMe
394245 in reply to 394240
Abico:
Sorry, but Andy is in the wrong here. Maybe the guy was as much as a dick as his story says, but he did nothing to explain the problem. And on top of that, his solution was wrong.

Very true. Just appending three zeroes in order to make a decimal value appear as though it's multiplied by 1000? Any idiot should know that this does not work, so he can only have done this in order to piss off this manager. Whether or not he deserved it, 5 minutes of decent coding would have had this sales manager out of his hair for the rest of the day. Instead he chose to ignore his wishes, rush the job, be cheeky and lie about it and ended up using whiteout on a stack of invoices, costing him time that he could and should have spent doing his actual job.

Re: Wordy Invoice

2012-11-06 09:19 • by bemis (unregistered)
I take it the WTF is how poorly Andy handled this situation?

Slap on an extra three 0's, really?

Re: Wordy Invoice

2012-11-06 09:20 • by bemis (unregistered)
394247 in reply to 394239
Mike:
The easiest option is to multiply by 1000!


Umm... I think you might have missed something...

Re: Wordy Invoice

2012-11-06 09:28 • by anonymous (unregistered)
Waidaminute...


Doesn't an invoice usually take the form of:

Item A Qty of A x Unit Price of A = Amount of A
Item A Qty of B x Unit Price of B = Amount of B
Item A Qty of C x Unit Price of C = Amount of C
Grand total

Presumably the unit prices were all in kilotons before, so if Andy just changed the way the quantities were display without also changing the unit prices, the invoice would be all kinds of messed up. TRWTF is that the company let Andy anywhere near any sort of maths. Maybe he should have been fired.

Re: Wordy Invoice

2012-11-06 09:32 • by biziclop
What the hell were they selling hundreds of thousands of tons of?

Re: Wordy Invoice

2012-11-06 09:32 • by GettinSadda
Is it really that hard?

; Assuming Val is 16-bit Qty / 100

LDA (ValLo) ; Load the low byte
TAY ; Put in Y
LDA (ValHi) ; Load the high byte
JSR GIVAYF ; Convert to float in acc 1
JSR MUL10 ; Multiply by 10 (is now Qty / 10)
JSR MUL10 ; Multiply by 10 (is now Qty)
JSR FOUT ; Format as string in output area

Re: Wordy Invoice

2012-11-06 09:37 • by Pluvius (unregistered)
394252 in reply to 394250
biziclop:
What the hell were they selling hundreds of thousands of tons of?


Toenails.

Re: Wordy Invoice

2012-11-06 09:42 • by Mike (unregistered)
Just got done loading two new boxes of greenbar into our ancient beast, so I am getting a kick out of this.

Re: Wordy Invoice

2012-11-06 09:45 • by OldCoder (unregistered)
394255 in reply to 394250
biziclop:
What the hell were they selling hundreds of thousands of tons of?

Don't get out much, do you? Grain? Coal? Steel? Fertilizer? Fish? Cement?

I could go on, but I have a website to read.

Re: Wordy Invoice

2012-11-06 09:46 • by jc (unregistered)
394256 in reply to 394222
you obviously didn't ever hear about fixed point decimals.

Re: Wordy Invoice

2012-11-06 09:50 • by Zecc
The first 5 comments are good comments!
What has happenned to this site?

Re: Wordy Invoice

2012-11-06 10:06 • by corroded (unregistered)
The Real WTF is Andy.

Uses hack, creates inconsistent output that is confusing and makes the problem worse than before. Acts like a bit of an arse to boot.

Should have said it wasn't possible, and explained why.

Re: Wordy Invoice

2012-11-06 10:13 • by fanguad (unregistered)
394259 in reply to 394232
flop:
> I'm personally curious how he managed to store 2.5 in a 16 bit int.


What's the problem? 2 in a byte, 128 in another - voilá!

Ever heard of fixed-point math?


You certainly could do fixed point math, but this specifies that the largest value he could store in his 16 bit word is 65536 - which means he's using unsigned integers.

In reality, they probably did use fixed point math and "TRWTF" is all the errors introduced during the re-writing of submissions.

Re: Wordy Invoice

2012-11-06 10:20 • by Excelsior (unregistered)
Pretty story, but TRWTF is Andy being to lazy to do its actual job, or being able to stand his ground (who changes customers invoices snapping his fingers ?).

Whatever...

Re: Wordy Invoice

2012-11-06 10:28 • by tim (unregistered)
394261 in reply to 394245
NMe:
...and ended up using whiteout on a stack of invoices, costing him time that he could and should have spent doing his actual job.

LOL - in the UK we only have Tipp-Ex and i've never heard of whiteout. Until I read NMe's comment, I assumed whiteout was some kind of strong cider and he was just going to get hammered :-) (oh - and just to add to the confusion, cider is different in the UK too)

Re: Wordy Invoice

2012-11-06 10:37 • by Cbuttius
As well as tipp-ex we used to have liquid paper.

Pretty-printing of numbers is tricky. Anyone want to try it in their favourite language?

My guess is that they were storing "fixed point" numbers if they allowed 2.5

Re: Wordy Invoice

2012-11-06 10:56 • by Publius (unregistered)
This sounds like a fairly trivial problem to solve, even in 6502 assembly, I get the impression this guy is just lazy. If the same invoice printing code is in 600 different places, write a set of find/replace expressions? Original submitter, please feel free to chime in on how the editor messed up your story.

Re: Wordy Invoice

2012-11-06 11:01 • by Publius (unregistered)
394265 in reply to 394231
GettinSadda:
So many WTFs!

But in the article itself...

I can't understand why anyone would write invoicing software for a PET 4032 in assembler, when the built-in basic handled that sort of task perfectly well. Writing assembler for a PET was not trivial - machine code directly entered in hex was not uncommon for speed, but assembler generally required a whole load of messing around.

Also, I wrote accounting software at about this time and I never saw anyone print invoices on green-lined paper!

On top of all of this - thinking that "adding three zeroes" to the number would give the correct answer makes Andy TRWTF!


I can confirm that to this day Walmart still prints out accounting totals on green-lined paper on dot matrix printers.

Re: Wordy Invoice

2012-11-06 11:06 • by GettinSadda
394266 in reply to 394265
Publius:
I can confirm that to this day Walmart still prints out accounting totals on green-lined paper on dot matrix printers.

Yes, but accounting totals are NOT invoices!

Re: Wordy Invoice

2012-11-06 11:09 • by Captcha:appellatio (unregistered)
394267 in reply to 394257
Zecc:
The first 5 comments are good comments!
What has happenned to this site?

It got fascist mods.

You fascists!

Re: Wordy Invoice

2012-11-06 11:13 • by lesle (unregistered)
394268 in reply to 394261
Wite-Out, no h.
https://en.wikipedia.org/wiki/Wite-Out

Re: Wordy Invoice

2012-11-06 11:14 • by justsomedudette (unregistered)
I miss greenbar; I miss making little springs out of the perforated edges *sigh*

Re: Wordy Invoice

2012-11-06 11:24 • by lesle (unregistered)
394270 in reply to 394268
lesle:
Wite-Out, no h.
https://en.wikipedia.org/wiki/Wite-Out


Non-pertinent but interesting information here:
https://en.wikipedia.org/wiki/Correction_fluid

Re: Wordy Invoice

2012-11-06 11:33 • by bkDJ (unregistered)
So, he didn't get confirmation from his boss, his solution was laughably wrong and terrible, he acted like even more of an ass than the sales guy at the end, and then decided to use wite-out instead of fix the code properly and leave for the day? TRWTF is Andy. Also someone needs to teach the new writers that we like our HTML comments.

Speaking of writers...
"Because he wanted to knock off at 3:02, obviously."
Knock off...? As an American, the only thing that means to me (when it doesn't take an object, i.e. "knock it off") is to copy something (possibly cheaply), so what is the author trying to say here?

Re: Wordy Invoice

2012-11-06 11:36 • by TRWTF (unregistered)
The real problem is that 2.5000 is wrong. He added three 000 to both 2 and 2.5 which gets you 2 thousand and 25 thousand. Also, if this was for Europe it should have been a comma in the abbreviated version. TRWTF is the fail programmer.
« PrevPage 1 | Page 2 | Page 3Next »

Add Comment