The Self-Taught Programmer: The Definitive Guide to Programming Professionally
Rate it:
Open Preview
7%
Flag icon
You are not reading this book because a teacher assigned it to you, you are reading it because you have a desire to learn, and wanting to learn is the biggest advantage you can have.
13%
Flag icon
think of an object as a data value in Python with three properties: identity, data type, and value.
43%
Flag icon
Python allows you to use code from one module in another module.
45%
Flag icon
if __name__ == "__main__":
51%
Flag icon
To program professionally, you need to learn either the object-oriented or functional programming paradigms.
51%
Flag icon
State is the value of a program's variables while it is running. 
52%
Flag icon
As your program grows in complexity, the number of global variables in it increases.
52%
Flag icon
Classes are a mechanism for the programmer to classify and group together similar objects.
53%
Flag icon
Every object is an instance of a class.
53%
Flag icon
A suite in a class can be a simple statement or a compound statement called a method.
53%
Flag icon
Any method surrounded by double underscores, like __init__, is called a magic method: a method Python uses for special purposes like creating an object.
53%
Flag icon
class Orange:     def __init__(self, w, c):         self.weight = w         self.color = c         print("Created!")   or1 = Orange(10, "dark orange") print(or1)
54%
Flag icon
class Rectangle():     def __init__(self, w, l):         self.width = w         self.len = l       def area(self):         return self.width * self.len       def change_size(self, w, l):         self.width = w         self.len = l
55%
Flag icon
A disadvantage of object-oriented programming is that creating programs takes extra effort because a great deal of planning is often involved in designing them.
55%
Flag icon
Instance: Every object is an instance of a class. Every instance of a class has the same type as all the other instances of that class. Instance variables: Variables that belong to an object.
55%
Flag icon
"Good design adds value faster than it adds cost." —Thomas C. Gale
55%
Flag icon
There are four main concepts in object-oriented programming: encapsulation, abstraction, polymorphism, and inheritance. Together, they form the four pillars of object-oriented programming.
56%
Flag icon
Private variables and methods are useful when you have a method or variable that your class uses internally, but you plan to change the implementation of your code later (or you want to preserve the flexibility of that option),
56%
Flag icon
In Python, if you have a variable or method the caller should not access, you precede its name with an underscore.
59%
Flag icon
Polymorphism: Polymorphism is "the ability (in programming) to present the same interface for differing underlying forms (data types)."
59%
Flag icon
Composition: Composition models the "has a" relationship by storing an object as a variable in another object.
60%
Flag icon
"Treat your code like poetry and take it to the edge of the bare minimum." —Ilya Dorman
60%
Flag icon
In Python, classes are objects.
60%
Flag icon
Class variables belong to the object Python creates for each class definition and the objects they create.
71%
Flag icon
Simple is better than complex. Complex is better than complicated.
75%
Flag icon
Easter egg: A message hidden in code.
75%
Flag icon
"Every programmer is an author." —Sercan Leylek
83%
Flag icon
"The magic of myth and legend has come true in our time. One types the correct incantation on a keyboard, and a display screen comes to life, showing things that never were nor could be..." —Frederick Brooks
85%
Flag icon
A stack is a data structure. Like a list, you can add and remove items from a stack, except unlike a list, you can only add and remove the last item.
86%
Flag icon
Unlike a stack, where the first item put in is the last out, a queue is a first-in-first-out data structure (FIFO):
87%
Flag icon
The built-in time module has a function called time. It returns a float that represents the number of seconds it has been since the epoch, a point in time (January 1st, 1970) used as a reference.
92%
Flag icon
"Always code as if the guy who ends up maintaining your code will be a violent psychopath who knows where you live." —John Woods
92%
Flag icon
The Pragmatic Programmer by Andy Hunt and Dave Thomas,
92%
Flag icon
Two or more things are orthogonal if changes in one do not affect any of the others. In a well-designed system, the database code will be orthogonal to the user interface: you can change the interface without affecting the database, and swap databases without changing the interface."
92%
Flag icon
Limiting functions to accomplishing one task offers several advantages. Your code will be easier to read because the name of your function will describe exactly what it does.
93%
Flag icon
Logging is the practice of recording data when your software runs.
94%
Flag icon
"Untested code is broken code."
97%
Flag icon
There are a few programming books that are considered must-reads. The Pragmatic Programmer by Andy Hunt and Dave Thomas; Design Patterns by Erich Gamma, John Vlissides, Ralph Johnson, and Richard Helm (design patterns are an important subject I didn't get a chance to cover); Code Complete by Steve McConnell; Compilers: Principles, Techniques, and Tools, by Alfred Aho, Jeffrey Ullman, Monica S. Lam, and Ravi Sethi; and Introduction to Algorithms by the MIT Press. I also highly recommend Problem Solving with Data Structures and Algorithms,
98%
Flag icon
Get on LeetCode and practice those algorithms.
98%
Flag icon
Don't stop at just one answer, read all the explanations on a topic you can find. Ask questions and read differing opinions online.
98%
Flag icon
Reading other people's code is going to be difficult at first, but it is important because you can learn so much from other programmers.