For example, an “Integer” data type may only hold whole numbers or integers, whereas a “Character” data type can only hold a single letter, number, or symbol. The different kinds of data types vary from language to language, however, the primitive data types are virtually universal. They include “int”, “char”, “double”, “boolean”, “byte”, and some others. Abstract data types (ADTs), on the other hand, are much more complex and therefore may vary from language to language, with some high-level languages not even having them at all.
Luckily, it is possible to implement ADTs in languages that don’t automatically have them, as it is possible to code them using object-oriented programming, other ADTs already implemented in the language, and primitive data types. Today, I won’t be focusing too heavily on the actual coding of the ADTs as it is different from language to language, rather I’ll be focusing on the uses of each and their strengths and weaknesses. The most common ADTs are the Stack, the Map, the List, and the Queue.
The first ADT I’ll be going over is the list. The list ADT is probably the most simple to understand, as nearly everyone has used a list in real life. Essentially, a list ADT is a structure that holds a group of items together and these items can either be sorted based on some criteria or unsorted.
You can retrieve an element from a list or put an element into a list from any position within the list. Unlike a stack or a queue, there are no rules saying that only the first or last element of the list may be manipulated. Lists are great for grouping similar information together that does not need to be stored in any particular order.
The second ADT is the stack. A stack is like a list, except there are more restrictions regarding how elements may be put into or removed from the stack. The stack follows the last in first out (LIFO) criteria. This means that whatever was most recently put into the stack must be the first thing that comes out from the stack.
Stacks are very useful for compilers and for undo/redo components of a program. When undoing or redoing, you have to get back to the most recent state. So, a software program may utilize a Stack ADT in order to store the history of a project, as it is easy to access the most recent iteration through a stack.
The queue is the next ADT I’ll be touching upon. In many ways, a queue is a compliment to the stack. Instead of it being last in first out like a stack, a queue follows the idea of first in first out (FIFO). A queue is easy to understand, as it represents a line at a supermarket or to get on an amusement ride. The element that has been waiting the longest is the next to leave the queue.
Queues are extremely useful for handling the many processes of an operating system. Say, you click on a desktop shortcut to run a game, then click on another shortcut to your Internet browser. These separate processes will be put into a queue by the OS, so that the game opens up prior to your browser. Third party program may need processes completed in a very specific order as well, so that the software may boot up properly. So, the first task is loaded into the queue first so that it gets completed first, then the second, etc.
The penultimate ADT is the map. A map is unique compared to the other ADTs explained thus far, as there are actually two components to a list: the key and the value. The value is the actual data that you want to access, whereas the key is what is used to retrieve the value. In a way, you can think of the value as being “locked” behind the key. Without knowledge of the key, the value cannot be known. It is also important to note that a key can only be associated with one value, meaning that one key cannot access multiple values.
Map ADTs are very useful when implementing hashing functions. Hash codes can be used to encrypt information, though they are not always perfect. The “value” element would hold the encrypted information and the key would be used to “unlock” the unencrypted information.
Abstract data types are much more complicated than primitive data types, meaning programmers can accomplish more with them but they can be more difficult to understand. Without ADTs, many major computer programs would not be able to function as efficiently or as securely, as they provide ways for information to be stored and retrieved with certain specific criteria. Efficiency is an extremely important property of modern computers and disregarding ADTs can lead to a loss of efficiency, causing certain programs to fall short of others. Therefore, when creating complex software programs that may deal with lots of information, it may be best to look at ADTs.
Programming Languages and Resources for Web Developers
Discussed coding languages are well suited for those interested in pursuing a career in web design and development; however, other options are mobile App design and development, system admin and software engineering. It is advisable to consult with an IT counselor to understand what options best fits your skills. For instance, if you want to be a software engineer, learning HTML and CSS might not fit the bill. Here is an excellent article for learning more on coding and technology career roadmap. Once you know what career path you wish to pursue, you can make a plan on what, when, and how to learn. There are lots of online resources for learning coding and technology in general. For teenagers and high school students, High School Technology Services offers variety of hands-on training. For adults and professionals, Coding Bootcamps and DC Web Makers Companies offer basic to advance project-based programming and technology classes.