I can’t listen to lectures (or meetings, for that matter) without doodling if there’s a pen and paper in front of me. Writing things down is really helpful, though, and whenever I make a good doodle that embodies a new concept, I definitely remember it more effectively.

Some folks thought these were cute, so I figured I’d share, in case anyone else would find them useful. (Concepts appear in no particular order.)

Methods vs Functions

We had our first few lectures on object-oriented programming. Talking about the differences between functions and methods inspired this little doodle.

Methods and Functions

In case the little characters didn’t get the point across, one way to remember when you’re using a method and when you’re using a function is if you can ask the object to do something to itself. In that case, you’re dealing with a method. If you’re asking Python to do something and passing the object as a parameter, you’re using a function.

Python is Loosely Typed

Coming from C-landia, this was one of the strangest things for me to grok about languages like Python. If I don’t tell you what my variable is, how will you know how much space to reserve? And why would I even want to change the type of my variable’s contents midway through a program? Ahhh!

Loosely Typed

But everything seems to work out in the end. I can see now that it is possible to not know whether the user will give you a string or a number and not end up with a program that breaks–you just have to handle the input appropriately. I’ve also just come to accept and enjoy the fact that I don’t have to program in quite so rigid a structure as I used to.

For Good Style and Sanity, Don’t Mix Tabs and Spaces

In Python, indentation matters. It’s the only way your code blocks get set apart from each other. Apparently, it’s typical for Python programs to use four spaces as the standard indent amount, rather than using a single tab. But whatever your code base uses, just don’t mix the two, or you’ll cause headaches for everyone.

Tabs and Spaces

Nothing should actually explode, but people may get upset with you if their program goes sideways due to indentation errors because you started using tabs instead of spaces.

Don’t Freak Out–Try It Out!

One of my favorite aspects of Python is the fact that you can just try something out when you’re not sure what it does. Confused about a method? Got a file full of classes and just want to play with them? Crack open that Python console and go to town.

Python SPACE!!

I’ve really enjoyed using bpython instead of the standard python program lately. It has tab completion and syntax highlighting!

Still Stuck?

Finally, one of my personal favorites–if you’re still stuck after playing around in the console…

Read the Docs

Because dense as they are, they’re at least a good pivot for asking questions intelligently elsewhere, or finding a good tutorial on a particular use for a method, function, class, and so on.