Working on a platform for multiplayer/collaborative apps. Some sketches for what user written code could look like.
@threepointone would simple functions or objects do better than classes? What are classes getting you in this case?

@mattpodwysocki there’s always some state to hold for a “room” (like the content of a document being edited by multiple connections/users) so the class gives a convenient place to hang this state. Honestly that’s all. I’m leaning towards 3 atm, easier to test and compose.

(Also, hi!)

@threepointone hi!

I get that. On the Azure SDK we are moving to option 3 ourselves or at least allow for a hybrid approach of the classical sense and the option 3 compositional approach https://gist.github.com/mpodwysocki/321a24404bd38be4980c331d8da9537c

modular-design.md

GitHub Gist: instantly share code, notes, and snippets.

Gist
@mattpodwysocki love this resource, going to copy some of these justifications. Thanks!
@threepointone yeah I’ve got further thoughts I’m probably going to add to it but the design itself is already in some of our SDKs like this https://www.npmjs.com/package/@azure/notification-hubs
@azure/notification-hubs

Azure Notification Hubs SDK for JavaScript. Latest version: 1.0.0, last published: 5 hours ago. Start using @azure/notification-hubs in your project by running `npm i @azure/notification-hubs`. There are no other projects in the npm registry using @azure/notification-hubs.

npm
@threepointone but feel free to take what you like and glad some folks are finding some use of it!