Software languages allow people to create systems that can react to input and change the behavior of the systems. This is different from hardware that has fixed functions which cannot be changed after the system is built. Firmware is somewhere in between this, it can be updated but requires special hardware to change the code. Software languages can be changed and stored on a hard drive which make software programs easier to update.
This article provides a high level overview of software languages and the role they play in how computers work.
How Computer/Software Languages Work
Software languages are a key tool in modifying computer hardware so it can perform many different functions. As with everything else in the computer stack, software languages are based on mathematical principles and the manipulation of numbers. The use of software languages serves as a connection between the raw binary data stored in a computer and usability. The challenge lies in using mathematical and logic based languages to work with real world concepts in ways that are useful and understandable for humans.
Based on what I've observed of most software languages, they have several common elements. The elements are implemented in different methods, but once a person learns one language, it becomes easier to read other software languages. The common elements are
• Variables - Variables are used to read and write data contained in RAM. They can be named in order to make it easier to read the software code and debug it. A good naming convention can make a large difference in how readable the code. There is a large difference between a variable named 'A1' and one named 'AddressLine1' when reviewing code
• If/Then/Else statements - If/Then/Else statements are a key area where the software can make choices and perform different operations based on values stored in RAM or values read from I/O devices like a keyboard or mouse. The statement works by checking the 'If' part of the code to obtain a logical value of true or false. If the evaluation returns a true value the actions after the 'Then' portion of the statement is performed. If the evaluation returns a false, the actions in the 'Else' section are performed. If/Then/Else statements can be chained together so that the Else section immediately evaluates another value to see if it is true or false and execute the Then and Else sections appropriately. Large logical evaluations can occur by the use of other commands, the core evaluation is the if/then/else evaluation that is written in a way to make it more readable.
• Control Structures - A control structure is a section of code that will loop and repeat execution of a series of statements. The loop tracks values that are used to change the data evaluated but still using the same structure. An example of using a loop might be reading in names and addresses in a database and printing all of them out. While the values are different, the same steps of reading the data, formatting it and printing it can be performed with the same code.
• Ability to call segments of code contained in a subroutine/procedure/object/structure - Software languages have the capability to create separate blocks of code that can be used by many different software programs or multiple times within one program. With the example of reading and printing a list of names and addresses, there might be a procedure that reads in a name and address, and other procedures that format the data for screen display or printing depending on what the user chooses to do. These routines might be used in different parts of the software program, so there is a separate procedure that can be called by the main program. These procedures can be gathered up and stored in a software library and maintained by a 3rd party. By buying and using these libraries, developers can reduce some development time for their programs.
The use of libraries has become an important tool for software developers. Instead of having to reinvent procedures for handling common functions of reading data from input devices, error checking and other common functions, developers can used libraries that have been tested. Libraries can include functions for interacting with the operating system, interface with hardware, like the graphics card and manipulating the data for graphic display.
An example of a commonly used library is the DirectX library created and maintained by Microsoft. The library provides procedures that have the ability to interact with many different types of graphic cards. Microsoft develops and tests routines that can draw shapes on many different types of graphics cards. By using a common Application Programming Interface (API), a program can call the routines for drawing graphics and not have to change it if the graphics card is different. The library can read configuration settings and based on those the DirectX library can choose what graphics card it is accessing and change the drawing methods, as needed, so it will work on a system. This means that developers of games can use this library to draw game images on a Windows PC and not have to develop procedures that work with many different cards. This leads to a smaller set of software commands that is easier to maintain since it is using a common library.
Software languages are translated into machine language in order for the CPU to process the commands. This is done in two ways. In one method, the software is compiled and a translated version of the software, an executable is created. During the compile process, the software is checked for common coding errors per the language syntax. If errors or warnings are found, they are reported so a developer can review them and correct them. This process can be time consuming, especially for large software programs with many commands and libraries.
The other method of running software is the use of an interpreted language. AN interpreted language starts running immediately and does not check for errors. If an error is encountered, the software stops running at that point and an error is reported. This method can be faster in getting started but it may take longer to debug. The interpreter only reports on the current error and will stop again if another one is encountered during execution.
Both methods require translating the software language into machine language. The compiled software is converted directly into machine language, so the file is not human readable. For interpreted languages, the original software is executed, which means the software code can be read by human unless some type of obfuscation is used to reduce the readability of the code. This means that interpreted code can be easier to hack. However, compiled code can also be hacked, it just requires additional expertise to read and modify an executable file.
While software languages are based on mathematical concepts, that does not mean they are error free. Building code for error checking and security can be a large part of the process of developing software applications. It can be very simply to create a proof of concept demo application but one mis-keyed entry could easily crash the software. Or the software may not work on another machine because it is missing configuration files or libraries that it requires for execution. This means that many different skills can be required for developing even simple software programs.
The Impact of Computer/Software Languages
The basic structures of variables, if/then/else, loops and libraries are the foundation for building a software application. The challenge is the ability to use these structures in creative ways and emulate functions that occur in the real world. Working with a software language requires the ability to think logically, and transform numbers into other formats. Computer programming is a profession of transforming a set of electronic pulses into formats that are human usable.
The basic format for most software languages are based on the same principles of using variables, control structures and libraries to create software. This structure is based on mathematics and allows emulation of many real world scenarios on computers. With the use of input and output, a software program can react to input from a user or a device and execute a pre-programmed function in a reliable method.
However, bugs get introduced when multiple inputs are required. Each additional bit of information has the potential to cause a cascade of control structures that are required to process the input. This leads to more complex software structures that require more testing. Even with extensive testing, it is likely that some combination of input was missed and may cause the software to malfunction. The malfunction can be a software crash if the error handling is not robust enough. In the worst case, a software bug can provide a break in the software that allows a hacker access to other information they would not normally be able to access. When you hear of software hacking, it means that the error handling for the software was not complete and the hacker found a way around the normal operation of the software. When the software program is involved with remotely connecting to a computer or accessing the internet, this opens up a door for a hacker to access the system.
Writing solid error handling is a challenging task. I have found it amazing the multiple ways that people will use the same software and have different expectations of the operation. As a relatively simple example, think about opening up a file to edit it in some way. On Windows, files can be associated with a software program and opened if they are clicked on. The software program can be started and the option of Open File can be used. Or the file could be found in a recent history list and clicked on in the software.
The file might be located on a local drive, a USB drive, on another system on a local network or in a cloud storage location. All of these locations may look like they are on the computer but they all may use different methods of opening and reading a file for software. If the file is on a network drive or in cloud storage, a copy may not exist on the local drive and may need to be downloaded. Or there may be network problems which causes the file to be read slowly. For local drives, the software will ask the operating system to read the file and let the operating system decide on the best method of opening and reading the file for the software.
In each of these cases, the software program has to make a request to open a file and read the data from it. Depending on the file location, there may be delays or missing data which causes a glitch in the program. A glitch could cause problems with the software or possibly cause it to crash. With software like Word, it has the ability to add customizations to the software by adding small software functions in a file. This ability can increase the functionality of Microsoft Word. It can also allow malware or viruses to function and infect a computer.
While the basic structures of software languages are simple, they require a lot of work to write and maintain. The current model of software development encourages the use of libraries and the reuse of code in order to get software to market more quickly. While the use of libraries makes it easier to create software, they add another possible source of errors in the software program. As a software program grows, it continues to add complexity and new features. Over time, the new features or fixes may not be documented as changes occur. If the software needs to be rewritten, the lack of documentation can make it difficult to include everything. With changing technology such as new software languages and updated operating systems, it can become necessary to rewrite a software program. This can be difficult and can require reverse engineering the software in order to recreate all of the old functionality. In some cases, a decision might be made to not include an old function. This can lead to problems in reading old file formats or data if the old files are not upgraded into the new format.
If you've ever wondered why banks and governments still use old software, this is part of the reason why. They are using very complex software systems that have gradually grown to handle many special cases. Building new software requires rewriting the software for modern computers and languages while maintaining as much of the old functionality as possible. It will also require a lot of testing and there will still be bugs once the software is deployed. For systems that are used to handle millions of transactions and dollars, it can require a lot of effort to test all of the functions and verify they work correctly.
A result of this complexity is that software is very expensive to write and maintain. If you wonder why so many software applications are moving to a subscription model instead of a pay once model, this is why. The companies are expected to maintain the software and fix security issues but they did not have steady cash flow in the past. With subscriptions, the companies have a predictable flow of cash which makes it easier to plan for maintenance updates. Unfortunately, a side effect is that companies seem to be pressured to add in new 'features' or redo the user interface to meet expectations of 'getting something of value' with a subscription. So software receives constant updates in order to justify the subscription rates. As an example, in my opinion, The '97 version of MS Office was perfectly adequate for most office work. The changes that have occurred since then seem more concerned with changing the interface for a newer look while not adding much in new features that I'm interested in. There are new features that have been added to better support files stored in the cloud but those are refinements to functionality, in my opinion, not true new features.
I'd much rather see some experimentation with new ways of interacting with computers and performing tasks. I'm still waiting for my 3-d display Excel worksheets so I can see how my database table emulation looks after setup. I suspect that my interest in this feature is not something that most users would need or want so I suspect I will be waiting a long time for this feature. To create truly innovative software which maximizes the functionality of the hardware and software would require large budgets and might not return much of the investment for many years. With the current focus on short term return on investment, I do not expect to see changes in software releases anytime soon. Although I have been encouraged to read of a project that is developing robots to pick crops like strawberries without the need for human intervention. The project has already spent many millions for a prototype and taken years to develop. The good news is that the company is committed to long term progress and is preparing for the next phase of the project which is deployment of these systems. In my opinion, this project is an innovative use of software and hardware that will help to reduce the need for drudgery type of work.
There is more I could write about the impact of software languages but I think I will keep this article relatively short for right now. The next article will be about Operating Systems with a high level view of what they do and the impact they have on computing. I am almost done with the series I had planned and I have learned a lot as I've written about the different aspects of computing. I find myself amazed that they work as well as they do.
Pictures by J.T. Harpster. Selected prints of his photos can be purchased at our Redbubble shop
Help support us on our Patreon page. Subscribers can gain access to our newsletter and a new short story each month.
- Log in to post comments