Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Design: should reading from ANS be permissive? #4

Open
ENDrain opened this issue Aug 21, 2022 · 0 comments
Open

Design: should reading from ANS be permissive? #4

ENDrain opened this issue Aug 21, 2022 · 0 comments

Comments

@ENDrain
Copy link
Owner

ENDrain commented Aug 21, 2022

By current design, Omninumeric tries to read from alphabetic numeral systems as permissively as possible. Numbers in ANS are not required to follow the system's rules for decorators by the book. For example, Cyrillic converter would render this:
араi
as 1,111, even though the "thousand" mark before the leftmost a is missing.

Is this the right design choice or not?

Arguments for this design:

  • ANSs generally have many variations within themselves. Cyrillic has two styles of writing with "thousand" marks and a third style implementing something entirely different. Byzantine Greek sees use of both number-long overstroke and "keraia" symbol for marking a number. It seems only natural to read as permissive as possible from such variable systems.
  • Relaxed reading allows for relaxed regular expression. Stricter reading will require stricter regex, which at some point might become a pain in the back.

Arguments against this design:

  • A system is a system, however variable it can be. There are rules for writing numbers in those systems, not guidelines. It would be only natural to demand that numbers read obey those rules.
  • A "thousand" mark is not a decorator but a significant, meaningful component of a numeral - and a number. It would be irrational not to expect these marks be in order.
  • Wrong inputs and corresponding results should be the user's problem, not the programmer's.
  • Stricter rules for reading mean more concise conversion algorithm, and through that, better readability and sustainability.
@ENDrain ENDrain changed the title Design: should reading from an ANS be permissive? Design: should reading from ANS be permissive? Aug 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant