Thursday, January 8, 2026

HCW - 3.02 - coding - two things

We have covered how to build computer circuits in order to perform certain functions.  That's the hardware side.  But you are well aware that in order to make computers do certain things you have to run software.  There is software to run the hardware, and there is software to make the computers do certain things.  The software that runs the hardware is known as the operating system.  The software to make the computer do specific things for you is generally known as programs, or sometimes apps.  So, how do we make programs or apps?

Computer programs do two things.  Now that is going to sound very strange, since computer programs do all kinds of things.  There are all kinds of computer programs.  There are office productivity programs, there are programs to make use of information and functions on the Internet, there are programs to allow us to make phone calls, there are huge numbers of programs that provide you with games.  There are all kinds of programs.  How is it possible to say that computers do only two things?

Well, by and large, all of these different programs can be divided into two categories.  One category of programs involves calculation.  The other type of programs do various forms of database management.  (Well, there is one other type of program, and that is a weird hybrid mix of both calculation and database management, and that has to do with data communications.  But we'll talk about that later, and, in fact, one of the sections or chapters of this course has to do with data communications.  But let's talk about the two basic types first.)

In the set of programs that have to do with arithmetic calculations, probably the first and most obvious class involves programs that present you with a calculator.  You probably have a calculator on your phone, you probably have a calculator buried somewhere on your computer, or iPad, or tablet.  Even if you don't use it very much.

The other category of calculation programs that you might think of would be spreadsheets.  Now, of course, spreadsheets do have a lot of involvement with calculations.  You want spreadsheets, or accounting programs, to add up columns of numbers, in order to get you a total of how much you spent on a certain category of thing.  But, actually, most of what goes on in a spreadsheet really belongs within the domain of database management.  It's relatively seldom that you actually get the spreadsheet to add up a column, or multiply the rent by the twelve months in a year, or some other actual arithmetic calculation.  Most of the time you are asking the spreadsheet to store the data that you enter into it as you spend money on certain things.  So, once again, it's a bit of a hybrid, but it mostly belongs in the database management area.  As a matter of fact, most people only use spreadsheets for database management.  Most people don't use database programs to store their information.  I regularly get a spreadsheet from an organization in town, and there is absolutely nothing on that spreadsheet that can be added up or multiplied.  They use the spreadsheet to keep their contact and phone list for the organization.  An awful lot of people do the same thing.

Then there's a field that you probably don't think has to do with calculations: artificial intelligence.  When I say artificial intelligence, these days, you are probably thinking of the generative artificial intelligence that relates to large language models.  Since most people see generative artificial intelligence in terms of chatbots, and therefore text and words, you may be surprised to learn that what is going on in the large language models is the building of an extremely complicated statistical model.  In other words, it's all calculations.  It's all about the calculations, in terms of probabilities of one word following another word, that goes into the building of a large language model.  And when we want to use the large language model to generate a response in a chat bot, once again there's an awful lot of calculation that goes into the probabilities that place one word after another in terms of the probabilities that one word will follow another in normal conversational text.  When you are interacting with the chatbot, you think it's all about words and meaning.  It's not.  The chatbot doesn't understand anything.  It doesn't know what the words it is putting in place actually mean.  It is only using they complicated statistical model to do the calculation about what word should come next.

But there's another factor when we talk about artificial intelligence.  Artificial intelligence, despite the fact that everybody thinks about large language models these days, isn't actually a thing, in terms of a single thing.  Artificial intelligence is a collection of different types of approaches, and another of those approaches also does a sort of calculation.  This is the field of expert systems.  Expert systems are a much older field of artificial intelligence than the recent large language models.  Expert systems don't actually use calculations as much as logic.  It uses logic in a way that is similar to the way we used logic to build electronic circuitry to form the hardware of our computer.  So, expert systems probably belong in this category of calculation, since logic is a form of calculation.

But we will also see that there are additional forms of artificial intelligence that belong in the database management category.

This also happens with regard to graphics.  There is one type of graphics, called vector graphics, where how to display a graphic depends on giving the computer instructions about what the picture is to look like.  These instructions tend to have to do with where you start, what direction you head, how far you go, or making a circle, starting with the center point, and creating a circle of a specific diameter.  All of these have to do with mathematical calculations.  So anything to do with vector graphics has to do with calculations.  We will talk a little bit later about the other type of graphics.

Most of the graphics that you see on web browsers, other than specific individual photographs, gets generated by vector graphics.  So web browsers fall into this category of programs that deal with calculations.  It's not just lines and circles that get calculated: it's also how do you arrange text on the screen so that it can all be seen and doesn't disappear behind something else.

But, once again, web browsers are one of those programs that fall into both camps.  And we'll deal with that a little later on as well.

In terms of programs that manage databases, pretty much everything else goes into that category.  The very first really formal course that I ever took in computer science was on database management, and from that day to this, it has provided me with an structure that has allowed me to effectively understand and diagnose problems (and provide solutions for) an astounding range of computer programs and systems.  For anyone going in to any field of information technology I recommend that database management be one of the courses that you take, and the sooner the better.  A word processor is a kind of a database.  We have text, and you can think about it just as a string of text, but we also have non-text things that we have to deal with.  Are there commands embedded in the text that tell us to do something with the formatting?  Is there a command to change the size of the font?  Is there a command to change the size of a page?  We have to understand these things, and the database as to what those commands are giving instructions to the computer in terms of how you display the text that goes into the file.  Even just the fact that there is a file, and that different documents are stored in different files, has to do with database management.  It may seem strange to think of a document as being managed in a database when the document itself is only one entry, but understanding it as a database helps you to understand how it works.  And that is, after all, what we are doing here: telling you how computers actually work.

We mentioned spreadsheets, and the fact that doing calculations is really only a minor part of what people use them for.  As I suggested in the example of the phone list, most people, when setting up a database, actually use a spreadsheet to create that database.  So, once again, here is an example of a program that will operate in both realms, and understanding whether you are doing calculations, or whether you are just organizing data, helps a lot in understanding what the computer is doing and how.

I mentioned that artificial intelligence comes in a variety of forms.  As mentioned, some of those fields of artificial intelligence do a lot of calculations, but some use approaches that deal primarily with text, and at least partially with actual meaning.  There is an extremely old, and actually really quite simple, program called either ELIZA or doctor.  It was intended as an approach to try and get computers to understand how people talk, and to operate as a kind of a psychological therapist.  It uses a specific psychological approach which really just reflects back, to the patient, issues that they raise as problems in their lives, in order to get the patient to clarify what the problem is, and, in large measure, to get them to solve their own problems.  It did this simply by identifying which parts of speech were structural, and which parts were meaningful.  It didn't have to understand the actual meaning of the words that were meaningful, just identifying them, taking them out of a sentence that the patient typed into the computer, and then reflecting it back to the patient as an appropriate question.  For example, if the patient complained about problems with their family, the computer would type back a question such as tell me more about your family.  As I say, this program is very old, and extremely simplistic in terms of the programming involved, but was extremely effective.  A lot of people felt that this very simple program was in fact a kind of person: they tended to identify the program as having a personality, and some became quite fond of it.

I promised to talk about the other form of graphics.  This is called raster graphics, and it is the way that photographs, if taken with an electronic camera, are stored.  The term raster graphics refers to the fact that they are simply stored as a map of dots.  The graphics file stores the information, and then, when needed, the file is called up and presented as a pattern of dots on the screen. Therefore, this basically just refers to a database of the files of the pictures.

Of course Web browsers use an awful lot of photographs as well, and so they use the same type of database management in terms of calling up images.  Not only that, but we can consider the entire World Wide Web as an enormous database.  We are using the links, and search engines, to find the information we want, in a database that spans the entire globe.  So, once again, Web browsers sometimes use calculations to create certain of their graphical outlines, but also used database management in order to get the information that they need.

And, of course, when we are dealing with social media, all social media platforms, regardless of how they supposedly differ; whether they handle text, or audio podcasts, or videos of movies, or short form videos, or supposed chat between the different users of the social media platform; are all databases.  They are databases with slightly different types of information stored, and different ways to store, and to access, the records that are stored on the social media platform.

And, as promised, data communications.  As I noted, data communications is a hybrid.  There are a lot of calculations that go on with regard to things like timing of the signals that are sent, and the analysis of the signals, and modulating data into signals, and demodulating the signals back into information.

But the enormous number of protocols that are involved in getting computers of different types to talk to each other, and effectively present information that one person has created on one side of the world, and another person is reading on the far side of the globe, mean that there are enormous databases of how these protocols work.  But the details of that we will get to later when we cover data communications as a subject in and of itself.


No comments:

Post a Comment