3 ms·
In my experience, the people who love Python are those who are happy with dynamic typing - usually because they only use the language for small projects. When
by pansa2 6y ago
In my experience, the people who love Python are those who are happy with dynamic typing - usually because they only use the language for small projects.
When starting a large project, it would be better to skip Python altogether and use a proper statically-typed language.
Type hints only make sense when you’re working on an existing large Python project - just as Guido was doing at Dropbox when he added them to the language. This is because type annotations are the worst-of-both-worlds - they require the verbosity of static typing and provide few of its benefits.
> This is not a course for software engineers on how to write or maintain a one-million line Python application. I don't write programs like that, nor do most companies who use Python, and neither should you.
- ramraj07 6y agoIf you already know your project is going to be as big as Dropbox's entire codebase, salut don Corleone! But otherwise, I feel like trying to choose the language that scales to a million lines sounds like dooming in the beginning itself by over-engineering. I attempted that myself but kept coming back to python because it's fast to code, it's forgiving as hell and its customizable. Once you're used to it's quirks you can breeze through it fast. I'm sure ruby and js have the same as well, and with ts you get better typing, but with the typing you can do with 3.8, I'll argue that python gives the _best_ of both worlds if it's especially mixed with a good IDE like pycharm. If you really want, you can also incorporate pytype or something from the get-go. If my Greenfield project's biggest problem is that python doesn't scale, then I'm a very happy man.
- flyinglizard 6y agoPython doesn’t scale well beyond one file, one developer, one time write. Once a program needs maintaining, updating, expanding, debugging - the experience quickly deteriorates.
- ramraj07 6y agoThe codebase I work on now is python and I prefer it to both the java and scala codebases I've worked on before that were much smaller. Python gives a better debugging experience than java and a better updating experience than scala (especially someone else's scala) in my opinion.
- at_a_remove 6y agoI guess I should ask what you consider a small project. I have some five-digit LOC projects written entirely in Python. I have never noticed this typing issue everyone is very concerned about and am often baffled by the emphasis placed upon it. What am I missing? I am willing to entertain the idea that I have been very lucky or that I have some programming mannerism which has caused me to skate by this kind of thing, but I just don't get it.
- ed25519FUUU 6y agoAre you the only one who works on the project? You might not notice it in that case, but the engineer who comes after you will.
- at_a_remove 6y agoThe only times I have heard from people who have worked on projects after me is the odd phone call to thank me for the documentation and the clarity of code, just as an intro to ask me a "what should we do about this?" or some kind of obscure historical follow-up. Case in point, I had written an apartment search website in Perl. Now, at this point I had been pretty disenchanted with Perl as a whole due to the "there's more than one way to do it" culture combining with the "executable line noise" syntax to give rise to a lot of very impenetrable write-once, read-never-again code from others. So, when I did this, I used real, appropriately-named variables, eschewing the convenience of $_, and I made sure each line of code did one thing and only one thing if at all possible. I did not pack a lot into a line. Each line should be obvious. Where I felt that it might be subject to interpretation, I added comments as to what I was doing and why. Each function had is own comment section which discussed what it was for and why, possible room for improvement, and so on. Eventually the duty passed to another set of hands, a bunch of students who had never seen Perl (the rise of PHP was strong at that point) and in the follow-up, they mentioned that they found it very straightforward to simply re-write each line. I heard back in the past few months about one of those very large projects I did in a previous job, just keeping touch with people. I asked about one of my personal pet projects. "No, it just keeps running." "It's very obvious where to make any changes." All Python. No type stuff. I just don't see what I am missing.