vizhub-core / vzcode

Mob Programming Code Editor
MIT License
71 stars 14 forks source link

Replay Code Changes Synchronized with Video Lectures #17

Open dlamon1 opened 1 year ago

dlamon1 commented 1 year ago

I'm not sure if this is doable, or if you have any interest in taking on additional ideas with completely different structures, but after three and a half years of watching youtube videos of coding it would be so dang cool if there were an editor that could "play" through the state of the code along side a video. I realize that this is mostly a state management problem, and what you have here is not that at all. But! The educational use of your real time editor is real, which is why I'm leaving my comment/(undeveloped)idea here as I think it would also have real educational value. Also thank you for all the videos!

curran commented 1 year ago

Hey thanks!

Yes, definitely interested in taking on additional ideas and directions for this project. I want to build a thing that's actually useful, and I think being open to new ideas and feedback is critical for that to happen.

an editor that could "play" through the state of the code along side a video

Very cool idea. It's definitely possible, in theory. Scrimba does this, check it out. I've seen in Scrimba they have just audio that goes along with the code editor, which updates in sync with the audio, and you can scrub back and forth in the history. Scrimba also lets you pause the video at any point and make your own edits, which is amazing. They have actually totally executed this idea of yours, so we should look to what they've done as inspiration for anything we do along those same lines.

Regarding how it could be implemented, yes it is a state management problem, in which there is a "meta-state" which is the revision history of the document. Each version in the revision history would have a timestamp and an OT "op" (operation) that's a small diff against the files, like a few keystrokes. Luckily for us, ShareDB already is doing this internally! To implement a system that plays code changes in sync with a video, we'd need to solve many sub-problems:

Overall it's a super cool idea, and I've thought about it. It would take quite some work to implement, but would be sweet!

I hesitate to include this as a "core feature" of this project, but maybe we could start to think about a plugin architecture where something like this could be a plugin. That phase of the project is still quite far in the future, but thanks for your input!