3 ms·
Bit of a meta comment but: I love the author's rewriting of javascript into "human-readable" code[1], while retaining the same visual style as code written in
by rablackburn 5y ago
Bit of a meta comment but:
I love the author's rewriting of javascript into "human-readable" code[1], while retaining the same visual style as code written in an editor.
It feels like an excellent way of representing what is inside the programmer's mind when writing the code, and I will probably try to replicate it next time I coach a new student.
[1] https://miro.medium.com/max/700/1*aXnY3j41mO3AShqSGiYgBA.png https://miro.medium.com/max/700/1*aXnY3j41mO3AShqSGiYgBA.png
- martin_a 5y agoNot sure if I'm the only one, but I start writing code like this quite often. At first it's "comment only" to describe what I'm trying to achieve and then I'm adding functional code in/around it. I find that really helpful, although some might say there's some "comment bloat" in the end, as I often keep the comments, too.
- Zababa 5y agoI usually do something like that when working with someone, though I write "real" code but using variables and functions that we don't yet have, so that we can agree on the structure of the code.
- josefrichter 5y agoThat’s called BDD, isn’t it? :-)
- martin_a 5y agoI don't know to be honest. As a part-time programmer I just find it helpful to tackle the task like this. :-)
- thrdbndndn 5y ago>retaining the same visual style as code written in an editor I think its just their editor's syntax highlighting, likely for Javascript. Highlighting numbers in a different color definitely helps, but highlighting a very small subset (I assume only in and of) of random prepositions doesn't really do much.
- jacobbergdahl 5y agoYeah, this is correct. In retrospect, I think I should have disabled the syntax highlighting for the numbers and the prepositions.
- jacobbergdahl 5y agoHi! I'm the author and I just wanted to say thank you for your nice comment :)