Writing code is like painting.
There are techniques to learn, like color-mixing, brush strokes, layering, shading, perspective, etc.
There is also creative intuition: the ability to exercise the techniques you know to create something beautify.
To build beautiful code, you'll need to know the techniques, and you'll need to develop creative intuition.
Over the next few days, we'll talk about important techniques and practice, practice, practice!
You can use any phrase you want when making a snapshot.
Jump buttons take you to the previous or next snapshot.
When naming a function or variable:
_ (next to the zero key + shift) to break up compound names
go_green instead of
go instead of
go is different from
Defining a function is not the same as calling a function.
The very first line after
def can have a string. When this is the case, we call that string a docstring because it documents the function: you use it to describe what the function is for and how to use it.
Strings that use single quotation characters (e.g.
') are only one line.
If you want to use multiple lines for your string, use triple quotes (
Given the following starting world:
Draw four blue smiles: