Re:FastDoubleParser: Java port of Daniel Lemires fast_double...
by ghanrt on Monday March 22, 2021 @02:15PM
(#26544542)
It is. Apart from ++index, this is literally the same as:
Eminently readable and less boring than long if/else chains in Python.
[ Parent
| on HN ]
Re:FastDoubleParser: Java port of Daniel Lemires fast_double...
by dmos62 on Monday March 22, 2021 @06:19PM
(#26548097)
It's not. To be easily human-parsable you want to do one thing at a time. It's that incrementation that you've ommited that messes things up.
On a side note, having gotten used to newer languages, an option type sure is a nice thing.
Re:FastDoubleParser: Java port of Daniel Lemires fast_double...
by Twirrim on Monday March 22, 2021 @05:36PM
(#26547504)
You can write in a very similar way in python too if you want to. I think I'd argue this is cleaner syntax, even.
>>> foo = 10
>>> bar = foo if foo > 5 else 0
>>> bar
10
>>> bar = foo if foo < 5 else 0
>>> bar
0