Comparison of programming & mnemonic data structures

After spending years analyzing the data structures in mnemonics and having taught the data structures in programming especially Java for most of my career, I thought it would be enlightening to show how they essentially are the same. There’s quite a few programmers out there so maybe you would like to see how mental and digital structures overlap. Only the context is different where the brain favors locations and images and the computer favors binary data which are only constraints on the design of the system.

The mnemonic data structures fall under two broad types, the peg list and the story. If you are interested in the discussion, there’s many posts here on the forum including a main topic on analysis and then much more in detail in my books.

The data structures used in computer languages fall into two main broad groups also. The list and the map have many names and variations but you can talk about arrays, linked lists, sets, dictionaries, etc. as just a more structured type of either of those two. (The bag is an interesting third type possibly.) Lists have an order and are navigable from start to finish. Maps are entered and navigable by their index to retrieve their value.

So, the connection should be clearer now. The map uses an independent ordered index to navigate by which would be called a peg list. The values then are stored at each of the map’s location. The index can be of any datatype as long as it has a rule of ordering.

The list uses a forward linked connection to the next value without an index. It can also have a connection to the previous value if needed. Unique values are useful so you don’t get confused about where you are. That’s the set. And of course, the story provides the same style of storage in mnemonics.

For those folks that want to take it further into OO structures, that’s harder to do since classes presume behavior limited by data structure. Most people mean a compound data structure instead I think like the abstract data type (ADT) that preceded the class and has become more prominent in JavaScript as a way to make structures more flexible. You can see my posts on that idea following the summary of posts I put as a rebuttal that classes have not been implemented in mnemonics.

Is this a way of programming mnemonics? Could be. But my interest is to show that data structures follow the same design whether implemented in the constraints of your mind or on a digital system that doesn’t allow imaginative images and is constrained by zeros and ones.

Doug

2 Likes

Help me out here, because I must be missing something… sounds to me like you’re saying, speaking favors the receiver’s (listener’s) ears; whereas, writing favors the receiver’s (reader’s) eyes… other than that it’s the same. I mean sure, both are ways of communicating. What’s your inside here when comparing the two?

Maybe I just don’t get what you’re trying to say. Just going over your statements… I’m not sure you should combine high-level-language data structures and then say that computers favor binary data. Of course, machine code is in binary. Most assembly languages though lack data structures. And, data structures inherent to a computer’s CPU actually doing something would be of the kind: stack/heap… and then you can’t say anymore that the brain favors locations because those will be crucial when addressing memory locations.

The other way around, it’s the same… neurons either fire or they don’t… that’s about as binary as they come. But that’d be low level now as far as the brain and there isn’t much going on in terms of images and locations anymore. I guess what I’m saying is… it’d be helpful if we could first determine the context… are we talking about data structures in high level languages only or are we also considering compiler design, etc. all the way down to machine code here?

Also, if I had to explain the difference between array and list to anybody… I’d point out that you can easily insert an item into the list without having to move the entire rest of the array to do so; on the other hand, arrays allow you do directly retrieve an item from an index.

1 Like

Well, @bjoern.gumboldt, the gist is that I am taking back the system development discussion of both systems to the requirements phase which preceeds the design phase. The requirements are simple in your case and in mine. Yourexample is communicating information and mine is using a structure to store data.

When you say that “both are ways” you are talking about the implementation of the requirements using a set of constraints that identify where the system is to be active. After about 20 years of educating software designers and programmers on systems analysis, I can say that requirements was a bear and no one knew the principles or learned them well after one week.

So this is just a design detail. Languages are implementations of process flow and data structures on a computer. Without a computer they can be written up as SOPs and a simplified schema which are usually called use cases and a data dictionary in requirements analysis.

Now about that assumption of assembly language. You probably just caused every retired programmer over 60 to shatter their reading glasses by saying that assembly language lacks data structures. I hate assembly language and have no love for straight C which comes close. But any language as I said has to have process flow and data structures or else it’s not a language. Check out any discussion of assembly language data structures. That reference talks about nested structures composed of references, structs, and arrays. In the mnemonic implementation we have associations, combinations of previously user-defined data structures, and peg lists using numbers.

It’s interesting about how the location of the structure affects the performance but not the structure itself. The array is designed by the compiler creator to run on the stack. The list is designed in modern languages to run on the heap. They are both the same data structure. The difference between them is the constraints that the array uses and the extended functionality that lists have. They both are peg lists. Arrays use a limited set of numeric pegs. Lists allow for other datatypes as pegs. Performance of the two have come closer to parity as hardware improvements have been made and adaptable behavior is the higher priority so the recommendations I have seen have been to use lists overall. The code has lists backed by arrays anyway just like you associate locations, items, or people before you use them as a peg list.

Now, don’t be calling my brain a computer. It’s much more than that. See Why your brain is not a computer | Neuroscience | The Guardian.

Again, I want to stay out of the design weeds. It’s requirements I care about and there are no compilers, no languages. The context is, in the design for a computer, any datatype using any data algorithm to increase the ability to store it for later retrieval. I’ve talked about only two designs, one for human data storage and one for computer data storage.

How about considering another context? Dog training for example. Dogs use association to remember things. That’s as much as I know. Do they connect the locations on a trail so that they are using a journey method as they sniff out their pegs? Are they aware of my daily routine so that as I get to a part in the story of my day, they know that food will come shortly? Are they using mnemonics and can we train them to do better? Help me here, Bjoern, you’re the polymath.

Actually, the way it’s done is that the list is programmed initially with little added functionality. Then the code to add functionality to insert an item is added. The way that it is done is by creating a new array, copying the old array up to the insertion point, adding the inserted item, and then copying the tail end of the old array onto the new array. Finally, you switch the references. It’s all built into the language usually. There’s no difference in the basic structure of a list and the array. It’s all about what you add to the basic structure. The basic structure has only a mechanism to store the next reference to follow when you traverse it. That’s why it’s a story.

And just like using traversable locations by a story, they can be reused as your peg list and now become a “memory palace.” In computer terms, all other types of data structures are based on the simple array. It’s in the unique behavior that is added that they become distinctly a different data structure.

Please don’t tell me you took an assembly language class when you were a teenager or plan to now. You have so many better opportunities to use your mind.

Doug

Well, both programming and mnemonic data structure have different concepts within the realm of computer science. Programming data structures are essential for organizing and manipulating data in software development, while mnemonic data structures serve as memory aids to aid in understanding complex computer science concepts.
Thanks

1 Like

Hi Doug,

What I’ve been doing is researching the history of visual symbols like brackets, exclamation points, quotation marks, etc. as they have a historical correspondence to programming.

Ex. The tree
The tree went from vertical direction in printing to horizontal direction in programming I.E. Nesting

As you might now, if you’re dealing with Object Oriented Programming each aspect must be thought out and implement, whether that be sequential or not.

Stefos

@Stefos, a very unique way of looking at the development of syntax! Watch out for APL!
Doug