@freakboy3742 So, I feel like an ass explaining this to a Django maintainer. This guy's gotta know 3x as much as I do—including why it's controversial.

The REPLIES, however, are getting kinda sarcastic and mean and poorly informed. So I'm'a explain, in good faith, why it's controversial. 1/
@freakboy3742 Before I begin, who the hell am I: I write Python that powers article recs on Firefox and NASA LandSat satellite data-to-image processing. I teach Python to CS grad students by having them replicate features of pytest, pandas, and memcached.

The reasons it's controversial:

2/
@freakboy3742 1. The first thing to understand about any language/framework is that computers are entirely manmade, and so therefore CS doesn't have "natural laws" like physics does.

CS's "laws of physics" are the perspectives of the humans who wrote whatever the thing is we're writing in. 3/
@freakboy3742 The PARTICULAR perspective of the Python programming language, and the one that the language sold itself on in versions 2 and early 3, was that of a SMALL keyword library. This made the language, in theory, easier to learn than others. More here:

@freakboy3742 No decision like that is universally "good/bad"—it's the communication of a perspective.

In line with this perspective, the Python maintainers have several times rejected the idea of adding a case statement. The reasoning: if...elif does that. We don't need a bigger language. 5/
@freakboy3742 So this is not just about a case statement or no case statement. This decision calls into question the driving perspective of the language team.

It's the open source equivalent of a court repealing a past decision after ruling on stare decisis for like three decades.

6/
@freakboy3742 To that's thing 1.

Thing 2 is, as repliers have pointed out, this isn't "just" a case statement. It rebinds a name (reallocates an existing variable) without clearly communicating that it's doing that.

So, I'll be frank here. I have seen a lot of code bugs in my career.

7/
@freakboy3742 The really bad, insidious ones are never, like, syntactic sugar screwups. The compiler catches those.

The BAD ones are situations where variable allocation isn't working the way the developer thinks it is. Those bugs can hide for Y E A R S.

This is why I teach... /8
@freakboy3742 ...precedence, associativity, and scope in the very first lesson in my Python class. In my experience, misinterpreting these three things causes more developer tears than anything else.

More on insidious bugs: 9/

chelseatroy.com/2019/12/30/pos…
@freakboy3742 So that's thing 2.

Now I wanna do thing 3: why this language feature would be useful to somebody who writes Django (and perhaps even why the maintainers themselves wanted it in there) versus why a lot of the Python community is upset about it.

Context time!

10/
@freakboy3742 Apropos of thing 2, a lot of arguments like this one in programming come from a misunderstanding of scope.

In particular, everybody thinks that programming advice that works for them specifically has global scope for all of programmers and it super doesn't

11/
@freakboy3742 Take this common Programmer Advice example: "Use composition, not inheritance."

For and-user app writers, sure. But Android, iOS, Rails, and Django have you inherit from their classes all over the place. And if they didn't, believe you me, they'd be a bigger pain to use.

12/
@freakboy3742 Same deal with performance. "Worry about legibility before performance."

For end-user app writers, sure. But the reason end-user app writers can do that is that language designers made the BASE LANGUAGE fast enough for that. By prioritizing performance.

13/
@freakboy3742 So, if you're writing a framework (like Django) or a programming language (like Python), your design priorities are different than if you're writing a Django app for an employer, for example.

To language and framework designers, a case statement is super helpful because... 14/
@freakboy3742 1. It's usually performant AF
2. It's a concise structure useful for metaprogramming
3. Probably this assignment magic is helpful in framework-and-PL-writing contexts.

But it adds little (and takes away assignment explicitness) for end-user app devs, which is 98% of Pythonistas
@freakboy3742 Do I think this is going to push Pythonistas away from the language? I mean, nah. There's other stuff like this in the language. Most app devs just don't use it.

But the breaking stare decisis thing does make me wonder where the language is headed. That's a big deal. 16/
@freakboy3742 Anyway I'm done talking. Here's more on detecting assumed context if you're interested.

chelseatroy.com/2020/11/07/wha…

• • •

Missing some Tweet in this thread? You can try to force a refresh
 

Keep Current with Chelsea Troy

Chelsea Troy Profile picture

Stay in touch and get notified when new unrolls are available from this author!

Read all threads

This Thread may be Removed Anytime!

PDF

Twitter may remove this content at anytime! Save it as PDF for later use!

Try unrolling a thread yourself!

how to unroll video
  1. Follow @ThreadReaderApp to mention us!

  2. From a Twitter thread mention us with a keyword "unroll"
@threadreaderapp unroll

Practice here first or read more on our help page!

More from @HeyChelseaTroy

3 Dec 20
@AishaBlake @ceeoreo_ @laurieontech Ah, I do have pieces :) lemme link some cornerstones.

First, this. It goes directly into the deep end addressing the way that white supremacy culture influences the whole interview process.

After this one, I promise the rest are cake. 1/

chelseatroy.com/2020/10/01/doe…
@AishaBlake @ceeoreo_ @laurieontech Next, an oldie but a goodie about hiring criteria in general under the guise of "hiring for fit."

This is something places claim to do, but you ask them what it means and they're not sure. This puts a finer point on that. 2/

chelseatroy.com/2018/10/04/hir…
@AishaBlake @ceeoreo_ @laurieontech Then there's this, where I basically go in on using "smart" as a hiring criterion because:

1. It's vague and meaningless
2. You probably don't need, and maybe even don't want, the thing you're looking for. 3/

chelseatroy.com/2017/07/21/sma…
Read 11 tweets
2 Dec 20
Tonight I gave the last lecture of the third run of my class, Mobile Software Development.

The final recording is uploaded and the independent survey is done, as is the survey review with the course staff. We have our list of things to revisit for next time.

My TA said...1/
"People liked it! No surprise."

Which is kind of her, but a year ago, we had NO idea if people would like this.

I wanted a class that capitalized on students' position relative to the mobile stack to teach them skills that they would need in a practitioner or research role. 2/
That required teaching...risk analysis, automated testing, version control, IDE key bindings, ethical considerations, data privacy, feedback techniques, and the gravity of our jobs.

Ah—and at least two programming languages and two frameworks. 3/
Read 13 tweets
6 Nov 20
Dear Seattleites, New Yorkers, and SFers applauding Georgia right now:

It's the exact same f**king state that you shit all over, call two-toothed hicks and all kinds of names when the vote doesn't go your way.

At some point you're gonna need to realize something. 1/x
At some point you gotta realize, that state not a monolith.

I's a diverse population whose community organizers have more progressive badassery in their pinky finger than you have in your whole body.

And you know what else? This'll REALLY blow your mind 2/x
That's ALSO true of ALL THE OTHER SOUTHERN STATES that you think of as "red states"

You know, the ones you shit on when they COLLECTIVELY don't do what you tell them to.

They also have well-organized, progressive populations trapped in gerrymandered political designations. 3/x
Read 30 tweets
20 Oct 20
This is a joke, BUT, I have a hypothesis why OS projects get names like these.

Strap in. Let's talk about STEM, and art, and names.
To give you an idea of my perspective: I work on 6 OS projects.

Here are the three I inherited and where they fall up on @vboykis' name taxonomy:

theia - #1
zooniverse mobile - #3
galaxy zoo - #3
Usually, an open source project gets a name from an individual contributor, or maybe several. And usually, it's an individual TECHNICAL contributor.

I know dozens of engineers who have a special love for coming up with these names.

Why? Well...
Read 11 tweets
19 Oct 20
Do you like having the news and feeling "up" on things, but lately (or heck, even for the past several years) the news has been too much to bear?

This is my recommendation: focus on your local news. This has three benefits:
1. You'll stay up on the things that would actually impact your day-to-day.

Coronavirus cases up in your city? Take extra caution this week.

New local black-owned coffee shop? Time to try a new brew.

Nearby neighborhood impacted by food insecurity? Join an effort to help.
2. At the local level, there's usually a balance of "wins" and "losses." So it's not, almost ever, ALL doom.

And even the "bad" things are local, which means you aren't powerless. You live here! You can help!
Read 5 tweets
4 Sep 20
Okay. This is gonna be an ongoing #VirtualPopcorn thread about how sexuality is represented in the TV show Lucifer.

I'm gonna start with some links to tweets where we've talked about this topic in other TV shows for context, and then get into it.

1/prolly too many
So first, the prior art.

We talked about "He's not my boyfriend" in The Old Guard.

I, a queer, can tell and appreciate that that scene was either directed or acted or both by a queer person. But I don't explain WHY I can tell.

I mention a similar thing again with respect to Orange is the New Black.

Read 68 tweets

Did Thread Reader help you today?

Support us! We are indie developers!


This site is made by just two indie developers on a laptop doing marketing, support and development! Read more about the story.

Become a Premium Member ($3/month or $30/year) and get exclusive features!

Become Premium

Too expensive? Make a small donation by buying us coffee ($5) or help with server cost ($10)

Donate via Paypal Become our Patreon

Thank you for your support!

Follow Us on Twitter!