Earlier quoted context omitted.
I didn't explain the second one well. Here's some exact code. group_keys = ... if not isinstance(group_keys, list): groups_keys = [ group_keys ] So rather than listifying the non-list variable, it was creating a new variable. The cause of this bug is that Python doesn't distinguish between declaring new variables and overwriting existing ones.
Well, this should have been caught as an unused assignment in static analysis. A whole ton of languages allow this situation, so I'm not gonna ding Python too hard for that one. However, here's a related but different python gotcha: if foo(a): v = list(bar(a)) for i in v: print i In this example, v is only defined inside the if. Due to python's limited scopes, v is also valid outside the if, but only has an assignmen…
Python Is Eating the World
741–750 of 993 posts
Re: Python Is Eating the World
#742Earlier quoted context omitted.
I don't agree at all. Your comment basically says: "It used to suck badly. So don't complain it sucks now.". I think dynamic typing is the bane of good software and we as an industry should try to actively discourage new code to be written in dynamically typed languages. That's not to say that Python doesn't have it's place. But I see it more as a programming language for small utilities no more then 2k loc in length…
No, what I'm saying is that it used to suck really badly and we survived just fine, so I find all the over-wrought hand wringing about the havoc and burnout caused by Python's flaws hyperbolic.
Re: Python Is Eating the World
#743Earlier quoted context omitted.
Well in just glad this is the top comment, as Python really is taking over the world for a reason. And of all the bugs I have written in recent memory, not one came down to a lack of static typing. They were due simply to logic errors, flawed assumptions, misunderstood requirements, and good old race conditions. The static typing zealots like to think if it compiles is must be perfect, however this is a mirage. Unit…
Have you ever worked in a large engineering organization full of engineers with varying degrees of experience all trying to accomplish the same goal? I can't imagine anyone has ever tried to do engineering at scale (people wise) and did not find the value in static typing. It's why startups eventually moved off RoR once they started scaling. It's why there is such a large push to type JavaScript (have you seen the ro…
Python typing is quite similar to Flow, a JavaScript type checker.
Re: Python Is Eating the World
#744Earlier quoted context omitted.
Maybe they could write unit tests to make sure what's being passed is lists and strings. But that's probably crazy.
You can write a unit test for anything you can think of, of course. But a strongly-typed language will catch such errors automatically (and for free) at compile time, even if you didn't anticipate the failure case.
Re: Python Is Eating the World
#745Earlier quoted context omitted.
It’s unfortunate that it’s third party, but conda has the unquestionable advantage of being the only Python-centric packaging system that has a reasonable shared binary library story
I'm curious, do you not find wheels + manylinux reasonable? I agree that until recently, Conda definitely had that advantage, but now that you can `pip install scipy` and have that get you a working library and not try to compile things on your machine what does Conda offer beyond that? I guess one thing Conda has that the pip ecosystem doesn't is that it supports installing non-Python shared libraries like libcurl o…
With respect to versioning, I think pip should be way more strict. It should force you to freeze dependency versions before uploading to pipy, not accept "libxyz > 3.5", but require a fixed range or single version. That would make packages much less likely to break later because newer versions of their dependencies don't work the same way anymore.
Re: Python Is Eating the World
#746Earlier quoted context omitted.
> Programming in the large without type safety is a fool’s errand. Lol. Right. No big system has ever been built in an untyped or weakly typed language. Well, except just about every bit of software we all use everyday. But it does seem like some small startups can't get by without it.
> No big system has ever been built in an untyped or weakly typed language. Well, except just about every bit of software we all use everyday. But it does seem like some small startups can't get by without it. Many have built models of the Eiffel tower with toothpicks too, so? You can still built things with inadequate tools: inadequate != prohibitive. You just have more problems going forward. Which is exactly the l…
Re: Python Is Eating the World
#747Re: Python Is Eating the World
#748Reading this got me thinking and I wonder if other people feel like me about this, so I'm going to share it. This is not serious, but not entirely unserious... I try to be a good sport about it, but every time I write python I want to quit software engineering. It makes me angry how little it values my time. It does little for my soured disposition that folks then vehemently lecture me about the hours saved by future…
I've yet to encounter a python linter where you can't pick and choose which rules to ignore. This is a first one to go. Annoying PEP for sure, but https://pypi.org/project/black/ almost completely eliminates your issue.
Re: Python Is Eating the World
#749Earlier quoted context omitted.
Why are you complaining about C in the 90s? If you'd been using punchcards in the 50s you'd have some perspective on some of the complaints and comments about C in 1990.
I'm actually not complaining about C in the '90s, it was amazing compared to Fortran in the '80s. Funny story, my first co-op job (Fortran IV), my boss made me fix a bug using punch cards so I'd appreciate why the codebase wasn't as nice as it might be. THAT was prespective.
Re: Python Is Eating the World
#750Earlier quoted context omitted.
I do. This is 2019, and I like being able to see at least three files side-by-side without squinting my eyes, thank you very much. Yes, I know I'm in the minority these days. :/
what if the overly restrictive character limit causes a decrease in naming clarity?
Of course, 80-character limit doesn't guarantee good naming, but it acts as a friction against adopting ultra-long names, occasionally forcing devs to find a better alternative. YMMV.