Comment by vitally3643

6 hours 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.

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.

    • 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.

      7 replies →