R&D
Python 2 Source Code Study: Windows Compilation
· β˜• 2 min read
1. Compiler Preparation Prepare the Python source code From the official Python website, download the source code for the Python version you need to compile. The one chosen here is the latest Python 2 release, Python-2.7.14.tar.xz, click here to go there. Prepare a compiler On Windows, the project files built

Python2 Source Code Study: pyc
· β˜• 8 min read
This article uses the Python 2.7.8 source code as an example. 1. Common File Formats in Python py file A Python source code file, which can be modified with a text editor. pyc file The bytecode file generated after Python source code is compiled. pyw file When a pyc file is executed, a console window appears; when a pyw file is executed, it does not.

Notes on The Art of Readable Code
· β˜• 1 min read
1. About Names Choose professional words Avoid overly generic names Use concrete names instead of abstract ones Use prefixes or suffixes to attach more information to a name Decide how long a name should be Use the formatting of a name to express meaning 2. Packing Information into Names Generally speaking, adding words like is, has, can, or should makes a boolean value more explicit.

Django Model and E-R Diagram
· β˜• 6 min read
As requirements are gradually confirmed, the system’s DB model is gradually confirmed as well. Sometimes you use a tool like MySQL Workbench to draw an E-R diagram and then generate MySQL database tables, and at that point you need to reverse-generate Django Models; other times you write the Django Models directly, but then you need to look at the E-R diagram.

How to Do Code Review Better
· β˜• 2 min read
1. How to Do Code Review Better Requirement Items Requirements for the committer Small granularity Atomicity With comments Tool checks Requirements for the reviewer First conventions Second logic & performance Third design Requirements for the team Reviewing the old to learn the new 2. Define a Code Review Checklist Requirement Items Naming Variable names