Hacker News new | ask | show | jobs
by vitally3643 3 days ago
A certain subset of programmers apparently just really, really hate this whole messy concept of "thinking about things".

Text works and is hard because it's a projection of a mental representation. The whole reason we can work with N-dimensional structures in text is because the dimensionality lives in the programmer's head. There isn't really any other way to represent say a >3 dimensional array other than laboriously flattening it into text and expecting the next guy to rotate the hypercube in his mind. That's neither a good nor bad thing, it's purely a fact of our 3+1 dimensional universe.

A shocking number of problems can be best represented in higher dimensions and there's simply no way to encode that information losslessly. Being simple 3D creatures (I'd argue 2D in fact) the only way to do that is by projecting it down into a lower-dimensional space.

1 comments

And also we treat text as an higher dimensional concepts, like the concept of lines and indentations. Jumping around in code navigation, the tree structure in code organization. The separation of mutable semantics for the code in our projects and immutable ones in the libraries that are added. And that’s without diving into the abstraction represented by the symbols and the relationships between them.

Anyone that says text is 1D has a poor model of code in his or her mind.

So the textual representation of the Mona Lisa would actually be more suitable and beautiful?

It's surprising that there is any art at all if 1D textual representation is the ultimate way of representing concepts of the world around us. Incredible really that folks waste their time define colours for such thing as the sunshine.

Oh sorry, of course, you were talking of code - meaning that algorithm concepts are best represented in text? Again, I doubt that very much. Laziness of humans is probably the bigger reason why we're stuck with an inefficient textual representation of higher dimensional concepts.

See: https://news.ycombinator.com/item?id=49051595

Of course, if you're sure that the entire rest of the industry is just lazy, then by all means feel free to join the set of people who have spent vast amounts of time trying to prove out these obviously better ideas. You've got AI now, I'm sure that will make it easier to prove it out. I imagine it can bang together a visual programming language nowadays in a few prompts whereas earlier generations actually had to rather laboriously put one together. You can get right to the part where you actually get to play with the ideas and try to make it fix programming in probably 1% of the time as the efforts that have periodically made HN's front page.

My standard challenge[1] is to make a visual quicksort algorithm that people will generally agree is nicer to read than a textual representation, where the textual representation may include comments (though so can the visual replacement). It's chosen to still not be fundamentally impossible, but to get past the sorts of "look, I can interate on a list and increment each value" demos they tend to come with.

[1]: https://news.ycombinator.com/item?id=25332761

You're saying that text are 1D, while we're saying that it's not. If it were, we would write text on a long rolling tape. If it were, we would write matrices like this:

  [1 2 3; 4 5 6; 7 8 9]
Instead of

  |1 2 3|
  |4 5 6|
  |7 8 9|
The concept of vertical space to separate blocks of text is important. The concept of physically moving the next chapter to a separate sheets of paper in books is equally important.

In code we split the code into files. Then within the files we arrange the code with lines and indentation. That's all for humans. The computer eagerly throws those away.

ADDENDUM

> meaning that algorithm concepts are best represented in text? Again, I doubt that very much.

One of the (most?) important things that algorithms encode is time. Because an algorithm is a description of a process. The only good representation would have been to snapshot the evolution of state.

But that's wasteful. So instead we have statements and expressions that we assume are atomic. Then we have identifiers for referencing and finally we have procedures and functions to cluster those statements and the associated call/return pattern or the single jump/goto to economize on writing.

So code is at least 2D as operations are described in a line and the lines are arranged by time. But the lines are not linear, instead they are grouped into labelled units and the proper evolution are functions call and jump instructions.

A matrix is better represented as a nested list of lists:

   ((1 2 3)(4 5 6)(6 7 8))
Of course you ignore that representing a tensor of rank higher than 2 is just as difficult in 2d as a matrix is in 1d.
Sure, I can use ascii graphics to represent 2D shapes in text but that's not a direct representation of the original object:

    \   |   /
      .-'-.
   -- (   ) --
      `-.-'
    /   |   \

That's a sun.

Much like HN is full of textual description and links to images - this entire forum demonstrates the limitations of a textual visual representation.

Yes it works but it's far more verbose than an image would be. Hence an image is worth a 1000 words. And hence HN is more verbose than it needs to be. So is coding more verbose than it needs to be. That's why DSLs (Domain Specific Language) get invented: to reduce the verbosity.

And so it is with a 2D representation: it reduces the verbosity required to transport ideas and concepts. UML is another invention to reduce the verbosity and increase the understanding of the representation of complex systems. Yes UML can be represented as text (see Mermaid[1]) but the UML image is probably a lot more understandable than the Mermaid representation.

[1]: https://github.com/mermaid-js/mermaid

An image is not a good representation either. Where is heat? Where is size? Where is gravity? Images are useful, but so is text, each in a different way. The nice thing about text is that it encodes a much larger representation of something in only a few. So I can type 'sun' and it's useful enough to get my meaning without me showing you a picture every once in a while.

So yes in certain context, a diagram may be more useful to get a point across. But once that shared understanding has taken place, Text are more economical.

A lot of foundational aspects of computing are too abstract in nature to be able to do a good 2D or 3D representation. So what we do is transforming them into streams of symbols and do symbolic manipulations on them. And with symbolic manipulation, you get abstraction.

The main issue is that a lot of people are not good at symbolic representation and manipulation. Because it's abstract and it's entirely a product of the mind.

The power of computers is that they can do the tedious part of symbolic manipulations, repeatedly and without failing. And with peripherals interfacing, they can translate symbols from/to reality.

> The power of computers is that they can do the tedious part of symbolic manipulations, repeatedly and without failing. And with peripherals interfacing, they can translate symbols from/to reality.

Exactly what I am implying: using the computer to provide a better abstraction is what is needed.

I agree that text has a certain universality however as you also say, a lot folks don't work with symbols, they work with images (for example) or colours (synesthesia) or shapes perhaps.

Besides move up in dimensions is a continuation of a natural progression in computing: cogs, switchs, punch cards, keyboards, mouse, touch .... VR, AR etc. Currently we're (coders) are somewhere between keyboard and mouse while others (most folks that use smart phones) are at touch. Smart phones users are also programmers who code their device using largely visual concepts (at least I've not seen anyone set their alarm using a terminal on a smart phone!).

Now "Oh but it's not possible to represent those concepts that we work with visually, only text will do" argument doesn't really hold water since it just demonstrates a lack of imagination to find a way to use other representations for those concepts that are essential to programming. Strangely that was possible when moving from switches to keyboards, why shouldn't it be possible even further.

Recently I had the thought that in fact, textual programming (as a paradigm) is now the sole domain of AIs. I've heard so many coders say they have not coded a line of code in months/years, AI is doing all the coding for them. Hence, I think, we humans (those of us here who are humans) should step up to the next domain for coding: 2D and then 3D and explore improved abstractions for the concepts we try to represent in a textual manner (even these concepts are abstractions of the real world).

"Yes it works but it's far more verbose than an image would be. "

The word "sun" is less verbose than your drawing, but more clear(I would not have recognized it as a sun) and has all the information implied.