News for hackers. Stuff that matters.
Re:Going into Business? Learn a Programming Language by candre717 on Monday November 15, 2010 @10:25AM (#1906513)
"If all you have is a hammer, everything looks like a nail." Anon.
Re:Going into Business? Learn a Programming Language by codemonger on Monday November 15, 2010 @09:49AM (#1906373)
Or just use a spreadsheet maybe??
Re:Going into Business? Learn a Programming Language by cshenoy on Monday November 15, 2010 @10:31AM (#1906532)
"There are also times when it’s a good idea to make a spreadsheet, but even this can be overkill."

I think the point was not on the specific class but thinking of business from a macro perspective. The author was better able to grasp things and use his programming background to his advantage.

Re:Going into Business? Learn a Programming Language by hoop on Monday November 15, 2010 @11:32AM (#1906826)
Hi cshenoy, that was exactly my point. Thank you
Re:Going into Business? Learn a Programming Language by mquander on Monday November 15, 2010 @10:55AM (#1906645)
No kidding. This was an awfully bad example. I use a REPL for this kind of math too, but it's because I'm too lazy to learn how to use Excel properly.
Re:Going into Business? Learn a Programming Language by jbester on Monday November 15, 2010 @10:36AM (#1906557)
A spreadsheet would have prevented the author from using floating point to represent money.
Re:Going into Business? Learn a Programming Language by hoop on Monday November 15, 2010 @11:38AM (#1906851)
For the purposes of my example assignment, I am required to provide all answers rounded to the nearest dollar (hence the call to round().) For a one-off (or ten-off) series of calculations the use of floating point is a non-issue.
Re:Going into Business? Learn a Programming Language by jbl on Monday November 15, 2010 @11:05AM (#1906690)
What is the issue with using floating point to represent money?
Re:Going into Business? Learn a Programming Language by mquander on Monday November 15, 2010 @11:18AM (#1906753)

  Time spent writing obvious reply:        $2.50
  Good faith deduction:                   ($1.00)
  Deduction for joke comment opportunity: ($1.50)

  Dear jbl, your invoice total is $0.00000027.
Re:Going into Business? Learn a Programming Language by jbl on Monday November 15, 2010 @12:00PM (#1906972)
Ah. Right. Rounding errors and other floating point issues. Guess I should have my coffee before reading HN. headdesk
Re:Going into Business? Learn a Programming Language by droz on Monday November 15, 2010 @11:15AM (#1906742)
get out.
Re:Going into Business? Learn a Programming Language by zdw on Monday November 15, 2010 @11:11AM (#1906724)
FYI, Ledger is CLI and designed for accounting and keeping books:

https://github.com/jwiegley/ledger/wiki

There's a python implementation as well, if that's more up your hacking alley: https://furius.ca/beancount/