Live data from Hacker News

Ask HN: Why is programming editing text?

news.ycombinator.com

21–30 of 79 posts

Re: Ask HN: Why is programming editing text?

#22
There's actually a long and interesting history of tools which abstract away the text editing involved in code. Microsoft in particular has consistently produced visual tools to build code - usually, but not always, specialized to some task.

Windows Forms editors, and similar HTML editors have been around at least since I was a kid (1993 for forms, later for HTML WYSIWYG editors); old versions of visual studio provided tools to let you lay out databases visually, and later on to link those up to related objects. Maybe they still do, I don't know.

Turing-complete visual code editors have also been implemented. Microsoft (again) had a couple - a "Visual Programming Language" (named as such, iirc) for their long-dead robotics framework and something else called "Workflow Foundation" (WF), which allowed you to lay out workflows with arbitrary code built into it. I only worked with WF, and it was pretty terrible.

A much better implementation is Scratch. It's generally relegated to education, because laying code out visually is actually pretty inefficient. It's great when you're getting started, but you'll soon find that the textual representation of a language is a lot denser. Put another way, what takes longer: typing `def` or moving your mouse to a menu and dragging a "function" object into place?

Regarding cross-compilation, that's a different problem, and one which has been solved in various directions. Ideally, one could compile this hypothetical language directly to machine- or bytecode.

I do see the appeal of doing this. If you come up with something you should post it here - I would love to see it.

Re: Ask HN: Why is programming editing text?

#24
You mean something like model-based development? That is a thing, at least I know it is in use for some safety critical development. The two products I am aware of are:

* SCADE Suite: https://www.ansys.com/products/embedded-software/ansys-scade...

* TargetLink: https://www.dspace.com/en/inc/home/products/sw/pcgs/targetli... (Generates C code from MathWorks SimuLink models)

I suppose the nice thing about these is that you can show some (safety and/or behavourial) properties directly on the model.

Re: Ask HN: Why is programming editing text?

#25
I "learned" coding with LabView. It's "graphical programming". After three years and ever-increasingly complex programs, I was longing to use a text-based editor.

LV is super practical for "quick and dirty" device control, but beyond that, it's an inefficient grind of connecting things.

Re: Ask HN: Why is programming editing text?

#26

I "learned" coding with LabView. It's "graphical programming". After three years and ever-increasingly complex programs, I was longing to use a text-based editor. LV is super practical for "quick and dirty" device control, but beyond that, it's an inefficient grind of connecting things.

If anyone's using LV and would like to use C/C++ (without LV-CVI), there are C libs included in the DAQ driver package. This also has the advantage of not requiring a LabVIEW license at all.

Re: Ask HN: Why is programming editing text?

#27
Just as an experiment give scratch a try:

https://scratch.mit.edu/

I think you might find out why test is pretty handy.

I can hammer out a one liner with a bunch of methods to do a thing(s) pretty fast. Dragging stuff around, much much slower and IMO it's harder to understand what is actually going on.

Re: Ask HN: Why is programming editing text?

#28
post #6

Previous 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…

how do you keep track of these things for future reference? Browser history or something more involved than that?

Re: Ask HN: Why is programming editing text?

#29
Because 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 interpret them; and address the above. When you code, you are telling a story and are in control of the narrative. When you paint a picture (I.e. graphical) you have less control over the narrative and interpretation.

Or at least that’s my hot-take.

Post reply on HN