Fixed-size | Indexed | Ordered | Unique | Keyed
Syntax and style vary across programming languages, but some things are consistent:
1. Bits and bytes – A Bit (1 or 0 – on or off, true or false), and a byte (being 8 bits)
2. For everything else, refer to 1
Boolean – true or false, ‘on’ or ‘off’ “yes” or “no” (can be represented as 1 or 0)
In Base 2, Numbers are ones and zeros; Base 10 Decimal, uses the familiar digits 0-9; Octal uses eight; And Hexadecimal has 16 (0-9 plus the first 6 letters of Latin script / the Roman alphabet). Base 64 uses 10 digits, every letter of the alphabet (uppercase and lowercase) plus uses the plus symbol (+), and forward slash (/) – with equals sign (=) for padding
Text, also represented with bits and bytes, with a letter (often) being one byte, but depending on choice of encoding, multiple bytes. A byte is a value between 0 and 255 (256 unique values). And ASCII letters (for example) use values between 0 and 127 (7 bits within a 8-bit byte) with upper-case ‘A’ being the value 65, and lower-case ‘a’ being the value 97
All the data in the world is stored (temporarily in memory or permanent on storage media) as Binary (Base 2), and yet communication between two (IT) systems would be meaningless without structure – delimiters (implicit or explicit), to mark where some thing finishes and the next thing begins
Simple data structures such as Arrays (including strings which are character arrays), Lists, Sets, and Maps describe how elements of the data is grouped together, but every programming language uses provides different ways to interact with the data and its elements –
An Array (Java, C, C++) is a fixed size (JavaScript makes an exception of this), and elements are indexed i.e. you access array entries by using their index (their position or ‘offset’ in the array)
In JavaScript you use Array, Set, and Map (there’s no List per-se – but an Array for all intent and purposes behaves like a List), and Set/Map (and Array) preserve the order of elements being added, which isn’t always most efficient
A List is order-ed – it can be created with an initial size (to optimize for performance, at least inserting entries into the List at the outset) and you can (also) access list entries by their position
In Java the ‘basic’ Set/Map is un-ordered (there is an order, but it’s determined by an internal algorithm – optimized for performance – and not predictable by the casual observer – and may change after an entry is added to the Set/Map). The order in which data is added, isn’t necessarily the order in which it’s handed back, when (for example) iterating over the entries in the Set/Map. If you want (need) to maintain order you use (choose) the not-basic Set/Map that’s implemented with an algorithm to meet your requirement/s (or implement your own algorithm)
Elements of a Set are unique (unique-ness is determined by the implementation of the set – in Java it’s based on the ‘equals’ method. And elements of a Map are addressed (accessed) with unique keys – if you insert a different element into a map with a key that’s been used before, the previous entry (‘indexed’ by that key) is overwritten – but let’s take this one step further:
For a Map, the set of unique keys is in fact a way to ‘index‘ your data elements – say you add ‘1’ to your map and add it with key “A”, you can get back ‘1’ by asking for the entry ‘indexed’ by “A”, except in any given (typical) program, you only get one set of indexes, and every entry in the map must be indexed. If you want another set of indexes, you have to use another map, or you have to implement your own Map i.e. algorithm – let’s put that to one side for a moment..
These simple data structures have common properties: their size is fixed, or not fixed; their elements may be (or may not be) accessed by index; iterating over their entries (or keys) is order-ly (or unorderly i.e. unpredictable to the casual observer), and their entries may be accessible via key
In most .oO(all?) programming languages you choose your implementation first – before you insert entries into the collection. If you want (need) to switch between ordered and un-ordered collections you have to code this yourself (you may find a one-liner online you can copy-and-paste).
So when you’re communicating between two (or more) systems, you have to choose the same implementation in both systems to get the desired behaviour – so that when you transmit your data over the network (or via storage) it can be received in the same (predictable) order at the other end
We don’t think you should have to go to the effort to pre-determine this predictability, or code-your-own. And we don’t think you should be restricted on how you access your data: which method or function you use on which system and which argument or parameter you pass
Auxillery Data Sets give you (e.g. Full Stack Software Developer) predictability and flexibility. Using common terminology (common API) across programming languages (for the languages in which we’ve written Auxillery). You don’t need to choose whether your data is an Array (fixed-size and ordered), List (ordered), Set (unique), or Map (unique keys). Auxillery gives you self-organizing self-optimizing data sets, and the ability to ‘specify’ the order in which you take action on the elements in the data set, just prior to processing, as opposed to when you add them to the data set in the first place
Auxillery Data Sets let you change their size at any time, change the order of elements returned for iterating over (adding an ordering preference after the elements were added), change what determines how the elements are unique, use more than one indexing method (position/offset or keyed) per data set, allow elements to be added with or without a key without, even allow elements to be added with a shared key
You determine whether your policy (requirement) has been violated! You can prevent an array size changing. You can add an index (or change an index) part-way through adding elements. You can decide what order you want/need as late as when you retrieve the entries of the data set e.g. at one point in your code you can ask for first-in-last-out, and at another point in your code you can ask for ordering based on a property of each element ordered (i.e. ‘sorted’) alphabetical a-z (i.e. ‘ascending’).
You can, but you don’t have to
0 Comments