Why This Matters
This article explores the concept of spatial languages in coding, proposing a shift from traditional linear (1D) code to 2D representations. By leveraging spatial notation, developers could simplify complex expressions and enhance readability, especially for multi-arity functions and logical operations. This innovation has the potential to transform how code is written, understood, and maintained in the tech industry.
Key Takeaways
- Spatial languages enable 2D code expressions, improving readability for complex logic.
- Traditional infix notation struggles with multi-arity functions; spatial notation offers a solution.
- Implementing 2D coding could lead to more intuitive programming interfaces and tools.
Spatial languages Nishant Shukla
I guess expressions don’t really need to read left-to-right on a line.
Why can’t a < b be written vertically too?
a < b
All this time we’ve been writing expressions in 1D space, but what happens when we unlock an extra dimension?
Of course the IDE and parser need to play nicely for all this to work. Even then, what’s the point? Well, let’s take a look at these examples below.
3-arity functions
We don’t really see 3-arity functions written in infix notation much.
For example, in Python (and most other languages), you can and 3+ things at once:
x and y and z
... continue reading