• 4 Posts
  • 17 Comments
Joined 11 months ago
cake
Cake day: December 11th, 2024

help-circle



  • Relevant comment

    I don’t use Rust much, but I agree with the thrust of the article. However, I do think that the borrowchecker is the only reason Rust actually caught on. In my opinion, it’s really hard for a new language to succeed unless you can point to something and say “You literally can’t do this in your language”

    Without something like that, I think it just would have been impossible for Rust to gain enough momentum, and also attract the sort of people that made its culture what it is.

    Otherwise, IMO Rust would have ended up just like D, a language that few people have ever used, but most people who have heard of it will say “apparently it’s a better safer C++, but I’m not going to switch because I can technically do all that stuff in C++”








  • Yeah, they’re definitely still the standard. They’re not really replaced by comments, comments are more for explaining why bits of code are the way they are. Docstrings are kind of like comments for functions/classes/etc that Python knows how to handle specially. The interpreter will parse the docstrings and make help text out of them available to the help builtin function


  • Not really a question, but something to think about is being more strict about backwards compatibility so that people don’t get burnt out on having stuff break. Coming from this post by the Tesseract dev, who did not like the breaking changes to the v3 API in 1.0: https://dubvee.org/post/2904152

    To formulate that into an actual question, do you think the changes are still worth it and you’d make the same decision to break backwards compatibility?



  • Yeah, I discovered this when a coworker wrote code like def foo(timestamp = now()) and had fun debugging why there were a bunch of duplicate timestamps.

    PEP 671 would add new syntax to ease the pain, but it’s not accepted yet. It would allow for writing function definitions like one of these:

    def bisect_right(a, x, lo=0, hi=>len(a), *, key=None):
    def connect(timeout=>default_timeout):
    def add_item(item, target=>[]):
    def format_time(fmt, time_t=>time.time()):