public void BackInTheDay()
// A Brief History of Computer Programming, and a Look at One Place to Get Started
When I was a kid, personal computers were new, exciting, and very, well, BASIC. Since earlier computers were designed by and for businesses and governments, it seemed logical that the thing to do with a computer was learn how to program that computer.
Try opening the emulator by clicking the image above, and typing in the following (note: on my keyboard I have to press Shift+2 to get quotes. I can’t remember if this was the placement on the old Commodore or not):
- 10 PRINT “HELLO WORLD!”
We had GOTO statement loops, IF/THEN conditionals, and I remember having a lot of fun creating different screen art and quiz-games with just text. Since there weren’t a lot of possibilities, there also wasn’t a ton of We’re not going to dive into ancient BASIC here, but if you’re interested, check out https://en.wikibooks.org/wiki/BASIC_Programming.
Coming back to programming as an adult, I was overwhelmed by the complexity of modern code. I bought books, watched videos, and googled for hours on end to try to make sense out of how to create an app or website.
While this approach definitely does work, there were many frustrating days of confusion. For example, to get started writing a new iOS app in Swift (which seemed like a nice, easy language), I had to learn about Storyboards, ViewControllers, Views, Delegates, and so on. Even a simple “Hello World” app would require multiple files.
Most of this complexity and confusion to getting started comes from the User Interface (UI), which has grown from the all-caps text on the Commodore into a graphical canvas with nearly limitless possibilities. There are wonderful WYSIWYG tools available, such as the Xcode Storyboard, which allows you to drag and drop controls like labels, buttons, and text fields.
Behind the scenes, however, the layout code is in the XML format, and it’s not so easy…
Can just about anyone make a new app? Definitely. However, I can attest to the fact that jumping in head-first this way can get you in trouble later. Using a tool like Storyboard does not prevent problems/errors, but it does limit your understanding of them and how to fix them. I’m not suggesting an app developer should ignore the tool, simply that they truly understand what they are doing. After several years of tinkering, I can read that XML, and it makes it much easier to know what is really going on in my UI.
Apart from the complexity, UI design actually has little or no bearing on the functionality of a program. Instead it is about display and ease of use. Separate from this is the Business Logic, which is where we use math, perform functions, and react to user actions and inputs. This was the heart of BASIC and early computer programs, before they got pretty graphics.
Wouldn’t it be nice if there were a way to separate the UI design from the Business Logic, so newcomers could first learn how a computer calculates, responds, processes?
Luckily, there is a way to write in modern programming languages with no UI to worry about. A Command Line Interface (CLI) takes us back to the old-school method of typing text to execute commands. These commands are executed by a shell program, that runs atop the operating system, and are accessed on most modern machines via a terminal emulator (Terminal in MacOS and Linux, Command Prompt in Windows).
Before doing any command-line programming, however, it’s necessary to at least know your way around the interface. Both Linux and MacOS use the BASH shell by default, and so they use the same set of keyword commands. The Windows Command Prompt, however, inherits from MSDOS, and has slightly different syntax.
(BTW, Windows 10 users can now also use Bash, so if you want one cross-platform solution, start there)
|Commands||Bash Terminal||Windows Command Prompt||Comments|
| Change Directory
|cd||cd||You can go one folder “deeper” by typing just the folder name (e.g.,
|List Files in Current Directory||ls||dir||Lists all the files and folders in your current directory.|
|Make Directory||mkdir||mkdir||Creates a new folder at your current location.
|Remove Directory||rmdir||rmdir||Deletes a folder.|
|Copy File||cp||copy||Follow the command with the file name to be copied and the new file name. You can include paths.|