Ask HN: Why is programming editing text?
41–50 of 79 posts
Re: Ask HN: Why is programming editing text?
#42It's a good question and even if the text approach is superior we need a better reason than typically given. I mean think about it. Suppose you want to communicate a JSON object to another programmer. You can say: "the object consists of three key value pairs, the first key is named ... and its value is ..., the second ..." Or you can say: "the object is that which you get from parsing the string that spells thus: cu…
{"x":"bar", "y":"foo", "z":"foobar"}
Not the clearest way of communicating it?
For similar reasons, mathematical notation is used instead of explaining equations in plain English, despite mathematicians' audience not being computers.
Symbolic notation has value: while it takes more initial effort to understand, once you have grasped it, the result is far more concise, unambiguous and generalizable.
Re: Ask HN: Why is programming editing text?
#43It's a good question and even if the text approach is superior we need a better reason than typically given. I mean think about it. Suppose you want to communicate a JSON object to another programmer. You can say: "the object consists of three key value pairs, the first key is named ... and its value is ..., the second ..." Or you can say: "the object is that which you get from parsing the string that spells thus: cu…
The advantage is transparency. I'm actually not sure if the tradeoff is worth it, if symbolic code manipulation would be better, but code as we've written it is no harder for humans to parse than would be a symbolic representation of the same. It already is a symbolic representation of itself, because humans don't see curly brace, double quote, key; humans see things in groups and clumps. Just as when you read these words I'm typing you don't see period, double space, J, u; you see 'clumps. Just'. However, what you see on your screen is exactly the file that's stored on the disc, the bytestream read by your texteditor, the bytestream read by your compiler. And that's worth something.
Re: Ask HN: Why is programming editing text?
#44Please please please follow whatever style guide is handed to you. I am so sick of looking at gobbledygook code.
Re: Ask HN: Why is programming editing text?
#45Seriously, the best thing I ever did was learn to type 140 wpm.
Re: Ask HN: Why is programming editing text?
#46Previous related discussions that may contain insights: https://news.ycombinator.com/item?id=6964369 https://news.ycombinator.com/item?id=9495836 https://news.ycombinator.com/item?id=10099611 https://news.ycombinator.com/item?id=13578256 https://news.ycombinator.com/item?id=13773813 https://news.ycombinator.com/item?id=14278605 https://news.ycombinator.com/item?id=14609215 https://news.ycombinator.com/item?id=1516003…
With titles and dates: Lamdu - towards the next generation IDE (peaker.github.io) Dec 25, 2013 https://news.ycombinator.com/item?id=6964369 Programmer Tooling Beyond Plain Text (joelburget.com) May 5, 2015 https://news.ycombinator.com/item?id=9495836 Prune: A Tree-Based, Home-Row-Oriented Code Editor (facebook.com) Aug 21, 2015 https://news.ycombinator.com/item?id=10099611 Why Don't We Have a General-Purpose Tree Edi…
Re: Ask HN: Why is programming editing text?
#47Because smarter people than I have answered this question: > Programs must be written for people to read, and only incidentally for machines to execute. - Abelson As to why that might be the case: when the bugs you wrote are found; the edge-cases you missed are discovered; or the vulnerabilities you didn’t know about it are unearthed, another person, sometimes future you, will have to read your intentions; try to int…
Re: Ask HN: Why is programming editing text?
#48Because smarter people than I have answered this question: > Programs must be written for people to read, and only incidentally for machines to execute. - Abelson As to why that might be the case: when the bugs you wrote are found; the edge-cases you missed are discovered; or the vulnerabilities you didn’t know about it are unearthed, another person, sometimes future you, will have to read your intentions; try to int…
What imagery gives you is an intuitive sense of how you should, or how the artist did, feel about subject matter. Imagine at a glance knowing which parts the artist was proud of, which they considered an unglamorous but necessary hack, and what they considered ugliness that was forced upon them and unnecessary to the program as a whole, and viscerally "knowing" what areas are wrong?
I look forward to a future where we understand how to teach well enough that artist-programmer hybrids are more common-place.
Re: Ask HN: Why is programming editing text?
#49Because smarter people than I have answered this question: > Programs must be written for people to read, and only incidentally for machines to execute. - Abelson As to why that might be the case: when the bugs you wrote are found; the edge-cases you missed are discovered; or the vulnerabilities you didn’t know about it are unearthed, another person, sometimes future you, will have to read your intentions; try to int…
Your comment is extremely thought-provoking, and I immediately find it true of myself, but artists are quite capable of telling stories in pictures in a way that compels an understanding that goes deeper than reference to text - might it not just be that you and I have less control over the narrative and interpretation than in text because that happens to be our preferred medium? What imagery gives you is an intuitiv…
On the other hand, for an instruction manual, there is little room for interpretation as the words only have so many definitions (though read "Authority and American Usage" by DFW to really open a can of worms), so we do not often re-read a manual for a process we know (though it could be argued we ought to). I also concede that for simple tasks entirely visual instruction manuals suffice, and to that end I will say that I've enjoyed writing simple things with Scratch (for example), but I would hesitate to write a program that needed to be maintained with a visual language.
To put a more fine point on it: For the top 1% of programmers it may be the case that they would work best in a visual language, but the maintenance and support of those applications by the bottom 99% would erase many of the gains (I am here assuming programming as a professional activity in support of an organization's goals, not, as it were, a strictly artistic personal activity). In a professional context - I am unfeeling about what my predecessors felt about any part of the code, I only need to know what their intentions were, and I need them to tell me so, as explicitly as possible.
*Edit: I think that there may be use in clarifying whether we are discussing professional programming or programming as a hobby - because I enjoy both, and while I enjoy learning and using some languages (cough Haskell, Lisp) for myself, I would be very hesitant to use them professionally due to the difficulty others have in maintaining/understanding them. (Food for thought: why do Java, Javascript, and Python absolutely dominate our field despite having "better" alternatives?)