Computers: Software

    Computers: Software

      Harry Potter and software have a lot of things in common. We aren't talking about Pottermore or even Potter Puppet Pals when we say that—even though they're both solid uses of Potter-themed technology.

      Nope, even if you go into the books themselves, you'll find spells like

      • Ascendio, which lifts the spellcaster into the air.
      • Confundo, which confuses the victim.
      • Specialis Revelio, which makes an object reveal its magical properties.
      • Protego Horribilis, which gives you a shield against dark magic.

      Just like spells, which the witch or wizard uses to tell magic what to do, software is just a set of instructions that tells a computer to do some particular task. If you hear someone talk about programs, code, or applications (which is where the term "app" comes from, BTW), they're actually talking about computer software. Should we spell it out more?

      Computer hardware can’t do anything except sit there and look pretty (assuming it's a nice color, of course) without computer software. Each piece of software takes your computer hardware and uses it to perform a specific task. That set of instructions ends up generating something useful to people or businesses like computer-based Harry Potter content. If you give the computer good software, chances are good that it'll be able to do a job quicker than a person could. Still, it takes time to write a program.

      It’s even more valuable when that job is so difficult and complex that it’s easier for people to write a program than to do it manually themselves. All of these things fall under the vague, amorphous term, "software."

      • Operating systems like Microsoft Windows or Mac OSX
      • Compilers, which change the instructions from programming languages into code that the machine can understand (cleverly called machine code)
      • Games anywhere from Pong to Mortal Kombat
      • Social networking apps like Instagram, Snapchat, and Facebook
      • Word processors like Microsoft Word
      • Web browsers like Chrome and Firefox

      All these pieces of software are designed to make your life easier. Besides the things that you interact with directly, the computer also has software that operates in the background and helps the computer run in general. They may not be as fun as Pong, but they still get the job done.

      Device Drivers and Interrupt Handlers

      For every single piece of hardware you can use as input or output in the computer, there's a device driver that takes care of all the communication between the computer and the device. Until the driver tells the computer all the characteristics of its device, the computer won't know how to communicate with it. You can think of this software as a Babel fish for computers: it translates between the different machines so that everyone can talk.

      And then there's the interrupt handlers, which communicate between the operating system and the hardware components. Whenever a piece of hardware takes in a request from the user (maybe to print something, or to turn the volume key up to 11), an interrupt handler needs head over to the Central Processing Unit (called "CPU" by its close friends) to put whatever it's doing on hold for a sec so that it can handle that I/O device request. The CPU can only handle one thing at a time, so you need that device handler to tell the CPU to focus on your needs for a second before taking out the trash or drawing a picture to the monitor.

      For example, when you press a key on the keyboard, the keyboard interrupt handler tells the CPU that you want to do something and then sends the message, command, or text from the keyboard to the operating system so that it can respond like a good computer.

      Programs in General

      Say your friend got the latest Wizard Rock CD by Harry and the Potters and invited you over to listen to it. You excitedly grab a couple of boxes of Bertie Bott's Every Flavored Beans and your red and gold scarf to get your Wrock on. When you get into the car, you look at your friend's directions to their house.

      1. Go North on I-75
      2. Take the University Drive exit
      3. Turn right at the end of the exit ramp
      4. Drive one mile and then turn left into the driveway of the blue house

      Let's pretend you live near the I-75 (which means you're somewhere along a slightly-tilted line from Florida to Michigan). That set of instructions is going to be perfect for getting you to your friend's house for a wrock-out session. Sure, your friend left out the details of getting to I-75, but you have enough supplementary information (read: Google Maps) to get there.

      If you're a computer, though? You'll need a little more information about where, exactly, that highway is in the first place and how far away the University Drive exit is. Computers need every single detail of instruction from tying their shoes to ringing your friend's doorbell. (If they had shoes, of course.) They don't have any way of knowing if your friend left any part of an instruction out. If your friend miscalculated the distance as one mile from the exit even though it was actually .9 miles, the computer can't think to piece that fact together. It's just going to keep driving infinitely.

      Or at least until the car breaks down.

      Computers can only run exactly what they're given by the software. Nothing more, nothing less. On top of that, though, software programs are written to run on specific operating systems. If your software comes from a big company that can afford it, that software might be able to run on multiple operating systems—and also multiple versions of the same operating system to round things out. That takes a lot of engineers a lot of time to do, though, which is why some programs only run on one particular system.

      That program you're using could be a calculator or a video editor. Whatever it is, you're using the same exact hardware. That fact might not sound too impressive now, but back in the day (around 1936, by most estimates), it was a pretty novel idea when invented by Alan Turing. Before that, hardware was pretty much exclusively built to perform one—and only one—function. Now computer parts have so much more flexibility to them.

      Even though you have to interact with computers every day, you don't necessarily need to know how to program to do it. That's all thank to software applications (apps), which cover up all the hard, technical bits so that you can focus on the thing you need to do. You can thank a software engineer for that one.

      Or maybe a software wizard.