Skip to content
This repository has been archived by the owner on Jan 12, 2019. It is now read-only.

reduced usage of magic numbers #16

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

alex-schwartzman
Copy link

see title

@josharian
Copy link
Member

Do you plan to change the constants?

I'm torn. Although they are much friendly to someone new to the code, I have to admit that I find 270 and 428 a bit more readable than the rather long kCreditCardTargetHeight and kCreditCardTargetWidth. (And if we're going this route, why not 19 and 27 as well?)

I'll defer to @eslav on this, though; I don't feel strongly either way.

@alex-schwartzman
Copy link
Author

Sorry, missed numberWidth and numberHeight. Yes, I would replace those numbers by constants as well.

---offtopic---
I recall, when we were programming for i8080, it was really a good idea to use magic numbers, because the assembly code was more readable, and more aligned, but now we have already passed several paradigm shifts away from that mindset. :)
---offtopic---

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants