Most active commenters

    ←back to thread

    310 points brylie | 13 comments | | HN request time: 0.203s | source | bottom
    1. peternilson ◴[] No.43512862[source]
    Django still lacks typing support. Does Plain improve on this at all? I didn't see typing mentioned in the docs..
    replies(3): >>43512910 #>>43512916 #>>43513078 #
    2. sroerick ◴[] No.43512910[source]
    If you want strong typing in a web framework, why wouldn’t you just use a language with strong typing?
    replies(4): >>43512968 #>>43513290 #>>43513554 #>>43516333 #
    3. brylie ◴[] No.43512916[source]
    Relatedly, in case it's useful, the django-stubs package provides mypy compatible type stubs for Django:

    https://github.com/typeddjango/django-stubs

    replies(1): >>43513115 #
    4. rtpg ◴[] No.43512968[source]
    Because people want strong typing, but also want other things. It's possible to want multiple things, and bemoan that whwat you use is still missing things you want.

    Concretely, Django is way more usable than basically any web framework from the "strongly typed" space, especially for "dumb" CRUD stuff. And you're not hit with making decisions about how to do a bunch of things (though you can swap out mostly any part of Django for something else if you want to).

    replies(3): >>43512999 #>>43513038 #>>43513750 #
    5. sroerick ◴[] No.43512999{3}[source]
    That makes sense! My personal feeling is that a web framework is not the right place in the stack to introduce typing.

    There’s also probably an argument to be made that part of the reason for Django’s “batteries included” success and wide adoption is in part because it is built on an untyped language.

    I get wanting both, though.

    In my own work, I find most of the benefit of static types to be ensuring correctness at compile time, so I just don’t expect that in Python. I also have just not lost that many cycles to type errors. But I know some have strong preferences here.

    replies(1): >>43513971 #
    6. peternilson ◴[] No.43513038{3}[source]
    Yeah, exactly this. Django is just brilliant and sometimes I'd like to use it with typing.
    7. pbreit ◴[] No.43513078[source]
    I personally like lack of typing which makes things MUCH easier. I'm curious the benefits of typing?
    8. yeswecatan ◴[] No.43513115[source]
    While it's truly a great ongoing effort and I am grateful to all the contributors, it's not nearly complete. You may think you're using the correct type until, surprise, you are not.
    9. bowsamic ◴[] No.43513290[source]
    Type annotations have nothing to do with whether a language is weakly or strongly typed
    10. ok_dad ◴[] No.43513554[source]
    I can’t use something else, since my job is working with Python, and type linting is a reasonable alternative in this case.
    11. librasteve ◴[] No.43513750{3}[source]
    if you seek strong typing, but not all the time, in a language suited to web dev suggest you take a look at raku … for example https://harcstack.org
    12. 9dev ◴[] No.43513971{4}[source]
    The main benefit in the developer workflow is autocompletion and feature discovery in the IDE. Having to guess which methods and properties an object exposes, or jump to the documentation every time, is really frustrating. Compare that to e.g. Typescript, which excels in this area.
    13. teddyh ◴[] No.43516333[source]
    Python is a strongly typed language. But Python is not statically typed; Python is dynamically typed, with optional type declarations which enables static type checking (by third-party software).