4 ms·
Rich Hickey actually has spoken about this on numerous occasions! So much of what we really do in programming is move data around, why not have data as first-cl
by WinLychee 3y ago
Rich Hickey actually has spoken about this on numerous occasions! So much of what we really do in programming is move data around, why not have data as first-class citizen in your programming?
- samsquire 3y agoThank you. I am working on an idea for programming that the primitive is literally moving things around in a grid. In a spreadsheet the formula is hidden behind a cell. And in most programming languages we write instructions and the state is implied - you don't see the state unless the program writes it out. In this design you see the state and all objects at all times. The idea is that the instruction is generated from the movement. https://replit.com/@Chronological/DynamicTables https://replit.com/@Chronological/DynamicTables Try clicking "100" and move it into the JSON below. At the moment I've implemented movement and JSON -> table. You can move things between fields in the JSON. You can rewind states of the top grid by clicking the instruction. The plan is to put operations and API calls on the screen so you can move things into them, and their results shall go back into the grid.
- WinLychee 3y agoOh I see, you will quite literally "move" the data by pointing and clicking / visualizing the transfer of data. That's brilliant!
- tenebrisalietum 3y agoIsn't that what OOP is? Methods contain code, objects contain code and data, and invocations of code are primarily in reference to data.
- WinLychee 3y agoWell, in Clojure at least, data is a generic thing you structure your program around, and is not hidden inside a class coupled to behavior. This is safely enabled by immutable values as a default. The standard library and ecosystem consists of generic functions operating on that immutable data. This is very liberating as you do not run into a combinatorial explosion of incompatible types that need to be marshaled to work together. Generally you have 3 kinds of things in Clojure: associations (maps), sets (uniqueness), and order (lists/vectors).
- otter-in-a-suit 3y agoI think you’re describing FP in general here. I, too, am a fan, especially in data intense applications, where a clear / decoupled data model and aggressive compiler solve many headaches.
- lmm 3y agoI'd say the opposite - OOP is the paradigm that does the most to hide your data, hiding it within these encapsulated actors where you can't access it directly or even see what and where you have.
- kendalf89 3y agoI would have thought that encapsulation hides the way data is processed, stored, and moved around. But the data itself is always available in my experience.
- lmm 3y agoSuppose the data is in a private field of an object deep in the object graph. How do you get it? You can't, by design - that object's public interface may expose some aspects of the data, but you're not meant to access the actual raw data.