• (nodebb)

    It was much more effort to understand how this code happened in the first place.

    The same way it happens anywhere: one misstep at a time.

  • Rob (unregistered)

    Performance is obviously not a thing, because they're calling value_.split( ',' ) three times, and using value_.split( ',' )[1] twice. They're also potentially callingparseInt( value_.split( ',' )[ 1 ], 10 )twice. (They also could have used the result ofvalue_.indexOf( ',' )` instead of splitting...)

    And parsedCommaValue is a number if it's < 9, otherwise it's a string.

  • 516052 (unregistered)

    Performance is obviously not a thing given that they are using javascript.

  • kythyria (unregistered) in reply to 516052
    Comment held for moderation.
  • (nodebb)

    Sorry, that was as far as I got before I bailed.

    Addendum 2026-02-03 09:07:

    let value_ = value;

  • (nodebb)

    In addition to all the other sins, handleInput is a really vague name for a number-parsing function.

Leave a comment on “A Percise Parser”

Log In or post as a guest

Replying to comment #:

« Return to Article