Robert Ciesla
HELSINKI, Finland
ISBN 978-1-4842-7285-5 e-ISBN 978-1-4842-7286-2
https://doi.org/10.1007/978-1-4842-7286-2
Robert Ciesla 2021
This work is subject to copyright. All rights are solely and exclusively licensed by the Publisher, whether the whole or part of the material is concerned, specifically the rights of translation, reprinting, reuse of illustrations, recitation, broadcasting, reproduction on microfilms or in any other physical way, and transmission or information storage and retrieval, electronic adaptation, computer software, or by similar or dissimilar methodology now known or hereafter developed.
The use of general descriptive names, registered names, trademarks, service marks, etc. in this publication does not imply, even in the absence of a specific statement, that such names are exempt from the relevant protective laws and regulations and therefore free for general use.
The publisher, the authors and the editors are safe to assume that the advice and information in this book are believed to be true and accurate at the date of publication. Neither the publisher nor the authors or the editors give a warranty, expressed or implied, with respect to the material contained herein or for any errors or omissions that may have been made. The publisher remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.
This Apress imprint is published by the registered company APress Media, LLC part of Springer Nature.
The registered company address is: 1 New York Plaza, New York, NY 10004, U.S.A.
The Author(s), under exclusive license to APress Media, LLC, part of Springer Nature 2021
R. Ciesla Programming Basics https://doi.org/10.1007/978-1-4842-7286-2_1
1. Wet Toes: The Very Basics of Programming
What do video games, social networks, and your activity bracelet have in common? They run on software a group of (more or less) programmers wrote somewhere far, far away. Gadgets and hardware are only one, more visible side of the coin of our technology-driven societies. In this chapter, well discuss the very basics of programming. Well also take a gander at the visible parts of digital systems: the hardware.
What Is Programming Anyway?
Basically, programming is the act of telling digital devices, such as your personal computer, what to do. We type in listings of commands, as defined by a programming language, in order to have useful or entertaining events occur. Properly programmed computers run much of the communications and online services in the world. You can mention things like ATMs, ticket readers, and smart phones as gadgets that run on software that somebody created in some programming language.
Basic Hardware Rundown
As a budding programmer, youll benefit from understanding the kind of universally found electronics youre working with. Its a good idea to have at least a basic understanding of the most commonly found components inside a computer.
These hardware components in a computer represent your work force. As a programmer, you run this show. Think of the act of programming as telling the factory workers what to build. You manufacture applications, whether they be big, complicated software projects or tutorials from some awesome book on coding.
For the purposes of this book, any relatively modern desktop or laptop computer works fine. We wont be needing any expensive hardware while getting our feet wet in programming.
1. Central Processing Unit (CPU)
Naturally, a digital device cant run on software alone; a
central processing unit (CPU) is the hardware brain which executes code and makes things actually happen (see Figure ). Even in a less complicated piece of electronics, all instructions flow toward and through a CPU (or a bunch of them). Being very small in size, these microchips have increasingly been a part of our lives since the 1970s. Every digital device has a CPU in it, probably even your stationary bicycle/clothes rack.
Figure 1-1
A top-down view of an older Intel Pentium 4 CPU used in millions of PCs back in 2005. Image by Eric Gaba. CC BY-SA 3.0
2. Hard Drives (a.k.a. Hard Disks)
This component is there to store data just about permanently. Within a hard drive , youll find tens of thousands of files, whether they be pictures, text files, or databases. Your operating system (e.g., Windows or macOS), too, rests within the confines of a hard drive. These devices come in two varieties:
mechanical hard drives (see Figure ) and
solid state disks (SSDs).Figure 1-2
A top-down view of a Western Digital mechanical hard drive. Image by Darkone. Licensed under CC BY-SA 2.5 ( creativecommons.org/licenses/by-sa/2.5/deed.en )
Mechanical drives are more affordable, but since they have moving parts inside, they are somewhat more easily damaged than SSDs by excessive vibration and extreme weather. In addition, solid state disks usually operate much faster.
3. Video Card
Video cards are responsible for displaying a systems visuals, whether they be plain text or dazzling 3D graphics in a modern video game. These devices come in a variety of configurations and prices, ranging from $30 word processor fiends to $1000 gaming monsters (see Figure ). Computer monitors are typically connected directly to a video card.
Figure 1-3
An Nvidia 7900GS video card from 2006
The video card business has basically been a duopoly between