Hey, did you feel something? I hope not.
I've deployed a new version of the One Post Wonder source code. And it should be... exactly the same, for you. If not, please let me know.
For avoidance of confusion: if something seems busted, it's not you, it's me. Let me know. Thanks! I did lots of testing. But... software is hard.
Just in case, my email is tommybgoode@gmail.com. If stuff broke, tell me things ASAP. Thanks!
What Changed
"So... if everything is the same... what's different?"
I rewrote the code using a modern idiom that other programmers will be able to follow. Which makes it more practical for others to help me move OPW forward. It's a hell of a lot easier for me to maintain the code as well.
You see, back in the Bad Old Days, Node.js programming was like this:
"Hey Jane, fetch me some blog posts, then call me." [Hand-sign of phone]
"Hey Jack, when Jane calls me, fetch some comments, then call me." [Hand-sign of phone]
"Hey Joe, when Jack calls me after Jane calls me, fetch some images, then call me." [Hand-sign of phone]
Except dozens of requests are coming in at once so it's like a telethon in there with only one person manning the phones and everybody wants a fucking tote bag and theoretically that's OK because you don't actually speak continuously to one person right, so...
AAAAAAAA yeah complete madness.
In the New Idiom, Node.js JavaScript programming is like this:
MOTHER MAY I fetch some blog posts.
MOTHER MAY I fetch some comments.
MOTHER MAY I fetch some images.
Behind the scenes, it's the same telethon, but the management of all that parallel madness is encapsulated in the magic words "MOTHER MAY I," which allow us to express what we need to do as a simple series of steps and let JavaScript sort it out behind the scenes.
An astute observer will note that I still have to say "MOTHER MAY I" before each thing. I can't just do the fucking things. Which is still weird and unintuitive. However, in modern JavaScript "MOTHER MAY I" is expressed in the single word "await," which is at least convenient and readable. Crucially, it's at least readable by people who don't do this all day and who don't know this particular codebase by heart.
And the performance benefits are real enough that these days, Ruby, Python, PHP and even Rust optionally offer the same thing for those who need the speed.
So, we've got that going for us.
[Waves tattered flag]
Wait. Why do we do this?
A person might ask why programmers put up with any of this. Java and Python and Ruby and frickin' PHP all let you just write:
Do a thing
Do another thing
Do a third thing
THE END
So why would you put up with this "MOTHER MAY I" bullshit from JavaScript?
Well... because it's fast. Most languages for the web give you a separate thread, aka basically a completely separate telethon volunteer, to think about each request, aka person calling to get a tote bag. Which is enormously convenient. But, also slower because you're not maximizing the throughput of your telethon volunteers.
And... you have to write JavaScript for the browser anyway. To a first approximation, at least. So you may as well double down and use those skills on the server too, right? Less mental context switching. Which gives you plenty of energy for typing MOTHER MAY I! This is sane. [Nods firmly]
Um... great! What's next?
"So what's next?" New features? Probably new features. I promised alt attributes a LONG time ago.
Probably also breaking up that massive "routes.js" file into separate collections of API routes by topic, so I can find stuff.
Probably also TypeScript, just so I can put "8 billion years TypeScript experience" on my resume.
Thank you sir, may I please have another?
"What's TypeScript?" It's a new flavor of JavaScript that is "strongly typed." That means you have to say "MOTHER MAY I" even more often and in twisty new ways... but, if you fail to say it in exactly the same way when you try to call that same code later, it'll stop you and say "uh-uh, that's going to introduce a bug."
So it's a good thing.
One may well ask: does that mean TypeScript can check the original "MOTHER MAY I" incantations (aka "await" keywords) to make sure none are missing? That would be seriously useful.
Oh gosh no, it can't do THAT. Who would want to catch by far the most common source of bugs in a Node.js program? No, it only stops you if you pass a string instead of a number (*), which I practically never do.
But I hear you can do it if you combine TypeScript and eslint and a roll of duct tape. So maybe I'll give that a try.
(*) Yes, yes, and a thousand more complicated but ultimately similar things.
That said, not all your users are me. Which is good, because how much drooling over Mandy Patinkin can one site sustain without exploding into a festival of yiddish, dad jokes and puppies?
Here's the argument for no DMs. And yes, I peeked over your shoulder and copied some answers, but I agree with you.
1. DMs <> posting once a day.
To me, OPW is "I care about this thing enough to use my one post on it" and "We comment on this thing you selected", so the comments are ... part of it!*
2. It's a free site. You do this for love. And we appreciate it! Enabling and maintaining DMs = more work for you technically and perhaps emotionally depending on the yeses and nos. Also, I am not sure how storage works with direct messaging and privacy, but that's money too.
3. I think private comments could be a whole lot of drama. You've already mentioned how and I agree.
4. You want to say no and I think you should.
Here's the argument for DMs on OPW, I think:
1. I want to reach out to somebody privately and I don't have their contact info.
2. ?
For #1, the solution is "ask them". At least it is as far as I can see ... they could say no, but with DMs they could say no anyway, so ... ?
* "part of it" like the skeletons in the David S. Pumpkins SNL sketch.
PS to the person who asked for DMs - I probably know you and like you and I am not trying to yuck your yum, I just disagree with you.
If you put it in that framework, many of the implementation questions and concerns may answer themselves. I'd especially suggest that the default settings might be "my DMs are closed; no permission given now to anyone to DM me; it's a separate question for each person I follow now; and I have to actively say 'yes' for each new person I follow".
* Add a new key
* Put only that one person on it
* Spend your post for the day on a post locked to the key that's just for them
* After that they can comment on that post and go back and forth with you
* Which generates more notifications
* And you can keep replying on that thread
* Somebody is probably doing this
* I'm amused
This reminds me of when that general had an affair with some woman in the military, can’t remember her rank, and they communicated through unsent Gmail messages.
Except it’s not anything like it.
(Head slap) CIA director Petraeus and Paula Broadwell. That’s it.
I don't need a DM feature, but that may be because my list of OPW contacts is small and curated enough that I could get in touch with any of you without too much trouble.
By George, I think you've got it!