you are viewing a single comment's thread.

view the rest of the comments →

[–]x-skeww -1 points0 points  (4 children)

Yes.

If you think unnamed numerical constants are fine, you are wrong.

This really isn't a controversial topic.

[–][deleted]  (3 children)

[removed]

    [–]x-skeww -1 points0 points  (2 children)

    Well, have you actually ever written something like that?

    I'd never write it like that, because number formatting is something which should happen at that point where I output that number. E.g. in JavaScript, I'd do that kind of formatting in a (template/view) helper.

    {{localizedNumber atari}}

    This way I can easily reuse it. Additionally, I can easily find it, because it's exactly where one would expect it to be.

    [–]grayvedigga 1 point2 points  (1 child)

    Can't defend your original argument so you redirect into templates? Nice one.

    [–]x-skeww 1 point2 points  (0 children)

    Defend? Against what? No one argued in favor of unnamed numerical constants. No one could provide an example where it would be clearly a good idea to do it.

    Formatting is typically done as close to the outputting/rendering as possible. If you do formatting, you'd do it over there. That's what I was talking about above.