Simplicity and Complexity

As far as I can tell, there’s two ways to do software development. Simplicity through complexity and complexity through simplicity. But, before I go into which one I prefer, let’s look at some examples which will hopefully explain my reasoning. Let’s pretend that we have the following object: class Context(object): def get(self): return self.__entity, self.__task def set(self, entity, task): pass So, this doesn’t tell us much. It tells us that we have a context object that can give us a tuple containing an entity and a task, and it can take an entity and probably store it internally.
Read more →

How I Structure Code

This is an example of how I structure code in Python, but the rules I follow applies to any other language. This page may update as my styles change, or there’s more information I can add. Module layout # I use the rules set in the default isort util. # https://github.com/timothycrosley/isort import standardlibrary import thirdpartylibrary from . import packagelibrary def publicFunction(): pass class Class(object): def magicmethod(self): pass def publicMethod(self): pass def _privateMethod(self): pass def __protectedMethod(self): pass @classmethod def classMethod(cls): pass @staticmethod def staticMethod(): pass def _privateFunction(): pass The typical rule I follow is to put the public functions/classes/methods first because when someone looks at the code, they generally start with what’s visible to the public.
Read more →

Development Setup

This is mostly for me, but if you want the same (or similar) development setup I have, then here’s the tools I use. Editor Visual Studio Code Languages Python Go Rust Python Packages yapf flake8 flake8-docstrings tox tox-pipenv tox-pyenv pipenv pyenv hypothesis pytest pytest-cov pytest-xdist pytest-mock Font Hack Visual Studio Code Extensions Atom Keymap Atom One Dark Theme Better TOML Bookmarks C/C++ C# CMake CMake Tools Docker EditorConfig for VS Code EditorConfig for VS Code Snippet final-newline Git History gitignore GitLens - Git Supercharged Go Jinja MayaPort MEL - Maya Embedded Language mssql Prettify JSON Project Manager Python REST Client Rust (rls) Settings Sync Sort Sort JSON objects Sort lines sprt-imports Todo+ Trailing Spaces Travis CI Status TSLint vscode-database Visual Studio Code Settings { // vscode "editor.
Read more →

Useful Websites

Here’s a list of useful programming and CG resources I have found on the internet. This list may get updated in the future. Go https://awesome-go.com/ A collection of packages for Go. Python https://tox.readthedocs.io/en/latest/ A really good tool for testing in multiple environments. For example, having code that is guaranteed to work in Python 2.7, 3.x, Maya, Nuke, Houdini, etc. https://docs.pytest.org/en/latest/ This makes writing unit tests a lot simpler.
Read more →

Another Way to Think About Classes

One of my friends is learning Python. Which I find exciting, because I am always interested in seeing people learn a skill I really enjoy, and also it is an opportunity for me to help them learn how to program. There’s an experiment that I have always wanted to give to a new Python developer to show them a way of thinking about classes without it being absolutely terrifying. For the sake of a thought experiment, let’s imagine that Python didn’t have classes, but we wanted to get something that worked in an object oriented way?
Read more →