@nedbat@hachyderm.io
@nedbat@hachyderm.io avatar

nedbat

@nedbat@hachyderm.io

Python, software, coverage.py, typography, juggling, Boston, autism (dad). Laughing at the world doesn't mean I don't take it seriously. He/him.

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

nedbat, to random
@nedbat@hachyderm.io avatar

Tired of this: "learn C so you can understand how a computer really works."

So much of modern computers is not visible from C (pipelining, virtual memory, branch prediction, cache misses, etc).

I guess what they mean is, "you learn about pointers and consecutive memory locations"? How is that helpful for programming in other languages without pointers?

C teaches you an abstraction of computers based on the PDP-11. It's interesting, but it's not essential.

nedbat, to random
@nedbat@hachyderm.io avatar

Holy cow: https://oldweb.today/

Emulated old operating systems running emulated old browsers displaying archived old web content!

nedbat, to random
@nedbat@hachyderm.io avatar

Do you have interns at work this summer? They may find this helpful (created by a summer intern at edX a few years ago):

nedbat, to random
@nedbat@hachyderm.io avatar

The virus that has been going around finally got to me.

Not COVID, layoffs: https://nedbatchelder.com/blog/202401/i_am_at_liberty.html

nedbat, to python
@nedbat@hachyderm.io avatar

A common question: what's the difference between a script and a program?

  • A program is something you've put some thought into.
  • A script is something you didn't think you had to put any thought into.
nedbat, to random
@nedbat@hachyderm.io avatar

Micro-rant: if you are writing software that asks for a password, please tell me which password you mean. My Mac password? My 1Password password? OneLogin? ssh key?

In this day and age, how can anyone think "your password" is just one thing?

nedbat, to python
@nedbat@hachyderm.io avatar

Advice for beginning ( and anything else) learners: https://nedbatchelder.com/blog/202309/advice_to_beginners.html

"Write code. Write more code. Get your hands in there, do things and find out what happens. You’ll learn best by doing."

nedbat, to random
@nedbat@hachyderm.io avatar

Coverage․py 7.4.0 can use Python 3.12's lightweight sys.monitoring module. Coverage measurement with much lower overhead! Try it, and let me know.

https://nedbatchelder.com/blog/202312/coveragepy_with_sysmonitoring.html

nedbat, to python
@nedbat@hachyderm.io avatar

A real-world example where ’s match/case shows its power: decoding GitHub webhook payloads.

https://nedbatchelder.com/blog/202312/realworld_matchcase.html

nedbat, to boston
@nedbat@hachyderm.io avatar

Genius: the town of Somerville encourages residents to take care of storm drains with an Adopt-A-Drain program that lets you name the drain: https://somerville.mysticdrains.org/

Pinky and the Drain
You're So Drain
Durain Durain
(etc)

nedbat, to python
@nedbat@hachyderm.io avatar

I've been here for a year, time for an .

I've been deeply involved with for decades, blogging at https://nedbatchelder.com.

I did a keynote at PyCon this year (https://nedbatchelder.com/text/key23.html) about using engineering skills to improve your people skills.

I maintain @coveragepy. I'm an organizer of https://about.bostonpython.com.

I also talk (here or on my blog) about , , , , parenting, , and whatever else catches my attention.

nedbat, to python
@nedbat@hachyderm.io avatar

New in 3.12: itertools.batched, which finally implements my top-voted Stack Overflow answer (from 2008!)

https://stackoverflow.com/a/312464/14343

nedbat, to random
@nedbat@hachyderm.io avatar

Rambling disjointed thoughts about on the flight home:
https://nedbatchelder.com/blog/202304/pycon_2023.html

nedbat, to random
@nedbat@hachyderm.io avatar

Good news! has a disciplined upgrade and security policy.

Bad news! They sometimes make breaking changes.

Amazing news! @adamchainz wrote django-upgrade that can automatically update your code!!

https://github.com/adamchainz/django-upgrade

nedbat, to python
@nedbat@hachyderm.io avatar

My favorite way to make a readable one-liner is to define a function with a good name, then call the function in one line.

nedbat, to random
@nedbat@hachyderm.io avatar

It's definitely true that a 500-line function is the wrong way to get a job done.

But 100 5-line functions is also the wrong way.

nedbat, to python
@nedbat@hachyderm.io avatar

Yes, packaging projects can be overwhelming, because there are many confusing options. Here's a simple way to do it that doesn't burden you with unwanted choices: https://nedbatchelder.com/blog/202402/one_way_to_package_python_code_right_now.html

https://github.com/nedbat/pkgsample

nedbat, to python
@nedbat@hachyderm.io avatar

Remember that #Python dicts can have tuples as keys! Consider a dict with (x,y) keys instead of nested lists for a grid. It simplifies sparse grids, "resizes" are automatic, it doesn't matter where (0,0) is, and you can use negative positions:

Adding more to the board in flexible ways. https://gist.github.com/nedbat/f22b03f70ceb9686881c4bcd442fad11

nedbat, to random
@nedbat@hachyderm.io avatar

Marketing guy: "Why are you engineers always so negative?"

Me: "Because our job is to build things that aren't working yet, or to fix things that don't work anymore. It's your job to focus on things that are going fine."

nedbat, to random
@nedbat@hachyderm.io avatar

Here's a PDF of the resulting printable schedule, tweaked to avoid the right-hand cutoff: https://static.nedbat.com/PyCon-US-2024.pdf
Four pages, print two-up to get two sheets.

https://mastodon.social/@hugovk/112422128910004621

nedbat, to random
@nedbat@hachyderm.io avatar

If nothing else, https://kroki.io/ is an amazing bestiary of the different text-to-diagram tools, showcasing the variety of approaches. Take a look.

nedbat, to random
@nedbat@hachyderm.io avatar
nedbat, to random
@nedbat@hachyderm.io avatar

If you didn't see my keynote, I have a text-and-slides version up: https://nedbatchelder.com/text/key23.html

No video yet, but I understand that will happen soon.

nedbat, to random
@nedbat@hachyderm.io avatar

Helping my declining mother with her computer, so many things seem hard that could be easier. Why can I rename or move a file from within TextEdit, but I can't delete a file?

I could write so much about things like this right now....

nedbat, to random
@nedbat@hachyderm.io avatar

People in this thread are suggesting other terms besides "slop", but slop works really well because of the parallel to the existing meaning: food that used to be fit for human consumption, but now is just leftover pieces mixed and mashed indiscriminately so that it's used to feed pigs.

https://fedi.simonwillison.net/@simon/112406874796870923

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