4 ms·
> Not having a compiler means I have to have unit tests doing what a compiler would do or finding out I have syntax errors or other errors at runtime. Nope, it
by guggle 6y ago
> Not having a compiler means I have to have unit tests doing what a compiler would do or finding out I have syntax errors or other errors at runtime.
Nope, it's not the only way. In practice you'd have type hints all over your code and a linter to perform static analysis. Of course this can be integrated in you IDE, so it's easy to do.
> Not having strong types and limited type hinting. I have no idea what things are, is it a int, string, object etc, clicking through in an IDE to see code/docs isn't as great as it's hard for an IDE to inspect the code compared to strongly typed language.
Again, with type hints you'll find your IDE does a pretty good job. Heck, Pycharm even gets it right without type hints sometimes.
Not that I don't see the value in compilers, but the case is not as clear cut as you expose, far from it.
> There's a great deal of issues with dependency management. Venv, Docker etc help with this but it's a bunch of extra stuff on top I now need to worry about and sometimes still hit errors.
Not sure what Docker has to do with Python here... I don't use it and we're doing fine. Venv is something you have to learn, sure, but that's what it takes to become productive on any platform, be it Python, Java, Go, Whatever: learn the good practices associated with it.
And while the dependency management is not stellar with Python, that's really not something to love from Java either.
- oblio 6y agoThe thing is, type hints are optional. The vast majority of existing projects don't use them. Third party dependencies don't use them. Python is a toddler in terms of typing system support. Probably a 2 year old.
- guggle 6y agoIndeed. But way to go... third party dependencies wont support Python < 3.6 forever. And it's still very useful for the application code alone.
- tiew9Vii 6y agoType hints are optional. Type hints are very different to a strongly typed language with a good type system. Haskel as an extreme feels like algebra, you have a type a, you need a type c, you have a function a to b, and a function b to c, you just compose them together and from your a you have a b. Tools like hoogle can tell you the function to use for the given args to get to the final type you want. Ignoring Haskel even Typescript can let you express things hard to express in Python with ADT’s etc. Docker has nothing to do with Python but if you want to produce an artifact you can just run anywhere it solves the dependency issue in that the decencies are in the image and you don’t need to run pip install on a deployment server.