@dabeaz@mastodon.social avatar

dabeaz

@dabeaz@mastodon.social

Free-range computer scientist living in Evanston, Illinois. Former academic. I teach computer science courses, but you'll probably find me yapping on about bikes, dogs, and other random stuff here. I wrote the Python Cookbook, 3rd Ed (O'Reilly) and Python Distilled (Addison-Wesley). Teaching CSCI 1730, Design and Implementation of Programming Languages at Brown.edu in Fall 2023!

This profile is from a federated server and may be incomplete. Browse more on the original instance.

dabeaz, to random
@dabeaz@mastodon.social avatar

So, I've decided to drop this giant non-enshittified Python course out there for your ongoing amusement. https://github.com/dabeaz-course/python-mastery.

It's the same course I took on a decade-long world tour of corporate training. Some people who took it went on to do dumb things like land rovers on other planets and stuff. Anyways, enjoy!

dabeaz, to random
@dabeaz@mastodon.social avatar

IDEs reduce code complexity much in the same way that a highway reduces traffic.

dabeaz, to random
@dabeaz@mastodon.social avatar

And on the third day, all of the open issues and PRs were closed without comment.

dabeaz, to random
@dabeaz@mastodon.social avatar

The whole Voyager 1 thing is so inspiring. Although, I've always been inspired by the Voyager mission since I was a kid.

dabeaz, to random
@dabeaz@mastodon.social avatar

If you're not writing bad code, you're not learning anything.

dabeaz,
@dabeaz@mastodon.social avatar

@gvwilson Do we expect doctors to be learning a new surgical procedure while they are doing the same surgical procedure on someone? We do not.

Yes, musicians rehearse. And it might sound bad at first. Because they're learning.

Not sure where you're getting this "unpaid" part of it. I'm talking about learning. When you're learning something, you're going to be bad at it at first. That's all I'm talking about.

dabeaz, to random
@dabeaz@mastodon.social avatar

This is kind of a weird question, but in your education as a programmer were you ever taught anything that you would describe as a "dimensional shift" in your thinking and if so, what was it?

By "dimensional shift", I mean something deeply profound and different that completely changed the way in which you looked at things.

Not programming, but I'd offer thinking in infinitesimals from math as example.

dabeaz, to random
@dabeaz@mastodon.social avatar

I think I'm just bad at open source projects. Oh, the coding part is fine. It's everything else--administration, community, coordination, promotion, the shouting, and all of that. I suck at that and it brings little joy.

By analogy, just because I can play my horn doesn't mean I'd want to lead a marching band. I would not.

dabeaz, to random
@dabeaz@mastodon.social avatar

Instead of describing it as "doing business", I should start telling the neighbors that I'm out with the dog waiting for her to "drop a manifesto."

dabeaz, to random
@dabeaz@mastodon.social avatar

I don't know why it didn't occur to me earlier, but if you've got a directory of multiple Python files that's not a package, but there's a __main__.py file, you can just type python3 . in that directory and it will run.

dabeaz, to random
@dabeaz@mastodon.social avatar

I wonder if there's a correlation between attitudes about programming safety and the distance you were allowed to travel on your own from your house as a kid.

For example, we used to ride our bikes for hours at a time--usually to go play on the train tracks. And well, maybe I should just leave it at that...

dabeaz, to random
@dabeaz@mastodon.social avatar

Thought: I'd bet a lot of projects would have fewer dependencies if pip was 100x slower. Maybe we should try to do that.

dabeaz, to random
@dabeaz@mastodon.social avatar

I think the main advantage of being a Python expert is having a leg up on creating complex solutions to simple problems.

dabeaz, to random
@dabeaz@mastodon.social avatar

A few weeks back, I showed kid the insides of an Apple 2 and then a box of similarly looking electronic components. He picks out a 7-segment LED and says I want to do something with this.

I'm not sure he knew what he was getting into because all I've got are NAND gates. Figuring out how to represent decimal numbers in binary and displaying a corresponding decimal digit from scratch has proven to be much more involved than it looks. It's actually been a pretty awesome project.

dabeaz,
@dabeaz@mastodon.social avatar

After finally getting digits 0-7 to display, kid wanted to see the digits count. So, a bit more coding with NAND gates--implementing increment directly from a truth table. Finally, "lucky for you kid, I just happen to have a quad-input flip-flop and a 555 timer (as one does)."

So we finally ended up with this beautiful rat's nest of work, slowly counting digits.

Thus concluding the first lesson on "how do computers work?"

dabeaz, to random
@dabeaz@mastodon.social avatar

A bit disappointed...

>>> exc = ValueError("Bad Value")
>>> match exc:
... case ValueError(msg):
... print("Failed:", msg)
...
Traceback (most recent call last):
File "<stdin>", line 2, in <module>
TypeError: ValueError() accepts 0 positional sub-patterns (1 given)
>>>

dabeaz, to random
@dabeaz@mastodon.social avatar

I know I've been a bit checked out lately, but I saw some diagram about Python packaging the other day and I literally recognized none of the words written down on it.

dabeaz, to random
@dabeaz@mastodon.social avatar

Note to self: "I'm sorry" is not the most tactful response when other parents say they're working on a project related to AI-- correct though it may be.

dabeaz, to random
@dabeaz@mastodon.social avatar

I sometimes wonder if I should teach a project course (like raft or compilers) where you don't even know what programming language will be used until you show up. That would certainly be one way to make things even more exciting.

dabeaz, to random
@dabeaz@mastodon.social avatar

It seems to be a bit of good news that the results of my recent sleep study indicate that all of that intense snoring during Dune 2 can NOT be attributed to any kind of sleep apnea.

dabeaz, to random
@dabeaz@mastodon.social avatar

Thought: It'd be kind of interesting if your editor made some kind of droning sound, the intensity of which was proportional to the number of bugs present.

dabeaz, to random
@dabeaz@mastodon.social avatar

I sometimes wonder if the biggest drawback to inheritance in programming is thinking about it. Stop thinking. Do. Don't think.

dabeaz,
@dabeaz@mastodon.social avatar

@robpike One of the things I really like about my Raft course is watching people come to a realization that there are like a 1000 different ways to shoot yourself in the foot and almost none of them involve type errors. But, by all means, keep going on about contravariance or some shit if you think it might help you climb out of that huge hole you just dug.

dabeaz, to random
@dabeaz@mastodon.social avatar

A fleeting thought that maybe I've been writing Python class decorators wrong all along.

dabeaz,
@dabeaz@mastodon.social avatar

To elaborate, I've been thinking about how a class decorator expands into something like cls = decorator(cls). A function call. So, why in the hell do most class decorators mutate the cls argument in-place as a side effect? (a very non-function kind of thing to do).

I've done this with class decorators in my books, but I'm hardly the only offender. Also class decorators in the standard library (e.g., dataclass) mutate the class. It now just feels off to me.

nedbat, to random
@nedbat@hachyderm.io avatar

My test suite has just one dot on the last line. What would you do?

  • Delete one test
  • Change the width of the terminal
  • Keep it as a visceral reminder of the uncomfortably chaotic nature of the universe
  • Write more tests
dabeaz,
@dabeaz@mastodon.social avatar

@nedbat Put a time.sleep(30) in that one test to just let it hang there for an uncomfortably long time.

jacob, to random
@jacob@jacobian.org avatar

I wanna hear about the best concerts you’ve been to! Some of mine:

  • Ozomatli at The Catalyst - played until curfew, spilled out onto the street and jammed for another hour until the cops came
  • Flaming Lips at Liberty Hall - second set, played the entirety of Dark Side
  • Dar Williams at Liberty - power went out, she sat on the edge of the stage and played three songs by flashlight
  • Joni Mitchell, Brandi Carlisle, et al at the Gorge - simply magical
dabeaz,
@dabeaz@mastodon.social avatar

@jacob I sat about 6 feet away from Chick Corea at Space in Evanston. That was amazing.

Envious of your Ozomatli gig. I bet that was nuts.

  • All
  • Subscribed
  • Moderated
  • Favorites
  • JUstTest
  • GTA5RPClips
  • thenastyranch
  • ethstaker
  • everett
  • Durango
  • rosin
  • InstantRegret
  • DreamBathrooms
  • magazineikmin
  • Youngstown
  • mdbf
  • slotface
  • tacticalgear
  • anitta
  • kavyap
  • tester
  • cubers
  • cisconetworking
  • ngwrru68w68
  • khanakhh
  • normalnudes
  • provamag3
  • Leos
  • modclub
  • osvaldo12
  • megavids
  • lostlight
  • All magazines