We do full code reviews at my shop — no code goes into production without at least two pairs of eyes on every line of the change.
As I switch between projects, I find myself willing to be absolutely ruthless in my code reviews when reading other people’s Python code. When I’m looking at PHP or Ruby source, I expect a certain amount of license to be taken with indentation, naming, and even encapsulation. Python? No dice. If you’re gonna use the language, use it right.
Use a less-than-descriptive variable name? Rejected.
Call an internal implementation method (ex.: _do_stuff()) outside the class that defined it (even in a unit test)? Rejected.
Let a line go over 120 characters in width? Rejected.
Forget to provide a useful comment for the test used in an if: block? Rejected.
I probably should be just as strict with PHP, Ruby, etc., but the culture doesn’t seem to be as forgiving of hard-and-fast style guidelines in those communities.
0 Responses to “Code Reading”