Posted on August 29, 2018 by Jonathan EdwardsManaged Copy & Paste A short peek at what I’ve been working on, as a postscript to my Direct Programming video. Share this:TwitterEmail
2 Replies to “Managed Copy & Paste”
There’s no question that copy/paste is widespread. I often google for
things, copy them from stack overflow and then slightly modify them.
For the first 2 minutes of this video, I was bothered by the fact that
the potential values of the stoplight were not well-typed: strings
were used for something where an enumerated type was needed. As I
write this, I begin to think: “In Haskell, change-light-fast would
have a subtype consisting of only RED and GREEN to further tighten up
the code” … in other words, how robust is this code? Does it need
The next thing that became obvious that some form of graphical
programming indicating state transition is far more articulate than
text code in this case. Nonetheless, the need to synchronize delta
between the visual versions exists also.
Finally, when you started to create the general abstract version of
change-light that could be concretized into specific functions, I
began to think: “He certainly needs code as data. Perhaps using Lisp/Prolog
is the best way forward instead of this Pascal-ish language he is
using.” Prolog is especially appealing because the function signature
makes all potential state change explicit right in the header of the
Interesting idea nonetheless.
Provocative as always. How often we face the tradeoff between maintaining near duplicate code or abstracted code complicated by conditionals. What if tools supported both projected partial evaluations as well as the complete parameterized general case?
Comments are closed.