|
I'm not suggesting you can't write typical "business logic" in Javascript,but I'm questioning the wisdom of it and your workarounds demonstrate why
I'm not suggesting you can't write typical "business logic" in Javascript,
but I'm questioning the wisdom of it and your workarounds demonstrate why
IMO. The solution below is like something from a 1980's Windows program
before preemptive multitasking was around you had to remember to yield to
the OS and I'm sure you don't need me to explain the potential drawbacks.
The fixed point function doesn't round properly, as far as I remember, the
only safe way to do fixed point maths is to shift the numbers to integers
first, either way, it's not as straightforward as you claim. Even if it
were, having to wrapper all of your basic maths operations in a function
call is error prone and ugly and simply clutters up the program with noise.
The benefits of using JS or even Typescript to express your business logic
over a language designed specifically for that purpose would have to be
significant to outweigh the disadvantages and in it's current state, I
don't think they are.
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.