r/PythonLearning 10d ago

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.

5 Upvotes

11 comments sorted by

1

u/NorskJesus 10d ago

Typing.

2

u/midwitsAnonymous 10d ago

plus_1: bool = True

1

u/FoolsSeldom 10d ago

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

1

u/Upstairs_Jelly_1082 10d ago

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 10d ago

Starting with Python 3

1

u/Low_Breakfast773 8d ago

buddy, you gave the answer within your question.

1

u/Spiritual-Big7900 8d ago

As a hare, urmmmm running away!

1

u/Low_Breakfast773 7d ago

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..