Skip to content

Cleaner Code #6

@arkravitz

Description

@arkravitz

Hey,

Sorry I haven't been around for a while. I'll help you clean up your code when I have some time. But just a few tips:

  1. Coding is like writing, you can't just code and be done. You have to test, code, and revise, then pass your tests.
  2. Functions should have one specific purpose. You have a lot of functions that are at many different levels of abstraction, making the code difficult to read.
  3. Python files should be much smaller, and so should your classes. That will really help with anyone trying to decipher what's going on.
  4. Try to separate your unit tests from your code. That way, you can edit the code without affecting the unit tests and vice versa.
  5. Try to also keep todos separate from code. They can cause clutter, and oftentimes don't keep up with the code. Yes, you can keep them in the code, but in my opinion, it's better to keep a list on a website or something similar. Another idea is to have a TODO file. I just like my code to be just that, code.

All of this will help you to make your code more modular, easier to edit, and much easier for someone to jump in and read. If you want some recommended reading on the topic, feel free to email me (I believe you still have my email). The most important thing I've learned in the past few years is that code is an expression that BOTH a computer and humans should be able to understand. If you code for just the computer, you won't be able to change what you did in a couple of months.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions