Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

>Tools like JSDom are pretty nice for this, but I've found that most web scraping involves a lot of low level manipulation of strings and lists – stripping/formatting/concatenating/ranges/etc, and I find JS to have much worse ergonomics for this than languages like Python and Ruby. I actually find the ergonomics of this most comparable to Swift, the difference being that with Swift you get a ton of safety and speed for that trade-off.

I think from es6 and up this is handled pretty well.



It has made it better, but things like slice operators are still missing, which can help a lot, Set/Map types aren't that great to use and aren't used much in practice, and there are still lots of sharp edges for newcomers even with simple things like iteration. That's also not mentioning things like the itertools/collections modules in Python which provide some rich types that come in handy.


It’s certainly possible to make itertools-like stuff in Javascript.

https://observablehq.com/@jrus/itertools


Seems like slice operator is more like Syntactic sugar for substring?


I'm not the author of the comment you're replyin to, but doesn't that fall under the worse ergonomics argument?


I am the author, and yes this is exactly the sort of thing I mean.

Python/Ruby are far more expressive for these sorts of data manipulation tasks.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: