Oblique programming strategies
traviscj.com
traviscj.com
- Implement it in pseudocode
- Write the simplest code that will work end-to-end, and work outwards from there
- Find a library that does it
Sometimes importing/depending on a library means you're permanently saddled with an unmaintained, inflexible, third-party white elephant.
These outcomes are not mutually exclusive. One of my apps even has a directory called "lib/boondoggles/" because it includes so many of these. It works fine, but I will never revise it.
Looks like Eno's was 1975 and CWP was '89, but I think the title+description+prompt is actually closer to what I'd originally intended to / would make if I had fleshed it out fully.
* What would we do if there was an order of magnitude less time to solve the problem?
* What would we do if there was an order of magnitude more time to solve the problem?
This can flush out 'we would just buy/use XYZ tool/library etc.' for the first, and reveals fundamental things that we are ignoring for the second.
That's always been a great trick for getting rid of "this is where we are, so justify all changes" and seeing whether your problem is one of inertia or real challenges.
This is quite a valuable one; it's easy to default to one or the other without really thinking. I would add to the list:
- can I write a state transition diagram? (like the classical lift controller or vending machine)
- how did people solve this problem in past decades? (can lead you to the wikipedia rabbit hole, but gets you away from trying to pick a solution from the fashionable set. Answers of the form "with bits of paper" are acceptable and may be useful)
> Think like a tree: ignore the book-keeping details and find the cleanest representation.
> Think like a stack: zoom in to the book-keeping details and ignore the structure.
"In a more complex app, you're going to want different entities to reference each other. We suggest that you keep your state as normalized as possible, without any nesting. Keep every entity in an object stored with an ID as a key, and use IDs to reference it from other entities, or lists. Think of the app's state as a database." http://redux.js.org/docs/basics/Reducers.html#note-on-relati...
TL;DR Redux docs are telling you "Think like a stack: zoom in to the book-keeping details and ignore the structure."
Can someone explain this?
> List the transitive closure of fields in a data model. Regroup them to make the most sense for your application. Do you have the same data model?
For example, if you have a soft-deleted field "is_deleted" in your data model, then the transitive closure from "is_deleted" is the empty set, because nothing can ever change once an object is deleted(unless you support un-delete).
There's also an interesting relation here between reaching some state "S" and having some field "s_reached". I haven't been able to fully understand that relationship, though.
- it must be a compiler a bug