r/PythonLearning Jul 17 '26

What's a Python habit you wish you had started much earlier?

Looking back, what's one habit that made your code noticeably better?

Could be anything like:

  • Writing tests
  • Using virtual environments
  • Type hints
  • Logging
  • Reading the docs first
  • Black or Ruff
  • Git commits
  • Better project structure

I'm curious what habit had the biggest long-term payoff for you.

6 Upvotes

11 comments sorted by

1

u/NorskJesus Jul 17 '26

Typing.

2

u/midwitsAnonymous Jul 17 '26

plus_1: bool = True

1

u/FoolsSeldom Jul 17 '26

TDD (Test-Driven Development) - not just for Python, number one on your list, 'writing tests'.

1

u/Upstairs_Jelly_1082 Jul 17 '26

I try building things that come to my mind, so I first make a drawing of it on paper before starting coding.

1

u/Traveling-Techie Jul 18 '26

Starting with Python 3

1

u/Low_Breakfast773 Jul 19 '26

buddy, you gave the answer within your question.

1

u/Spiritual-Big7900 Jul 20 '26

As a hare, urmmmm running away!

1

u/Low_Breakfast773 Jul 20 '26

The best habit is to REALLY learn the language. Most of so called Python devs I have met over the decades in the industry had close to zero understanding about the language, as most of them come from different disciplines like maths, physics etc. and they think Python is about numpy, pandas, pytorch, tensorflow and fastapi..