News for hackers. Stuff that matters.
Re:Parsing JSON is a Minefield by esrauch on Wednesday October 26, 2016 @12:12PM (#12797676)
You say that as fact but you must know it is a matter of opinion: I would say you should match the language idioms. For example, Python iterators and generators work by raising/throwing when there are no more items: it is fully expected and will always happen when you write a for-in loop.
Re:Parsing JSON is a Minefield by iopq on Thursday October 27, 2016 @01:18AM (#12803081)
That seems like bad design. Rust iterators return an Option<T>, for example.
Re:Parsing JSON is a Minefield by andy_ppp on Thursday October 27, 2016 @02:29AM (#12803261)
In Python a lot of flow control uses exceptions as it's cheaper to ask for forgiveness rather than permission and then still have to deal with errors.