24 November 2024

EXTERNAL OR INTERNAL LOCUS OF CONTROL (This is a Small Rant) ---- We Must Talk About: Locality

PLEASE NOTE: The author of this piece is Alan Darmasaputra
BLOGGER INSERT: 
The Whorfian hypothesis, also known as the Sapir-Whorf hypothesis or linguistic relativity, is the idea that language influences how people think about the world. 
The hypothesis was developed by American linguists Edward Sapir and Benjamin Lee Whorf in the early 20th century. 
The Whorfian hypothesis suggests that the structural differences between languages affect how people think about reality

We Must Talk About: Locality

This is a small rant because whenever I see the frontend community talking about state management they always talk in terms of global versus local and that makes me feel a bit left out because I work a lot with thick/rich/fat clients which demands a lot of use of nested localities and I need to have someone to relate to regarding this.

So I'm pitching the entire world to normalize using the words superlocal and sublocal. They refer to something local (as in bound to a particular location, uh... latin: locus), BUT of a bigger and smaller scope respectively.

The words can be used to describe a relationship

"the [state](<https://en.wikipedia.org/wiki/State_(computer_science)>) management for this table data is superlocal to the table component because a parent [component](https://en.wikipedia.org/wiki/Component-based_software_engineering) needs access to these too"

...or as a standalone adjective

"components can't have access to sublocal data."

But what about using parent and child?

Parent-child doesn't quite work when two things are not of the same species. (cat moms/dads don't count)

I mean--

State A is superlocal to Component B

- or -

State A is managed by a Parent/Ancestor component to Component B

The former is much clearer than the latter.

Whatever dimension

Remember lifetime and the notorious lifetime as re-established by Rust?

You can say that "something is sublocal in terms of time" equals to "something has a shorter lifetime".

You can say that about spaces too, like "a district is sublocal to its city".

It gives you a bit more freedom to talk about any relationship in a continuous dimension. "The intersection of Object A and Object B is sublocal to both."

So it applies to 3d space, 2d space, time, branches etc, but they have to have a certain order to it.

What about super/subset or super/subsequence?

Well, there's a nagging weirdness when using those words. You kinda have to convince yourself that you're talking about sets and sequences when they are only debateably so.

For example, whether a single boolean is a set or not is debatable. You might bring up region of memory, which is discrete, which the thought of helps you convince yourself that a boolean is in a way a set.

The locality being a spectrum of

1 vs N

superlocal/sublocal doesn't help you think about cardinality as in "1 ParentComponent can have 0-N ChildComponent".

Let's get back to state management for a bit. When we say we need a global state, what we actually need is a superlocal state, something we don't own, something that provides, the Big Other. However, the implication of using the term "global" is that it implies "one-ness".

Sometimes we don't want that "one-ness".

Sometimes we want more than one entities that can be superlocal.

Words shape worlds

Words, symbols, are the bridge between our minds and the real world that we cannot ever perfectly model.

I hope by introducing these two simple terms, more people realize how significant and useful they can be and discover the hidden problem because we don't think a certain way.

So, normalize superlocal/sublocal (or please anyone that knows better English tell me if there are better words for these).


P.S. My library to work with superlocal/sublocal state management didn't take off, so I hope someone build one and it takes off so I can pull my hair less often and worry less about balding.

P.P.S. passive state management sucks!

No comments:

HERE TO PROVE ANYTHING CAN HAPPEN: Meme Coins Explained: Hype, Risk, and Profit!

   Finbold 14 hours ago Search inside image Dogecoin Whales move funds into this emerging AI Altcoin Expecting a 9,303% rally by January 202...