De viktigaste punkterna
Beautifulis better than ugly.
Simple is better than complex.
Readability counts.
If the implementation is hard to explain, it's a bad idea.
Det viktigaste medPEP 8
Kod läses många fler gånger än den skrivs
Samstämmighet för de som skriver/läser kod
12.
Undantag mot PEP8? När?
Lyssna på omgivningen (kanske ert företag har andra designregler för kod?)
Minskar läsbarheten
13.
De viktigaste punkterna!
4stmellanslag (alt. TAB)
Mixa aldrig tabbar och mellanslag
Ha maximalt 79 tecken per rad, annarsradbryt
Använd blanka rader med måtta
Proceduralprogrammingis a methodof writing
software. It is a programming practice centered on the
procedures or actions that take place in a program
30.
Procedural programming ismade up of
one or more procedures
Procedures operate on data items that are separate from the procedure
Data items are passed from one procedure to another
Focus is on the creation of procedures that operate on the program’s data
31.
Object-oriented programming iscentered on
objects. Objects are created from abstract
data types that encapsulate data and function
together.
32.
OOP
An object isa software entry that contains both data and procedures
Data contained in an object is known as the object’s data attributes
Procedures that an object performs are known as methods
34.
A class iscode that specifies data
attributes and methods for a particular
type of data.