[HN Gopher] Benefits of 2D code layouts (2018)
___________________________________________________________________
Benefits of 2D code layouts (2018)
Author : chrispsn
Score : 16 points
Date : 2021-05-25 21:52 UTC (1 days ago)
(HTM) web link (twitter.com)
(TXT) w3m dump (twitter.com)
| politician wrote:
| Many multiplayer video games have a radar that provides a high-
| level summary of the positions of teammates and hostiles. This is
| useful information that helps navigation, and it's usually a
| small element tucked in a corner.
|
| A 2D view of code layout could be useful in this sort of
| secondary radar way for learning a new codebase, refactoring,
| etc.
|
| As a primary mechanism for writing code, outside specialized
| applications like graphics shader development, I'm not sure it
| makes sense.
| alanbernstein wrote:
| Sublime has the minimap, a name which sounds like it was
| borrowed from the videogame world.
| jdonaldson wrote:
| Whenever someone mentions 2d code layouts they typically show
| examples of "node and links" or "spreadsheet" coding. However,
| those examples are largely focused on one presentation. I'd
| really like a language/editing environment to be able to handle
| all three styles, depending on what I was trying to do.
| narush wrote:
| I think phrasing spreadsheets as 2D code is mostly misleading, as
| it makes it seem like it's the code's 2D-ness that makes them
| useful.
|
| Spreadsheets are one way of consuming 2D _data_, which most
| business data is. They also provide a very easy interface for
| thinking about basic transformations on this data: the data is
| very visible, and every transformation you make is therefore very
| visible as well. Really: it means folks don't have to worry about
| control flow.
|
| I agree with other commenters as to the effects of 2D code. I've
| spent the past year talking to 100s of Excel power users, and
| it's pretty clear: at any scale, spreadsheets get incredibly hard
| to follow, audit, and maintain.
|
| The best of both worlds, IMO, is a spreadsheet for data
| visibility, and a program for transformation visibility. I'm a
| bit biased though, because this is exactly what we're building at
| Mito [1].
|
| If you want to see more of our thoughts on the topics above -
| check out this blog [2] exploring the relationships between REPL
| environments, spreadsheets, and noteboooks!
|
| [1] https://trymito.io/hn [2] https://trymito.io/blog/repl
|
| claiming that it's the code's 2D-ness that makes it beneficial
| 1cvmask wrote:
| And there is the world of 2D barcode (Matrix) including the
| ubiquitous QR code:
|
| https://en.wikipedia.org/wiki/Barcode#Matrix_(2D)_barcodes
| ambyra wrote:
| Excel as a code editor would be cool. Each cell could be a
| function or variable, watch them update in real-time, highlight
| which functions are being called, which variables are being used.
| GuB-42 wrote:
| For most applications, having used a few 2D "programming
| languages", I disagree.
|
| 2D layouts are simply too hard to follow once things start
| getting complex. You spend a lot of time reorganizing stuff. If
| you find writing clean code hard, making clean graphs is hard
| squared. As for spreadsheets, they are good for manipulating
| data, but for logic that is a little bit complex, they are
| terrible.
|
| The author claim it is better for parallelism, but even for the
| most parallel application: chip design, most people use text-
| based "1D" programming languages (HDL) when things get serious.
|
| Also, do you remember UML? It used to be super trendy in the 90s.
| Now, I almost never see it used. Sometimes you get a class
| diagram, usually generated from code.
|
| 2D layouts can be nice on a very high level. Connect the boxes.
| Digital audio workshops tend to work like that, but behind the
| boxes, this is regular code.
___________________________________________________________________
(page generated 2021-05-26 23:01 UTC)