5 tips for CLEAN Python code

Publicado el: 17 junio 2024
en el canal de: Carberra
4,026
172

Sign up to Codecrafters for free, and get 40% off ANY plan when you upgrade!
https://app.codecrafters.io/join?via=...

(I mentioned your first year in the video, but the discount actually applies for any plan.)



One thing I always say to new developers is that it's easier to get into good habits than it is to break out of bad ones. In this video I give you my 5 top tips to keep your code as clean as possible -- just make sure you stick to the good habits!

00:00 - Intro
01:24 - Reduce nesting within statements
04:46 - Reduce code redundancy (ft. mixins)
09:08 - Split up complex functions [1]
13:11 - Maintain a good file structure [1-2]
16:46 - Follow PEP 8 (ft. Black, Isort, & Ruff) [3-6]
18:39 - Outro

[1]    • Implementing OAuth 2.0 from SCRATCH  
[2] https://github.com/parafoxia/analytix
[3] https://peps.python.org/pep-0008
[4] https://pypi.org/project/black
[5] https://pypi.org/project/isort
[6] https://pypi.org/project/ruff



If you want to see more of me, join my Discord server!
  / discord  

I get a lot of people asking, so here's my setup!
• Visual Studio Code:    • My Visual Studio Code setup! (2024)  
• Terminal:    • Make your terminal look AMAZING  
• Desk/recording gear: https://kit.co/Carberra
• PC build: https://uk.pcpartpicker.com/list/TmzGYN

Affiliations (I may earn a commission):
• Codecrafters -- 40% off any plan: https://app.codecrafters.io/join?via=...
• Keeper Password Manager -- 30% off your first year: https://keeper.io/r/EX4FB1C



If you have any questions, don't hesitate to ask in the comments! I'll try and answer as soon as I can, providing someone else hasn't already done so.

#python #coding #howto


En esta página del sitio puede ver el video en línea 5 tips for CLEAN Python code de Duración hora minuto segunda en buena calidad , que subió el usuario Carberra 17 junio 2024, comparta el enlace con amigos y conocidos, en youtube este video ya ha sido visto 4,026 veces y le gustó 172 a los espectadores. Disfruta viendo!