-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathREADME.html
117 lines (117 loc) · 6.75 KB
/
README.html
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
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="Content-Style-Type" content="text/css" />
<meta name="generator" content="pandoc" />
<title></title>
<style type="text/css">code{white-space: pre;}</style>
<link rel="stylesheet" href="pandoc.css" type="text/css" />
</head>
<body>
<h1 id="introduction-to-programming-aip2015">Introduction to Programming (AIP2015)</h1>
<h2 id="instructors">Instructors</h2>
<ul>
<li>Christophe Pallier <script type="text/javascript">
<!--
h='pallier.org';a='@';n='christophe';e=n+a+h;
document.write('<a h'+'ref'+'="ma'+'ilto'+':'+e+'">'+e+'<\/'+'a'+'>');
// -->
</script><noscript>christophe at pallier dot org</noscript></li>
<li>Sylvain Charron <script type="text/javascript">
<!--
h='polytechnique.edu';a='@';n='sylvain.charron';e=n+a+h;
document.write('<a h'+'ref'+'="ma'+'ilto'+':'+e+'">'+e+'<\/'+'a'+'>');
// -->
</script><noscript>sylvain.charron at polytechnique dot edu</noscript></li>
<li>Louis Thibault <script type="text/javascript">
<!--
h='gmail.com';a='@';n='louist87';e=n+a+h;
document.write('<a h'+'ref'+'="ma'+'ilto'+':'+e+'">'+e+'<\/'+'a'+'>');
// -->
</script><noscript>louist87 at gmail dot com</noscript></li>
</ul>
<h2 id="objectives">Objectives</h2>
<ul>
<li>Learn the principles of how computers work</li>
<li>Learn the basic concepts of programming (instructions/variables/loops…)</li>
<li>learn the bases of Python programming</li>
<li>Learn how to execute, design, write and debug programs</li>
</ul>
<p>(see below for more details about the contents of this series of lectures)</p>
<h3 id="lecture-materials">Lecture materials:</h3>
<p>The most up-to-date lectures materials are available in a git repository at <a href="https://github.com/chrplr/AIP2015">https://github.com/chrplr/AIP2015</a></p>
<p>To download a local copy on your computer and set it up to easily update them, follow <a href="./howtos/how-to-get-the-lectures-materials.html">these instructions</a>.</p>
<p>Too see the list of all html and pdf documents, check <a href="doclist.html">doclist.html</a>.</p>
<h3 id="prerequisites">Prerequisites:</h3>
<p>This course is intended for beginners, but students who already have rudiments in programming (e.g. only know Matlab) can benefit from it. Also, note that knowledge of Python and of the skills listed below is a requirement for the other hands-on classes (Ateliers) of the Cogmaster.</p>
<p>Before attending AIP, it can help: - to study the learning modules on ‘Python’ and ‘the command line’ at (https://www.codecademy.com)[www.codecademy.com] - have a peek at the documents in the ‘resources’ folder, in particular <em>How to think like a computer scientist</em>.</p>
<p>During of after AIP, you may be interested in <a href="http://ocw.mit.edu/courses/electrical-engineering-and-computer-science/6-00sc-introduction-to-computer-science-and-programming-spring-2011/">MIT’s Introduction to computer science and programming</a> online course.</p>
<p>Another excellent resource to go beyond this lecture is <a href="https://mitpress.mit.edu/sicp/sicp.html">https://mitpress.mit.edu/sicp/sicp.html</a></p>
<p>More precisely, at the end of this series of lectures, you should have acquired:</p>
<h2 id="basic-programming-concepts">Basic programming concepts</h2>
<ul>
<li>instructions/sequential exectution</li>
<li>forever loops</li>
<li>conditional statements</li>
<li>constants integers/floats/strings (insist that there are different types)</li>
<li>variables</li>
<li>lists/dictionaries</li>
<li>loops over sequences</li>
<li>functions/parameters/local variables</li>
<li>modules</li>
<li>file input/output</li>
</ul>
<p>For example, you should be able to write Python scripts to:</p>
<ul>
<li>search for items in a list</li>
<li>find the largest number in a list of integers</li>
<li>compute basic statistics from files containaint numeric data</li>
<li>compute the number of occurrences of words in a text file</li>
<li>play the “guess a number” game</li>
</ul>
<h2 id="practical-skills">Practical skills</h2>
<p>You should know how to:</p>
<ul>
<li>Download some source code (e.g. Python) from the Internet (e.g. github) and display it.</li>
<li>Run a program from the command line
<ul>
<li>open a terminal, interact with the shell</li>
<li>navigate the directory structure with cd/ls</li>
<li>type commands, possibily with options or arguments</li>
<li>interrupt a running program (using the process manager)</li>
</ul></li>
<li>Execute a python script.</li>
<li>Install missing modules</li>
<li>Launch ipython and use it interactively (distinction shell/interpreter python)</li>
<li>Use an editor (atom) to view/edit a Python script</li>
<li>Find/read Python’s documentation</li>
<li>what to do when there is a crash/error message</li>
</ul>
<h2 id="computers-architecture">Computer’s architecture</h2>
<p>To program computers, it is necessary to have a rough idea of how they work.</p>
<ul>
<li>Computer = Automaton + Memory store (Turing machines)</li>
<li>Intro to Machine language (Register machine Rodrego)</li>
<li>High-level languages. Compilation/interpretation.</li>
<li>What does an operating system do</li>
</ul>
<h2 id="methodology-of-programming">Methodology of programming</h2>
<ul>
<li>divide-and-conquer approach, piping</li>
<li>writing code following our coding standards (see below)</li>
<li>debug with ‘print’</li>
</ul>
<h2 id="remarks">Remarks</h2>
<p>Our Coding standards:</p>
<ul>
<li>use a common template for all scripts</li>
<li>force writing docstrings with aim, input & output descriptions</li>
<li>avoid global variables except for constants (use uppercase for identifier)</li>
<li>spaces around operators, after ‘,’,…</li>
<li>use explicit names (lowercase ascii)</li>
<li>use comments sparingly, explain why, not how</li>
<li>factoring code (each step is a function, put docstrings)</li>
</ul>
</body>
</html>