incubator-flex-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Omar Gonzalez <s9tpep...@apache.org>
Subject Re: [Proposal] Add PostCodeValidator and PostCodeFormatter to the SDK
Date Sun, 11 Mar 2012 01:16:08 GMT
On Sat, Mar 10, 2012 at 2:21 PM, Justin Mclean <justin@classsoftware.com>wrote:

> Hi,
>
> > Well the conversion game from boolean to number is best *read* like this:
> So on one hand with have 4 if statements (an extra error condition has
> been added) and a extra variable vs a single line of code. IMO the single
> line of code is just as readable even if it does uses casts.
>
> Number(invalidFormat) + Number(invalidChar) + Number(incorrectFormat) +
> Number(wrongLength) * 1.5
>
>
What is the 1.5? We should try and not use any magic numbers/strings. What
does the 1.5 mean? Why isn't it 1.1, or 2.5? I think that should be a
constant that describes its purpose. Not trying to be nitpicky, but if
someone picks up this code later they're not going to know why you chose
1.5 and if there is a reason for that specific number.

-- 
Omar Gonzalez
s9tpepper@apache.org

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message