Python

Zen

>>> import this

Stop writing classes

  1. if your class has two methods and one is __init__, it is probably not a class
  2. if you create an object, call one method then throw it away, probably you don't need that class
  3. can I write this 3 lines of code later? if yes, just do that later.
  4. if it bundles related data, that you actually use in functions, it's probably a class
  5. if your subclass only implements __init__, you probably don't need a new class

Working backwards

Imagine what the user will type when uses your code. Than implement that.

Scripts inside modules

I'm -1 on this and on any other proposed twiddlings of the main machinery. The only use case seems to be running scripts that happen to be living inside a module's directory, which I've always seen as an antipattern. To make me change my mind you'd have to convince me that it isn't. - Source

Nice projects

Updated 16 May 2023