General Coding/Programming Terms Flashcards

(184 cards)

1
Q

abstraction

A

An abstraction groups things together, allowing you to think of the group as one easier-to-remember thing instead of trying to reason about all the elements separately. Programmers use abstraction to make decisions and reason about code without getting overwhelmed by details and complexity.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

action

A

An action connects a method in source code and a control in Interface Builder, enabling the code to run when a user interacts with the app’s controls. For example, a certain method may be associated with a button tap or a switch update.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

alert

A

Apps display alerts to present important information that requires immediate action. An alert interrupts the user’s interaction with the user interface of an app by appearing over it. An alert may simply have one OK button, or it may have several buttons with different actions. Tapping any of its buttons dismisses the alert, allowing the user to continue using the app.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

algorithm

A

An algorithm is a series of steps that performs a task. An algorithm can be a simple pattern of steps you can do in your head, like an algorithm for deciding where to meet friends for lunch; or it can be a more complex series of steps that requires a lot of math, like an algorithm to calculate the pitch of a sound wave.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Analytics

A

Analytics, sometimes referred to as data analytics, is the discovery, interpretation, and communication of meaningful patterns in data. As individuals use the internet and the apps on their mobile devices, they leave behind trails of data that companies can use for analytics to understand patterns in user behavior.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

application programming interface (API)

A

An API contains code that performs a specific set of tasks and provides a way for developers to use it. For example, a developer might write a lot of complex code that processes sound data. Instead of copying and pasting all those steps throughout their code wherever they need to use it, they write functions that will cause that complex code to run. These functions provide an interface to the sound processing code. Most developers only use the initials API to refer to such an interface, and may be surprised if you use the full phrase application programming interface.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

argument

A

You use an argument to give an input value or values to a function. Informally, developers often use the word “argument” interchangeably with “parameter,” but officially the term argument references a function’s inputs from a perspective outside the function. For example, if a function like drawLine(from: startPoint, to: endPoint) is called, the arguments are startPoint and endPoint.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

argument label

A

An argument label introduces the argument passed into the function, just like you might write your name (“Maya”) next to a name label (“Name”) on a form. If a function is declared as func drawLine(from fromPoint: Point, to toPoint: Point), the words from and to are argument labels because they’ll label the argument values when the function is called, as in drawLine(from: startPoint, to: endPoint).

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

array

A

You use an array to hold a list of items of the same type, keeping them in order. Items in an array don’t have to be unique; [“duck”, “duck”, “goose”] is a valid array that holds three elements.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

asset catalog

A

The asset catalog in Xcode is the best place to keep all the images used in your app. Its file extension is .xcassets, and you can access it from the Project navigator.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

assign, assignment

A

You use assignment to give a variable a value, whether when first declaring a variable or when updating its value.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

Attributes Inspector

A

You use the Attributes Inspector to find out and update information about a selected object in a storyboard. For example, if you select an image view in your storyboard, the Attributes Inspector shows options to set its image, to change the way it stretches or scales to fill its space, and to change its opacity. The Attributes Inspector is one of several inspectors on the right side of Xcode’s user interface.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

audience

A

In the context of app design, an audience is the set of users for whom the app is being created. For example, Xcode’s audience is app developers.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

autocompletion

A

In addition to knowing the names of Swift library functions and common statements, Xcode tracks all the names you’ve defined. As you begin typing in your code, Xcode analyzes the characters, finds names that match, and displays a list suggestions in an autocompletion menu. Autocompletion makes it quicker to enter long identifiers and reduces potential errors from typos.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

bias

A

Bias occurs when people favor one thing or idea above another. Everybody has biases, and they can often be harmful to individuals or groups of people. It’s important to be aware of biases you might have, especially when you create an app. You might embed your bias into the app’s design or into its code, which could cause it to behave in a way that unintentionally harms other people.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

binary

A

Binary is the system of writing numbers using only two digits, in contrast to the decimal system, which uses the digits 0 through 9—the way people normally represent numbers. For example, the number 12 in decimal is represented as 1100 in binary.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
17
Q

binary search

A

Binary search is an efficient algorithm to find a value in a sorted list. The approach works by successively splitting finding the middle element and comparing the sought value to the middle element. If the value is greater, the first half of the list can be eliminated; if the value is less, the second half can be eliminated. If the value is equal to the middle element, the algorithm has found the value in the list. As opposed to linear search, binary search is more efficient because it doesn’t evaluate every item in the list—only those required to successively cut down the possibilities by half.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
18
Q

bit

A

A bit is the most basic element of digital data. Bits are represented in a computer using the values 0 and 1. By combining bits into groups and stringing them together, computers can represent any concept—from numbers to text to more complex data like video.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
19
Q

block

A

A block of code is a group of instruction steps.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
20
Q

body

A

A body is a very general term for lines of code that are grouped together in a pair of braces ({}). Swift code uses braces to separate many different kinds of code, so a body of code can be used for many different things. A body can hold the list of steps to run when an if statement’s conditional statement is true or when an enum case matches. A loop’s body holds all the steps to be performed for each item in the collection. A function body holds the instructions for the function’s implementation. A body of code is sometimes called a block.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
21
Q

Boolean

A

A Boolean type has only two possible values: true and false. Booleans are named after George Boole, a 19th century mathematician who realized how important it is to ask clear questions with simple answers. In Swift, the Boolean type is called Bool.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
22
Q

bug

A

A bug is a software problem. The problem can be code that doesn’t work the way you expect or a user interface element that causes users to make mistakes in the app.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
23
Q

build

A

To build your project, you tell Xcode to assemble all the parts of your code into an app. If any of the code doesn’t follow Swift’s rules, the project will fail to build until all the code errors are fixed. When used as a noun, build refers to the assembled version of the project constructed by Xcode. When someone asks for a new build of your app, they’re asking for a new version of your project constructed by Xcode out of the latest code files, media resources (such as images), and configuration files (such as plists).

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
24
Q

bundle identifier, bundle ID

A

A bundle identifier or bundle ID is a string that uniquely identifies your app among all other apps in the world. Xcode automatically generates this value based on the product name and the organization identifier that you enter when you first create a new app. You can use these initial default values to build and run your app locally, but check out the App Distribution Guide Links to an external site. for advice on choosing final values to upload your app to the App Store.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
25
byte
A byte is a group of eight bits which has 256 possible values. Many computing terms that relate to measurement of data use bytes as their units. For example, a typical iPhone might have 1 gigabyte (one billion bytes) of RAM and 128 gigabytes of storage.
26
computed property
If you'd like to access data about an instance that depends only on the instance's current state, you can create a computed property instead of writing a function to retrieve the data. For example, if a BikeRoute type has a distanceInMeters property, you might add a distanceInKilometers computed property that returns the distanceInMeters divided by 1000. You access computed properties and stored properties in the same way. By creating distanceInKilometers as a computed property instead of a stored property, you avoid storing redundant information in your BikeRoute instances—and creating all the extra code in BikeRoute that would have to keep up with both representations of distance.
27
call a function
When you call a function, you type the function's name to make the program run the steps contained in the function's implementation. To call a function with means to use a function's name with particular arguments; for example, to describe the code greet(name: "Leslie", from: "New York") in English words, you could say "Call the greet function with Leslie and New York." To call a function on or call a method on means to call a method that's associated with a particular instance; for example, to describe the code trackTimer.reset() in English words, you could say "Call the reset method on the track timer." A caller is code that uses a function.
28
callback
The term callback is a general description for how program code can be called from outside the program—for instance, a function declared in your code that you never call yourself. Callbacks are necessary to respond to events such as the user touches and swipes in an app.
29
camel case
Identifiers in code often consist of multiple words, but they must not include any spaces. To make it easier to read these identifiers, programmers use capital letters to indicate the beginnings of new words. This pattern is called camel case because the tall capital letters in the middle of the name look a bit like the humps of a camel.
30
case
In an enum, the case keyword declares a name for one of the enum's options. In a switch, the case keyword introduces a pattern to try to match a value against.
31
cell
A cell in a table view displays a single item from the data collection. For example, if a table view is displaying a movie schedule, one cell might show a thumbnail image of the movie poster, the movie title, the average viewer rating, and its next available date and time.
32
certificate authority (CA)
Public-key encryption relies on certificate authorities to establish a chain of trust so that users can verify the owner of a public key. A certificate authority verifies the identity of a company or other entity and provides a signed certificate that's both unique and impossible to fake.
33
CGFloat
Like a Double, a CGFloat is a type of number that can have a decimal point, such as 3.5, 7.0, or -5.5. While both Doubles and CGFloats are decimal numbers, they aren't implemented in exactly the same way, and some types (like UIColor) will only interact with CGFloat numbers.
34
character
A character is a single letter, number, punctuation mark, symbol, or blank space (including newlines, tabs, and other kinds of spaces). Writing systems around the world use vastly different characters, which makes it hard to define what it means for one string to be "longer" than another just by counting characters.
35
Children's Online Privacy Protection Act (COPPA)
The Children's Online Privacy Protection Act was passed into law in the United States in 1998 and took effect on April 21, 2000. It applies to the collection and use of data from children under age 13 and children with disabilities. Among other things, the law governs how and when entities must obtain parental consent before asking children for any data.
36
citation
When you use the work of somebody else, you typically cite it under the terms of its copyright. Most citations include the original author and the terms of use and reuse. Though you might be familiar with citing sources when you write a research paper, you should also be sure cite code you use from somebody else if they require it.
37
code, coding
Code consists of commands that tell a computer what to do. Coding—also known as programming—is the act of writing code.
38
code segment
A code segment is a set of adjacent lines that can contain any type of code, but are understood not to contain a complete program.
39
comment
Programmers leave notes called comments right in the code to explain what's going on. This helps people (including the original programmer) understand the code when they read it later. Comments are ignored by the playground or app, so they won't affect how the code is run.
40
comment back in
When a line of code is preceded by two slashes (//), it's part of a comment and is left out of the running program. In order to make the program run the code, you can comment back in the line by removing the slashes. Another word for comment back in is uncomment.
41
comment out
You can comment out code by adding two slashes (//) to the beginning of its line. This code will now be left out of the running program.
42
comparison operator
You use a comparison operator as a symbol in a comparison statement when you describe a relationship between two things. For example, > is a comparison operator that indicates one value is larger than another, and == is a comparison operator that indicates the two values are equal.
43
concatenate, concatenation
You concatenate strings by joining multiple strings together into one long string.
44
condition
A condition can be analyzed to give a value of true or false. Conditions might check whether an array of strings contains a particular name, verify that the total cost of purchased items is smaller than the remaining balance on a gift card, or even just retrieve a Boolean value on an instance like request.isCompleted.
45
conditional statement
A conditional statement is like a traffic controller that causes different code to run in different situations. An if statement and a switch statement are both conditional statements.
46
console
Programmers use the console as a message center to show details about the way a program is running.
47
constant
A constant is an identifier that is immutable. Once a constant is assigned a value, that value can never change; trying to assign a new value to an existing constant will generate an error. In Swift, a constant is declared with let.
48
content mode
You choose the content mode of a view to adjust the way it fits inside the space you've allowed it. If an image file is larger than its image view's frame, for example, the content mode .scaleToFill will squash and skew the image so it's exactly the size of the frame, while the content mode .top will show as much of the top of the image as can fit.
49
control
You use a control element as part of your app's UI to allow a user to take an action. Controls include buttons, switches, and sliders.
50
Core Data
The Core Data framework can manage your app's data model, including storing information. When you create a new app project, you'll see a Core Data framework option; but for this course, you'll leave this option unselected.
51
data
In computer science, data is information about the world represented in a way that computers can interpret and process it. In a computer, all data is ultimately represented as binary numbers, but programmers usually work with it using higher-level concepts such as text, images, touch interactions, and more.
52
data cleaning
If a data set has errors—such as misspellings or omissions—you can attempt to clean it by correcting them, or by eliminating the bad data.
53
data source
A table view uses a data source to find out what information it should display and how it should display it.
54
data transformation
You can transform data by changing it without changing its meaning. For example, you might correct spelling errors, or turn strings representing numbers such as "1" and "-42".
55
data transformation
You can transform data by changing it without changing its meaning. For example, you might correct spelling errors, or turn strings representing numbers such as "1" and "-42" into integers.
56
data translation
You can translate data by deriving new information. For example, you might calculate the sum of a set of numbers.
57
debug
Debugging is the process of identifying and fixing errors, or bugs, in your code.
58
declare, declaration
A declaration introduces a new name or construct into your program. For example, you use declarations to introduce functions, methods, variables and constants, and to define new, named types.
59
decompose, decomposition
Decomposition breaks a single large item down into multiple smaller items, giving each small item its own name. You might decompose a long function by writing a few shorter functions and calling those from the original function instead. Or you might decompose a struct that has many simple properties by creating smaller structs that each hold a few related pieces of information.
60
default
A default option is selected when no other option is available or specified. In an if statement, the default option is the final else clause. In a switch statement, the default option is the catch-all option to make the switch comprehensive.
61
delegation
In programming, delegation is the pattern of handing responsibility for certain tasks to another object. The object that owns a delegate notifies it when a task needs to be completed. The code in a delegate is typically not called by the delegate, since the requests come from another object in the program. Delegation fits into the broader pattern of callbacks.
62
device
In a general sense, a device is a physical object that includes some sort of computational function. A computer, a printer, a display, and a mouse are all examples of devices. In the context of app development and Xcode, device refers to iOS-enabled hardware: iPhone, iPad, iPad Pro, or iPod touch.
63
double
A Double is a number with a decimal point, like 7.78 or 1000.0. If you initialize a constant or variable in Swift to a literal number with a decimal point (like let distance = 26.2), the type is inferred to be a Double.
64
editor area
You use Xcode's editor area to make changes to your project files, whether source code, user interface items, or app configuration. Most developers always keep the editor area visible in the middle of their Xcode window while they’re working.
65
else
The else keyword can optionally add a default branch to an if statement. The code in this block will only run when all the previous if (and optional else if) conditions are false.
66
else if
The else if keyword adds another condition to an if statement. This condition is only checked if all the previous conditions are false. An if statement can include any number of else if conditions between the first if condition and before the final (optional) else statement.
67
enabled, disabled
When a button or control is enabled, it's available for interaction. The user can tap, slide, or otherwise engage with the control and cause its associated code to run. When a button or control is disabled, the user can still see the user interface element, but touching or trying to activate the control will have no effect on the app. A disabled control will usually have a slightly dimmed appearance.
68
encapsulation
Encapsulation is a very general way to describe bundling several things (whether bits of information or steps of instructions) into one package. In code, defining a function encapsulates several instructions into one task, and defining a struct encapsulates several pieces of information, and possibly functions to manipulate it, into one type with properties and methods. In a non-technical sense, the idea of "going for a jog" encapsulates several smaller activities, from putting on your shoes to remembering your keys to heading out the door. Encapsulation and abstraction allow people to reason about quite large systems without keeping in mind all the smaller parts contained within.
69
encryption key
Cryptography uses encryption keys known to the sender and the receiver so that they're the only two parties able to access the data.
70
enum
The enum keyword declares a type made up of a group of related choices. An instance of an enum will be exactly one of the enum's choices. The keyword enum comes from the word "enumeration," which means "listing distinct things one by one."
71
error
An error is a general term for a problem with code. A compiler error happens when a programmer types something that the computer can't understand, for example, a typo like lte myName = "Sam" instead of let myName = "Sam". These sorts of errors won't allow your app or playground to run, and are visually displayed in Xcode by a red octagon with an exclamation point inside. A runtime error happens while your code is running, for example, if you try to access the 100th element of an array that only contains three items. A runtime error will often crash your app. Sometimes a recoverable error happens even when your code is technically correct, for example, if your app tries to download information from a network while the device is offline. You can write code to handle these expected errors gracefully; for example, in the preceding case you might decide to download the information later when the device is back online.
72
escape character
You use the escape character (\) in a string to tell Swift that it should treat what comes next as special. This symbol is called an escape character because it avoids or “escapes” the normal behavior of a string.
73
escape sequence
An escape sequence combines an escape character with another character or characters to achieve a new effect. For example, some escape sequences in Swift let you insert an invisible character, like a tab (\t) or newline (\n), and others allow you to plug the value of an identifier right into the middle of a string, like "Happy birthday dear \(name).".
74
evaluate
When a program evaluates a code expression, it performs all the operations and returns a result. For example, if the expression 4 + 5 - 2 is evaluated, it will produce 7.
75
event
Programs that require user interaction generate events in response to actions performed by the user, such as tapping the screen or typing on a keyboard. Event-driven programs have code that responds to events; this code is not called directly from inside the program. Such programs spend much of their time idle, waiting for user input, and then spring into action as events trigger their code—a mechanism known as a callback.
76
execute
A program executes a code instruction when it carries it out.
77
exhaustive
Something that is exhaustive is comprehensive and all-inclusive. An exhaustive list contains every possibility.
78
expression
An expression is a piece of code that can be evaluated to produce a result. For example, 4 + 3 is an expression, but 4 + is not. A function call is another example of an expression—it's evaluated by calling the function.
79
false
You use the false keyword to represent a Boolean value meaning "inaccurate" or "untrue," or simply "no." Its opposite is true. Perfectly correct code can return a value of false. For example, you would expect a function like isMyBirthday(date) to return a value of false 364 days of the year. The code correctly tells you that the answer to your question is "no."
80
file extension
The file extension part of a document's name comes after the period, like "swift" in "ViewController.swift" or "storyboard" in "Main.storyboard." This last segment of the file's name identifies the kind of file, whether Swift code in .swift files or user interface in .storyboard files.
81
for...in
These keywords set up code that performs work on each item in a collection, or "loops over" the collection. The code describes two important pieces of information: which collection to work through, and what to call the item currently being worked on.
82
Foundation framework
The Foundation framework in Swift defines many types that are used to represent more specific things than just strings or numbers from the Swift Standard Library. For example, there are types for dates, distances, and files on a computer, among many others.
83
framework
A framework is a group of types and capabilities. In addition to the Foundation framework with its many basic types, Apple provides frameworks like HealthKit for storing health-related information, MapKit for adding maps to an app, and ARKit for creating augmented reality apps.
84
function
Functions combine detailed steps into a single block of code that can be used again and again. Some functions have inputs and change their behavior based on arguments from their caller, some functions have outputs and give a result, and some functions have neither.
85
General Data Protection Regulation (GDPR)
The General Data Protection Regulation is a law that applies to the European Union and European Economic Area. It took effect in 2018 and governs data protection and privacy. Among other things, the law requires any entity collecting personal information to provide the highest level of security as a default, allowing users to opt into the sharing of their data only via informed consent.
86
general, generalize
Programmers often try to solve a problem in general, meaning they want their solution to be broad enough to support more than just one particular case. For example, someone might write very specific functions like calculateSquare(of number: Double) and calculateCube(of number: Double), and so on, but then decide to create a more general function that raises a number to any power, like calculatePower(of number: Double, exponent: Int). An even more general solution might accept fractional exponents typed as Double to calculate roots. In programming, one big decision is choosing when to generalize your solution by writing code that solves (or might solve) a wide breadth of issues, and when to write code that's specific to your current situation.
87
identifier
An identifier refers to a value, function, type, or any other abstraction. An identifier is a formal word for a name in code.
88
if statement
An if statement is a code structure for executing code based on the value of one or more conditions. The first block of code in an if statement is the if block. An if statement might also contain other blocks that provide additional checks, such as an else block and an else if block.
89
if-else statement
An if-else statement is a code structure for executing code if a specified condition is true and for executing another block of code if it’s not true.
90
image view
An image view displays a picture file in a user interface.
91
immutable
Something that is immutable cannot be updated or changed. A constant is immutable.
92
incremental development
Similar to iterative design, the iterative development process follows a repetitive cycle. To build software incrementally, start by creating a small, working piece of the final project. Debug and test the code before adding more. Each step along the path in the iterative development of an app should result in a working app that can be tested and fixed. Incremental development is a better strategy than trying to build an entire project all at once, without running and testing it along the way.
93
index
The index is the numbered position of an item in an ordered collection. The index of the first item is always 0, and the index of the last item equals the total number of items minus one.
94
initialize, initializer
An initializer sets up an instance so it's ready to be used. After you declare a name for a constant or variable, you initialize the constant or variable by assigning its first value. (The word initializer is related to the word "initial," which means first.) You can initialize types like Strings and Ints with literals like "Hello" and 7, but to create that first value for other types, you must call the type's initializer method, as in Date() or Circle(radius: 44.0).
95
input
Programs receive data to process as input. Input data can take many forms, including media such as images and songs, text, collections of numbers, and user-generated events such as taps and swipes.
96
inspector area
Xcode's inspector area contains two important areas. Use the inspector area to find and edit details about an item selected in the editor. The inspector area is especially useful when you’re editing user interface files in Interface Builder.
97
instance
An instance is a value of a particular type. If you initialize a constant greeting with a value of "Hello", you've created an instance of a String. Take a look at some non-code examples: Chicago is an instance of a city; Fluffy is an instance of a cat; and Mount Rainier is an instance of a mountain. Notice that in English, the capitalization of instances and types is the opposite of the capitalization in code. In English, the type ("city") is lowercase and the specific instance ("Chicago") is capitalized. But in code, the type (String) is upper camel case and the specific instance (greeting) is lower camel case.
98
instance method
An instance method is a function declared inside a type—such as a struct, class, or enum—whose behavior depends on the current state of an individual entity, or instance, of that type.
99
integer
An integer is a whole number with no fractions or decimals. It can be a positive number, a negative number, or zero.
100
iterate, iteration
You iterate when you do something over and over again, often changing one small aspect every time. For example, you might iterate over an array of numbers by testing each one until you find the smallest. Or you might iterate on an app idea by trying a prototype, observing what works, changing a feature, and then trying again. Iteration is one of the three basic building blocks of algorithms.
101
iterative design
Iterative design is the practice of repeating a cycle to create something rather than going from start to finish. Each iteration, or repetition, refines the idea based on feedback and discoveries from the previous one.
102
keyword
Keywords are terms that have special meaning in the Swift programming language and cannot be used for any other purpose. For example, since the func keyword is for declaring functions, this code will produce an error: var func = "A funky name".
103
language
A programming language defines rules for writing code. Even though you can write instructions for a computer in any programming language, the exact words you choose and the way you arrange them will be different for each one.
104
library (software)
A library is a group of types and capabilities, usually designed to be reused in multiple programs to perform a particular type of task. iOS frameworks are examples of libraries.
105
line of code
A line of code is a single horizontal section of text in a code file. Programmers usually try to make sure that one line of code only does one thing. The Swift programming language reinforces this principle by evaluating separate lines of code as separate statements. For example, if you try to define two constants on the same line (like let guestCount = 25 let tableCount = 8), you'll see an error.
106
linear search
Linear search, is an algorithm for finding an value in a list (or determining the value isn't present). Linear search isn't as efficient as binary search because it works by evaluating the items in the list one after the other—which means it might have to evaluate the entire list before it finishes.
107
literal
A literal value is typed or inserted directly into code with no initializers. A literal string would be "hello", and a literal array would be [1, 2, 3]. In contrast, a non-literal string might be initialized with String(), or a non-literal integer might be initialized with homeTeamPoints + awayTeamPoints.
108
log, log messages
Since programs can perform millions or billions of steps per second, they work too fast for people to watch and understand in real time. To get a glimpse of how the program is running, programmers will log data. The log records information about a program as it runs, so the programmer can check the outcome of a step—even after the program has continued several billion steps past the one in question. Printing messages to the console or to a file is known as logging, and the messages are sometimes called log messages.
109
loop
A loop runs the same code for each item in a collection. A loop takes one item, runs some code using that item, then takes the next item and runs the same block of code on the next item, and so on through all the items in the collection. When it's finished with all the items
110
log
records information about a program as it runs, so the programmer can check the outcome of a step—even after the program has continued several billion steps past the one in question. Printing messages to the console or to a file is known as logging, and the messages are sometimes called log messages.
111
loop
A loop runs the same code for each item in a collection. A loop takes one item, runs some code using that item, then takes the next item and runs the same block of code on the next item, and so on through all the items in the collection. When it's finished with all the items, the loop automatically stops and the code continues executing through the rest of the program.
112
method
A method is a function defined inside a type. Methods can use the data stored in the type's properties to perform work.
113
model
Model is another word for "data," and people use the term in a few different ways. When people talk about an "app's model," they're talking generally about all the data types a particular app defines and deals with. A phrase like "pass the model to the view" means that this view type has a method that takes a data instance as an argument, and that data will probably affect the view's behavior. You can also use the word model as a verb if you talk about "modeling a solution." In this case, it refers to defining data types, and the operations on them, to handle the information your app needs.
114
Model-View-Controller (MVC)
Developers often organize their app code using the Model-View-Controller design pattern. Models define the way apps represent data; views define the way they display data; and controllers define the way they process data and user interactions. This clear separation of responsibilities enables cleaner and more maintainable code.
115
modular
Code is modular when it's organized into well-defined components that hide the details of how they work and can be reused. Programmers can make their code modular by organizing it into functions, and by creating types such as structs.
116
mutable
Something that is mutable can be updated or changed. A variable is mutable.
117
navigator area
The navigator area in Xcode offers several different overviews of your Xcode project, whether as a list of files in the Project navigator or as a list of warnings and errors in the Issues navigator. You can move around your project by selecting items from one of these lists. Xcode shows the navigator area on the left side of its window.
118
object library
Xcode's Object library holds all the user interface components you can add to a storyboard. It's accessible through a button at the top right of the toolbar. The Object library appears as a floating window with a search field at the top. You can drag out user interface elements from the window into your storyboard.
119
operator
An operator symbol—such as +, -, or =—takes action on one or more values. An operator is similar to a function in that it causes work to be done, but it's different in a couple of key ways. An operator is usually written with only non-letter symbols. Second, it does work on the values on its left and right, without the parentheses of a function. For example, in 1 + 2, the addition operator (+) adds the numbers 1 and 2; if the + operator were written as a function, it might look like add(1, 2).
120
organization identifier
An organization identifier is a unique name for you or your company. You can use "com.example" to build and run your app locally, but check out the App Distribution Guide Links to an external site. for advice on choosing final values to upload your app to the App Store.
121
outlet
An outlet connects a variable in source code to an object in the storyboard, allowing the code to access those objects and get information or make changes when the app is running.
122
output
Output is how computing devices communicate the results of their work. Output can take many forms—display on a screen, audio, tactile, and more.
123
overflow
Computers use limited storage space for some types of data, such as integers. Overflow occurs when the storage space is exceeded—for example, a byte (an Int8 in Swift) can represent numbers from -128 to +127. If a variable is declared as var x: Int8 = 127, then the expression x += 1 will cause overflow.
124
packet
Data transmitted on the internet via IP is broken into chunks called packets. Each packet is marked with extra information, such as the IP addresses of the sender and the receiver, to enable IP to route the packet correctly.
125
parameter, parameter name
You use a parameter to work with an input value or values inside a function. Informally, developers often use the word "parameter" interchangeably with "argument," but officially the word parameter references the function's inputs from a perspective inside the function. For example, if a function is declared as func drawLine(from fromPoint: Point, to toPoint: Point), the words fromPoint and toPoint are parameter names, because those are the names that will be used in the steps of the function's implementation. More generally, parameters can be used as inputs to a program to alter its behavior.
126
Personally Identifiable Information (PII)
Personally Identifiable Information is any information that can be used to identify or contact a single person. For instance, your full name, your social security number, your telephone number, and your medical records are all PII.
127
procedural abstraction
Procedural abstraction is the process of breaking a problem into pieces to solve each piece independently, creating a procedure for each solution. Then the procedures are combined to solve the problem as a whole. Procedural abstraction can be applied repeatedly—each piece can be further broken down into smaller independent problems to solve.
128
project file
The project file in Xcode keeps track of all the files and configurations for your app.
129
project navigator
The Project Navigator lists all the files that make up your app in Xcode. You’ll use it to select files and move around your project. The project navigator is one of the navigators on the left of Xcode's window.
130
property
A property is a piece of data provided by a struct, class, or enum. For example, each Array instance has a count property that's different depending on the characteristics of the particular array.
131
prototype
A prototype is a simulation of an app that uses minimal or no coding. App designers use prototypes to test their ideas with users before they implement them.
132
pseudocode
You use pseudocode to describe code patterns without worrying about whether it follows the exact rules of the programming language. Since you're ignoring the computer's rules for how code must look, you can focus on making your description easy to understand both for you and for others. Pseudocode is usually written using a mix of code and everyday language.
133
Quick Look button
If you move your cursor over a result in a playground's results sidebar, you'll see an icon that looks like a small eye. This Quick Look button will display the result in more detail than can be shown in the results sidebar—especially useful for instances of images, colors, and views.
134
random, random number
Sometimes programmers write algorithms that are designed to behave randomly—for example, shuffling a deck of cards should produce a different order every time. Programming languages, including Swift, have special functions to provide random numbers that can be used in algorithms that rely on random behavior.
135
refactoring
When code becomes complex to read, or when it becomes difficult to add new features, fix bugs, or adapt the code as a program evolves, the code can be refactored. Refactoring is the process of changing the organization of code—for example, by adding parameters to a function, adding new functions, or gathering related information into a new type—without changing what it does. By regularly refactoring their code, programmers can ensure that their programs never get too complex to work with.
136
remainder, %
A remainder operation returns the amount left over after dividing one number by another. You use % as the remainder operator. For example, when you divide 27 by 10, you have 7 left over, so 27 % 10 is 7.
137
result
A result is an answer to a calculation.
138
results sidebar
The results sidebar in a playground shows information about each line of code that produces an output value. As you add or change code, the playground runs your code again and updates the results in the sidebar.
139
return
A function returns something when it gives an output value back to its caller. The return keyword marks the value that will be passed back to the place where the function was called. Once a line with the return keyword is run, the program jumps back to the line where the function was called and continues executing code from there.
140
run
An app is running when it's started. You can run an app by selecting the "Build and Run" button in Xcode, by choosing Run from Xcode's Project menu, or by clicking or tapping the app's icon on the Home screen.
141
scene
A scene is a storyboard representation of a screen in your app.
142
searching
Searching is the process of looking for a particular value in a collection of values. There are two common search algorithms which have different degrees of efficiency.
143
selection
Selection is one of the three basic building blocks of algorithms. Selection involves making decisions based on a condition or set of conditions, resulting in choosing different code paths.
144
sequencing
Sequencing is one of the three basic building blocks of algorithms. Sequencing is following a set of instructions in order, one after the other.
145
Show Result button
If you move your cursor over a result in a playground's results sidebar, you'll see an icon that looks like a small outlined rectangle. This Show Result button will display the result in the source editor directly below the code that produced it.
146
side effect
Any work done by a function that doesn't help create a return value is a side effect. For example, a function might calculate the smallest number in a list, post it to social media, and then return that smallest number to the caller. In this example, posting the number online is a side effect. Since side effects are usually unexpected, you should decompose functions until you've separated the work that creates a returned value from any possible side effects.
147
simulation
A computer simulation replicates a real-world system and predicts its behavior. The creators of the simulation choose which aspects of the system they're interested in observing, and those decisions impact how they design its underlying algorithms and models. If the simulation is designed well, it can be used to test hypotheses about or predict the behavior of the real-world system.
148
Simulator
The Simulator app, included in Xcode, gives you an idea of how your app would look and behave if it were running on an iOS device.
149
slider
A slider control in your app's UI allows a user to select a single value between a minimum and maximum number.
150
Social Engineering
Social engineering is a technique used by criminals to compromise the security of private data. People employing social engineering don't attack the system that stores users' data. They target the users themselves by posing as trusted organizations and asking them for login names and passwords, for example in an email that notifies a user that their account password needs to be reset.
151
source code
Source code is a longer term that just means code. Source code tells your app what to do, and when and how to do it. You edit source code files by typing instructions into your code editor.
152
source editor
You use a source editor for writing and changing code. In a playground, you can also view inline Quick Look views in the source editor area.
153
statement
A statement in Swift is an instruction or action. A line of code is a statement. Loops and if...else are more complex examples of statements.
154
steps to reproduce
To describe a bug, include detailed steps to reproduce it. The steps should be a sequence of clearly described actions that a user follows in order to cause the bug to occur, followed by a description of the expected behavior of the app and a description of how it actually behaves.
155
storyboard
A storyboard is a user interface file that tells your app where to display information on the screen. Xcode opens storyboards in a special environment called Interface Builder. You edit a storyboard by clicking, dragging, and choosing options in the utilities area.
156
string
In most programming languages, including Swift, text values are called strings. A string can be just about any text you can imagine (including emoji). You can type a string into code directly by surrounding the string text with quote marks "".
157
string interpolation
You use string interpolation when you'd like to insert the value of a constant or variable in the middle of a string literal. You add placeholders for constants or variables with an escape sequence that puts parentheses around the code to be replaced. For example, if friendName has been set as "Lee", the expression "Have a good one, \(friendName)" will automatically be read as "Have a good one, Lee".
158
struct
Defining a struct (short for "structure") is one way to create your own custom data type in code. A struct can hold values as properties, define behavior as methods, and define initializers to set up its initial state. Every instance of a struct has its own separate identity.
159
Swift
Swift is a powerful and intuitive programming language created by Apple for building apps for iPhone, iPad, Mac, Apple Watch, and Apple TV.
160
switch (UI)
A switch control in your app's UI acts like an on/off button. You can see examples in the Settings app for options such as Airplane Mode and Bluetooth. [illustrate?]
161
symmetric encryption
Symmetric encryption relies on shared keys—ones that are known to both sender and receiver. Shared-key encryption is vulnerable to attacks that attempt to intercept or guess the key.
162
syntax
The syntax of a programming language defines the rules for creating well-formed code instructions.
163
table view
A table view user interface element shows a vertically scrolling list of items.
164
test
To test your code, you must run it with many possible inputs. Good testing involves listing all the possible conditions under which your code will run—including those that should cause errors—and the expected outputs. Then run your code under all those conditions, and check to see whether the outputs match your expectations. A failed test indicates that there's probably an error in your code.
165
text field
A text field is a UI control that displays one line of editable text. When the user taps in a text field, the keyboard appears for the user to enter text. Users can also select, copy, cut, and paste text. By becoming the delegate of a text field, your code can receive events such as a notification that the user has tapped the Return key.
166
tint
You choose a tint color to change the key color of UI elements. Every view type uses this tint color in its own way. For example, a red tint on a button control makes its text red, and a green tint on a slider makes the active part of its horizontal track green.
167
toolbar
The toolbar at the top of the Xcode window shows your project’s status. It also provides options to hide and show the other window areas, to choose different devices for running your app, and—most importantly—to build and run your app from the big Play button.
168
true
You use the true keyword to represent a Boolean value meaning "accurate" or "yes." Its opposite is false.
169
type
A type is a named grouping of properties (the features) and methods (the behaviors) of a kind of data. A type name in Swift is always written in upper camel case, as in Double, String, or BicycleRoute.
170
type annotation
You use type annotation when Swift needs more information about an instance's or an argument's type. For example, if you were declaring a constant with a decimal value to pass to a UIColor initializer, you'd need a CGFloat instead of the default Double, so you'd declare it with a type annotation such as let redComponent: CGFloat = 0.76.
171
type inference
Swift uses type inference to work out something's type from the available information, even when the name of the type isn't explicitly put into words in code. (If you infer, or deduce, something, you calculate new information based on whatever information you already have.) For example, if a function is declared to return a String, such as func answer() -> String, and a constant is initialized with the answer function's result, such as let nextIdea = answer(), the type of nextIdea will be inferred to be a String.
172
type safety
Swift has type safety to prevent you from writing code that uses types incorrectly or unexpectedly. For example, if a function expects a type Fruit and you try to call it with a Vegetable, your app or playground won't run until you fix the error.
173
Unicode
The Unicode standard defines a way to represent almost any character from any language in a consistent way. A global committee
174
to return a String
such as func answer() -> String, and a constant is initialized with the answer function's result, such as let nextIdea = answer(), the type of nextIdea will be inferred to be a String.
175
Unicode
The Unicode standard defines a way to represent almost any character from any language in a consistent way. A global committee works together to decide which new characters to add and how to support them. New characters, including emoji, are added to the Unicode standard only when they're accepted by the Unicode committee.
176
user experience (UX)
The combination of the design and UI of an app creates a unique user experience. An app's personality, ease of use, and 'wow factor' are all part of its UX.
177
user interface (UI)
An app's user interface is the collection of elements—such as images, buttons, and scrolling lists—that the user will interact with.
178
value
A value is the data that a constant, variable, or expression actually holds. For example, in let magicNumber = 42, magicNumber has a value of 42.
179
variable
A variable is an identifier that is mutable. It can be updated by assigning a new value at any time. In Swift, a variable is declared with var.
180
view
A view is the basic building block of a user interface. You can group multiple views together to create a more complex view, which in turn can be part of another parent view. Views can display content and can also detect user interactions, such as taps, pinches, and swipes.
181
view controller
View controllers are the foundation of your app’s internal structure. Every app has at least one view controller, and most apps have several. Each view controller manages a portion of your app’s user interface as well as the interactions between that interface and the underlying data. View controllers also facilitate transitions between different parts of your user interface. [copied from apple docs: https://developer.apple.com/library/prerelease/content/featuredarticles/ViewControllerPGforiPhoneOS/DefiningYourSubclass.html]
182
Xcode
The Xcode app puts together all the moving parts that work together to make an app run. You use Xcode to edit your source code along with your app's user interface, and to build and run your app so you can see it in action.
183
Xcode playground
Xcode playgrounds are standalone Xcode documents composed of one or more pages. Each page can contain narrative that explains its contents, and areas where the you can experiment with code that's evaluated live as you type—and see instant results—without anything getting in your way.
184
Xcode project
Your Xcode project contains the source code files, libraries, media, and other resources needed to build an app, and keeps track of how these parts work together. In Finder, an Xcode project starts with the product name and ends with the file extension .xcodeproj. Open this item to see and edit your source code and interface files in Xcode.