Re:First Rule of Google Fuchsia OS Is to Not to Talk About It
by erikpukinskis on Saturday May 20, 2017 @12:09AM
(#14380987)
When you are trying to invent a new version of anything low level, sometimes it makes sense for you to just stub out a supporting library out with a naive implementation, because you then have an interface that you can move around easily. If you are wrapping an existing implementation, with lots of optimizations and corner cases, you'll just get bogged down in refactoring all of those expectations over and over.
Today I implemented an immutable-ish array in JavaScript. I'm using it because I needed something that could work in conjunction with the non-relational, non-key-value database I am building. There were other libraries that provided immutable arrays, probably much better than my implementation. But because I wrote both the immutable data structure and the database, and both implementations are naive, I can very easily trade functionality back and forth between them in order to get the interface right where it needs to be.
There's a good chance I'll then swap out my data store for some existing algorithm, but I really won't know which algorithm I even need until after I've built several applications on top of the naive implementation.
Really, the key here is that this is prototyping. When you're building a prototype, you don't do the thing that will lead to the most correct code, you do the thing that will teach you the most about what the design should be.
Today I implemented an immutable-ish array in JavaScript. I'm using it because I needed something that could work in conjunction with the non-relational, non-key-value database I am building. There were other libraries that provided immutable arrays, probably much better than my implementation. But because I wrote both the immutable data structure and the database, and both implementations are naive, I can very easily trade functionality back and forth between them in order to get the interface right where it needs to be.
There's a good chance I'll then swap out my data store for some existing algorithm, but I really won't know which algorithm I even need until after I've built several applications on top of the naive implementation.
Really, the key here is that this is prototyping. When you're building a prototype, you don't do the thing that will lead to the most correct code, you do the thing that will teach you the most about what the design should be.