3 ms·
Treating DOM as the state of my JavaScript code instead of storing state separately and then synchronizing. Using HTML instead of parsing Markdown by applying
by BrainVirus 4y ago
Treating DOM as the state of my JavaScript code instead of storing state separately and then synchronizing.
Using HTML instead of parsing Markdown by applying white-space: pre-line with some additional styling for semantic tags.
Styling style and script tags as visible to embed examples into HTML pages without duplicating or entity-encoding them.
Using files as a key-value store. (File name = key. File content = value.)
Using folders/files as a one-to-many messaging bus. E.g. one app creates empty do-something.txt file in a folder, couple other apps monitors the folder and do stuff. Very simple setup, but allows to create multiagent systems in different languages with persistence and easy way to debug/interact with the whole thing manually.
Using inheritance instead of mocking frameworks. (Instead of mocking something out, extend the class, override "mocked" behavior and test that class.)