-
Notifications
You must be signed in to change notification settings - Fork 55
Commit adcbb03

Steve Krouse
## Lots of blogging on the 4th
* TOC
{: toc }
### Rant about abstraction haters
I started the day off with a rant about abstraction haters, which was fun. I'm waiting on some notes from a friend before posting it around.
### [A Human-Readable Interactive Representation of a Code Library](http://glench.github.io/fuzzyset.js/ui/)
I needed a break, so I read through Glen's new essay, in part because its topic is excitingly similar to my own. There's a lot he says that now I no longer have to say myself - I can simply quote him. In fact, I think this essay could provide me with the "intellectual cover" from which to begin my own essay - which would allow me to do away with contexualizing why code comprensibility is important.
I also had fun converting some of his code to an FP style, which allowed me to make some points about why the model is important, along with shwoing the data. I've included the email I sent to Glen:
#### Email to Glen, Fuzzyset & FP
Hey Glen,
I took some time today to dig into your Fuzzyset explanation. It's wonderful! In particular, I love the little details, such as providing links at the very button numbers that show the calculations of the dot product and magnitude in a popup.
The second interactive section of your essay, "Turning a string into a vector", features some code that incredibly difficult to comprehend, even with the explanation and GUI beside it. As an exercise I removed the incidental complexity in the code (in other words, converted it to a functional style) to clear things up:
<script src="https://gist.github.com/stevekrouse/7d4c4d593fe4c97014df594429217aa4.js"></script>
Now you can better follow the logical flow of the code - as opposed to the control flow of the computer. This includes eliminating iteration variables, in fact all mutable variables, which eliminates bugs, such as [a 5-line section that doesn't appear to do anything](https://gist.github.com/stevekrouse/e4c6d782144539907fc30400438243f9#file-fuzzyset_gramcounter-original-js-L7-L11). (Please correct me if I'm wrong.) It also is shorter now: the core of the code is 13 very clear lines (excluding comments).
Additionally, in this form, you don't need your comments on the side (about normalizing the string and adding dashes) because I've added them in context, which makes it even easier for a user to tweak them.
And perhaps the best part of the functional style isn't captured by the code: it's quite visualizable in a way that doesn't require console.log. Each line of code is a constant value, mapped from a previous value. In it's current form I can imagine it being directly converted to something like Flowsheets, and you could marry the abstract symbols and concrete values even further. Dream, here we come!
Best,
Steve
### Continued Casual, comprehensible, visual essay
[Here's the current status of the outline.](https://gist.github.com/stevekrouse/dd90cbee71e0628fc71f3bff1ec708af) It's tough. It's pretty messy. As I said above, I may use Glen's essay as a starting place and just jump into comprehensibility and reactive programs, and not contextualize why those things are important. At the end of the day, my vision of everyone constantly improving and customizing the software they use as the use it for free, while very compelling for me, is less so for others who have less of the picture in their heads.1 parent 5a948e1 commit adcbb03Copy full SHA for adcbb03
File tree
Expand file treeCollapse file tree
0 file changed
+0
-0
lines changedFilter options
Expand file treeCollapse file tree
0 file changed
+0
-0
lines changed
0 commit comments