2 ms·
I said that you can use scanf(3), not that you should. You can use "s.split()" in python, if that makes you feel safer.
by enriquto 3y ago
I said that you can use scanf(3), not that you should. You can use "s.split()" in python, if that makes you feel safer.
- DonHopkins 3y agoThen you are well on your way to rediscovering csv, and you still can't handle self-describing records with different structures, or nested sub-structures, or arbitrary length arrays, or null records, or unicode and control character escapes, or records containing the delimiter. Has it occurred to you that maybe there's a reason people are using jsonl instead of an old existing standard like csv? Not just that they're such dummies they never heard of csv and would take a few years to rediscover it, but an actual reason? Hey, you're the one who chose to recommend scanf, and claimed it would take a few years to rediscover it. I would generally assume people who read hacker news are smarter than that, and are fully aware of the security problems of scanf, and the weaknesses of csv, and are probably not crazy enough to write bulk streaming data parsers in C. And no, s.split() doesn't make me feel safer, or even do rudimentary type conversion like scanf. Pro-tip: use a comma in your password to pollute the csv when your password gets stolen and published on the dark web.
- smitty1e 3y ago.csv is great if you want to browse output in a spreadsheet. Wobbly format? Sure. But if the data are purely internal, why not opt for convenience?