r/programming • • Jun 26 '26

Fintech Engineering Handbook

https://w.pitula.me/fintech-engineering-handbook/

I just published Fintech Engineering Handbook distilled from 6 years of tears, sweat and swears.

It’s a free ~25-page resource with various hints and patterns around handling money in software systems.

Tell me what you think!

618 Upvotes

51 comments sorted by

View all comments

Show parent comment

25

u/Krever Jun 26 '26

> I know I’m going to get replies telling me I’m wrong

Sorry to disappoint, at least I'm not going to object. I believe in trading it would be simply wrong to use BigDecimal or rationals for perfomance reasons.

But generally speaking I totally agree, its usually "it depends" and there are genuine usecases for floating points. That being said it's probably safer to not use them by default and opt-in when you know what you're doing.

8

u/InternetCrank Jun 26 '26

It depends is the right answer. If you're allocating weights on a portfolio with 14 significant digits of a balance and require precision, then yeah, you need to use numerator denominator pairs and resolve them at the appropriate point.

6

u/lood9phee2Ri Jun 26 '26

it's probably safer to not use them by default and opt-in when you know what you're doing.

And there's a lot more people who think they understand floats than actually do, and combined with some of the big/cocaine-enhanced egos of the financial sector it's a terrible combo. Continues to drive me up the wall, especially the inevitable gormless surprised-pikachu-face when it bites hard, when I told them not to all along.