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

> Why not just go one step further and just do the thing instead of nag the user to do the thing?

At least, readability suffers.

"".join(["a", "b"]) is a lot more intuitive than sum(["a", "b"], start="")

edit: A beautiful abstraction is the one that feels as good when it's read as when it's written.



> "".join(["a", "b"]) is a lot more intuitive than sum(["a", "b"], start="")

No it isn't. The join method being on the separator string is a Pythonism that looks crazy coming from any other language.


The point they are making is that

    join(xs, "")
    xs.join("")
or whatever else you want to come up with is more readable than building more string stuff in to sum, not that having join be a str method is the best way.




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

Search: