card.io-dmz icon indicating copy to clipboard operation
card.io-dmz copied to clipboard

reduced usage of magic numbers

Open alex-schwartzman opened this issue 10 years ago • 2 comments
trafficstars

see title

alex-schwartzman avatar Aug 12 '15 19:08 alex-schwartzman

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.

josharian avatar Aug 12 '15 22:08 josharian

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---

alex-schwartzman avatar Aug 12 '15 22:08 alex-schwartzman