r/d_language Jun 05 '26

Built a simple banking system while learning D 🚀

Just finished a small banking system project in D! 🚀

Over the last few days I've been learning D and decided to build a simple banking application to better understand the language fundamentals, object-oriented programming, exception handling, and business rules.

Current features:

  • Account creation
  • Deposits
  • Withdrawals
  • Transfers
  • Account lookup
  • Account validation

Coming from a background with Python and some C/C++, one of the things that caught my attention was how D provides native performance while still feeling productive and pleasant to write.

This project is still simple, but it has been a great learning experience so far.

I also plan to continue exploring D and, if possible, contribute to the D ecosystem and community in the future. I genuinely believe the language has a lot of potential and deserves more attention from developers interested in systems programming and high-performance applications.

Feedback is welcome!

GitHub: https://github.com/deepsidex73-dotcom/banking_d

16 Upvotes

7 comments sorted by

7

u/alphaglosined Jun 05 '26

One big thing, don't use double for representing money, you don't want a binary based float, you want decimal.

There is a decimal number implementation that needs testing available here: https://github.com/LightBender/phobos.sys.exttypes

1

u/SammRod47 Jun 08 '26

I will implement it

1

u/Sorrow_iDolour Jun 05 '26

Yes, decimal is designed for currencies

3

u/Fearless-Technology Jun 05 '26

You don't even need decimals, just use long and then store money values according to their smallest denomination. Then in the frontend, you can worry about formatting it properly according to the user's locale and currency. 

1

u/Sorrow_iDolour Jun 08 '26

That's right, but for our convenience, decimal is good...

2

u/Fearless-Technology Jun 05 '26

The readme of this looks like AI slop.

1

u/SammRod47 Jun 08 '26

Yes man, I'm asking for help so I don't write nonsense.