It's even worse than it appears.
Saturday September 7, 2019; 10:14 AM EDT
  • Phil Windley, a developer friend from Utah, asks via email about the motivation for the persists package. Here's the story. #
  • I was writing a bit of example code for another package I am working on. I iterated over it, factoring and simplifying until it was really easy to see what's going on. I pride myself on really easy to follow example code, because it's what I most need when I'm trying to figure out a new package, I figure it'll help others. #
  • Then I decided to add a small feature that required a tiny bit of persistent data, a serialnum. Of course this comes up all the time, I have a standard practice for it. But in this example, the persistence code doubled the size of the demo, and hid the elegance and simplicity of the code I was trying to demo. #
  • In Frontier, of course, saving a scalar with persistence is simply a matter of assigning a value to it. The kernel takes care of everything else. All the years I've been working in JavaScript, I've been searching for that simplicity. The language is so hackable I figured there must be a way. And when they added the Proxy feature, it did become possible. #
  • That's what persists is. It makes persistent values almost as simple as Frontier. The point is simplicity and factoring overhead from your mainline code into a package. And that's a big deal. #
  • To really bring it home, here's the example app I was talking about, after I used persists. And here are the changes. And btw, I have an even simpler approach, but I can't do it unless I can change the JavaScript language spec, which probably isn't going to happen. 🙏#
  • PS: If you have questions about persists, this is a good place to post.#

© 1994-2019 Dave Winer.

Last update: Saturday September 7, 2019; 11:32 AM EDT.