4 ms·
> I have no idea what is going on from the signature itself. Is records a list, a dict or a database connection? Is check a boolean, or a function? What does th
by okasaki 3y ago
> I have no idea what is going on from the signature itself. Is records a list, a dict or a database connection? Is check a boolean, or a function? What does this function return? What happens if it fails, does it raise an exception, or return None? [...]
This type of objection is only raised by people who have never seriously used Python before. It sounds convincing that this is a serious flaw in Python, but in practice it never comes up because when you know what domain you're working in it's always immediately obvious what types the arguments are.
- Shish2k 3y ago> This type of objection is only raised by people who have never seriously used Python before How serious is “serious”? Because I’ve worked on millions-of-lines python projects powering billion-dollar companies, and I 100% agree that maintaining untyped python code that somebody else wrote (or that I wrote myself, 6 months ago) is a nightmare for exactly these reasons...
- okasaki 3y agoI mean I can't even imagine what would lead anyone to write millions of lines of Python for a single project, so maybe there's a level of serious above what I do. Maybe you're doing it wrong?
- esafak 3y agoHow many engineers does your company have? When you have thousands it is easy to write millions of lines of code.
- dgan 3y ago> it never comes up because when you know what domain you're working in it's always immediately obvious what types the arguments are. Oh this one is hilariously wrong. Is it InvoiceLine that we are getting here? Or Maybe LineInvoice? Nope those aren't the same. But the only argument is called «line». How shameful. Much sadness. Better add a print statement, push a new build and comeback in twenty minutes
- okasaki 3y agoIt sounds like the codebase sucks or you haven't taken enough time to understand it.
- dgan 3y agoThat's beside the point. Those types ("types" you see? hehe) go against your argument "it's obvious from the context", because now it becomes "it's obvious from the context if you are lucky enough that your codebase doesn't suck or you spent 'enough' time figuring it out"
- esafak 3y agoSuppose it sucks, and you are expected to contribute to it already. Welcome to the real world?
- kobzol 3y agoI have used Python for 10+ years, and I'm able to forget what are the input arguments/return type of a function after 30 minutes of working on some other part of the code :)