-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathprogramming-fundamentals.html
More file actions
91 lines (53 loc) · 3.16 KB
/
programming-fundamentals.html
File metadata and controls
91 lines (53 loc) · 3.16 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
<!DOCTYPE HTML>
<html>
<head>
<title>Programming Fundamentals (D-Lab Berkeley)</title>
</head>
<body>
<p>
Knowing how to program is not the same as knowing how to program in a specific language. Programming as a way of thinking, a way of conceptualizing the world.
Here are some ways programming languages differ:
-Syntax (the grammar, how you write things and certain structures)
-Usage--How is the languaeg used?
-Level-->How close are you to the hardware? C is considered one of the lowest (closest to the machine)
-Compiled/Interpreted--> R and Python are interpreted (we work through as we go it) whereas C and Java need to be compiled (checked for errors then run)
-Object-oriented/Functional programming
So how should we start? What language do you want to learn?
-Skopos-->To what end do you want to learn a language?
</p>
<p>You're going to spend a hell of a lot of time debugging code that you have written. StackOverflow will be your new best friend. Google will be your other new best friend</p>
<p>Print statements will be your friend.</p>
<p>OS a body or suite of programs that make what we do nice.</p>
<p>Unix has more rigorous security. OSX is UNIX!!! (see D-lab notes for more difference)</p>
<p>Linux is free and open source Unix-like operating</p>
<p> UNIX has 1) a kernel, the hub of everything. 2) the shell interprets commands given to machine by us. 3) file system/hierarchical director story, root directory at the top.
<strong>Command Line Interface</strong>
The Shell: we are sending commands to the shell, the shell is more or less an interpreter. The shell encloses the operating system to hide some of the complexity.
</p>
<p>BASH-Boure Again Shell-->derived from name of creator Bourne
Why do we use shell? Comine existing tools with only a few keystrokes.
Easiest way to interact with remote machines-->the machines do the crunching far away so we don't have to waste our laptop doing the work.
Directories = folders
Usual style
(command) (flag/a thing with a hyphen) (files or directories, could be multiple or one)
A command might require no files.
ls -F, adds a trailing / to indicate that something is a folder/directory.
man ls-->returns manual or description of ls (Mac), NB: type q to escape from The Isle of Manual
If you got ls --help
Absolute vs Relative path
-->Absolute path is starting from root directory, relative is dependent on where the hell you are.
Change directory. = cd
ls -a, what does the -a flag do? It stands for "reveal all"
cd ~, takes you home, to the home directory.
NB: Tab completion, if you beginning typing a path out, you can press tab to complete the thing.
.. -->Takes us one up.
MANAGGIA! I learned the commands.
NB: Deleting is essentially forever. There is no easy way to undo.
"rm" only works for files, not folders. rmdir is for scripts. You cannot delete a non empty directory/folder
"cat" reveals the contents of a folder.
'mv' mv (origin) (destination), if mv (origin) (origin), rewrite file name
'cp' = copy, cp (origin/original) (copy name and destination)
'ls' (file name) --> returns whether file can be found in pwd or not.
</p>
</body>
</html>