4 ms·
> but programmer discipline is perhaps even more important. Honestly, I think this trumps everything else. If you don't care enough to write good code, you won
by npsimons 6y ago
> but programmer discipline is perhaps even more important.
Honestly, I think this trumps everything else. If you don't care enough to write good code, you won't. Yes, some languages make it easier than others to write good software, but that won't matter if you're just banging out code without a care.
That said, I do miss the typiness of C/C++ when I'm writing Python. I'd be interested to know how one enforces things a bit more strictly, even if it's only by running a separate tool (so something to be run on every checkin via CI, much as I run static linters for C and C++ code).
- mumblemumble 6y ago> running a separate tool That's how. There are so many Python linters out there.
- npsimons 6y ago> That's how. There are so many Python linters out there. Ah, okay. I've been using pychecker, pyflakes and pylint for quite some time, was just hoping there was something more that would help do stricter type checking. I'm aware of python-contract as an orthogonal way to enforce things, but was a little disappointed it's not included with standard python (at work I don't always have the option of installing external packages).
- tech2 6y agoIs using mypy for gradual typing not an option open to you? http://mypy-lang.org/ http://mypy-lang.org/
- npsimons 6y agoIt is at home! Thanks for the pointer!
- jmholla 6y agoThere's mypy[0] which does actual type checking with effort on your end. It is an external dependency, but you've already printed to a few external dependencies you're leveraging. [0]: http://mypy-lang.org/ http://mypy-lang.org/
- npsimons 6y ago"External" is relative; at home, I can install whatever I please, although I do prefer to stick to what is included with Debian stable, which is pretty comprehensive (it includes pychecker, pyflakes, pylint and python-contract). And indeed, mypy is there to! Thanks for the pointer! At work, we are limited (for the most part) to what is included in RHEL repositories, and even more by the fact we are still on 6.9 on some projects. Hence why I mentioned python-contract, as it's not in RHEL repos (that I could find). Thankfully pyflakes/checker/lint are. I will have to check for mypy.