Notes to Self

Alex Sokolsky's Notes on Computers and Programming

Programming Best Practices

Language specific:

Here are few things TODO no matter what programming language you use.

White Space Hygiene

Tabs vs spaces: spaces only.

Configure your IDE to:

My vscode config

Width Guides

I try to limit my code width to 80 columns. In vscode I use a ruler to provide such a guide.

My vscode config

Sizing Your Functions

If the function does not fit on your screen - it is too big.

Naming Best Practices

Naming best practices

Watch Your Constructor / Initializer

Constructor (initializer in python) does not return value and just initializes the space allocated for the object. Therefore, in its body, do NOT perform any action that may fail. You can still raise an exception though.

Design Best Practices

Design Best Practices