• 0 Posts
  • 145 Comments
Joined 2 years ago
cake
Cake day: August 18th, 2023

help-circle
  • I don’t necessarily love Python either, but it sounds like your perspective is a little limited.

    Why would anyone change so many standards?

    You happen to have almost exclusively used languages that are syntactically descended from a common ancestor, Algol. If you had learned a LISP descendant, or another non-Algol language such as ML, Prolog, APL, or Haskell, you’d probably be less surprised by Python not following the Algol-ish syntax.

    Why would you provide a way to type parameters but don’t enforce it at runtime?

    As another commenter mentioned, this is basically just a result of Python’s historical development. Explicit types are fully optional, and originally did not exist: the type annotations idea wasn’t even created until 2014, over two decades (!!) after Python’s initial release; and that was just the initial theoretical groundwork, not an implementation of anything. To introduce explicit static typing into a language that is dynamically or implicitly typed, without breaking legacy code, requires gradual typing, an idea that is relatively recent in the history of programming languages, and there are different approaches. The TypeScript approach may seem like the obvious “right” way now that TypeScript has become so dominant in the JS ecosystem, but it was in no way obvious that TypeScript would be so successful back when it was introduced, which was right around when Python started developing its gradually-typed system. So Python took a different approach: rather than designing a new language as a superset of the existing language, and writing a compiler to typecheck the new language and strip type annotations, they added a syntax for type annotations into the language, so that the code you write is still the code that actually gets interpreted, but decided that actually enforcing type-checking should be left to separate tools rather than the Python interpreter. Personally, with the benefit of hindsight, and as someone who has not used Python much and prefers Rust-style static typing, I think the TypeScript way is better. But I don’t think Python is likely to evolve in that direction.









  • making the same mistakes

    This is key, and I feel like a lot of people arguing about “hallucinations” don’t recognize it. Human memory is extremely fallible; we “hallucinate” wrong information all the time. If you’ve ever forgotten the name of a method, or whether that method even exists in the API you’re using, and started typing it out to see if your autocompleter recognizes it, you’ve just “hallucinated” in the same way an LLM would. The solution isn’t to require programmers to have perfect memory, but to have easily-searchable reference information (e.g. the ability to actually read or search through a class’s method signatures) and tight feedback loops (e.g. the autocompleter and other LSP/IDE features).




  • For what it’s worth, I agree with you about branches, and there are various ongoing discussions about how to make working with branches more convenient. I use an experimental feature called “advance branches” that makes it mostly fit my workflows, and the other benefits of jj are sufficient that I haven’t switched back to git.

    I create log files of runs, temporary helper scripts, build output, etc. in my working copy all the time.

    The solution to this is to just have a more aggressive .gitignore. But also, note that the “working copy commit” isn’t generally something you want to push or keep; think of it more like a combination of the git staging index and an automatic stash.