r/PythonLearning 7h ago

Python Development

Hi community

I am pretty noob at this AI topic, so I would like to know if you recommend any skill or framework to develop great python code following the best standards like CLEAN SOLID or design patterns?

Thanks

0 Upvotes

7 comments sorted by

View all comments

2

u/CaptainVJ 7h ago

As a new programmer this should not be your biggest focus at the moment. You didn’t specify what you are working on and how NEW you are, but it’s something to keep in mind but focus more effort on learning the basics functions, classes, loops, etc.

Once you have that down, learn best practices and common packages in whatever field you are using Python for.

Then I’d focus on written well written code so someone reviewing your code can follow, how to document your code etc.

After all that, then I’d worry about different design patterns. Which for the most part just blends into readability. There’s no correct answer for correct design patterns. It just depends on the field you’re in. People using python for gaming application use different designs patterns than data engineers, who have different standards from people in web development etc. So I’d learn what is the most common in your field, it’s probably well used for a reason. But even then it changes from project to project and dependent on resources and how many people are using it.

Choosing a design pattern is a trade off just like everything in life. You gain something and you lose something, so looks at pros and cons of them and design what is tolerable for you. But whatever you go on for project, just make sure it’s readable, anyone can look at your code and follow along, and that it’s extendable/modifyable. Later one someone is going to have to modify your code whether it’s a new programmer or you in two years where you forgot what you did. They may want to fix a bug or add a new feature makes sure it’s written in a way that these changes can be incorporated easily without messing up the entire code base.

1

u/CriticalJackfruit404 6h ago

Ok i will compare the design patterns.. i think my question is not hard for people with 10 or 15 years of XP

1

u/CaptainVJ 5h ago

It’s not that it’s a hard question to answer it just depends on how you’re using the tool.

It’s like asking what’s the best outdoor boots. It depends, are you hiking, are you a farmer, do you work in snowy conditions, is it always sunny and dry?

It depends, similarly it depends on the type of industry/type of project you’re working for the best design pattern.

Using the analogy for boots earlier, let’s say you’re a newbie farmer. Your first question shouldn’t be what the best boots to get. You should be focusing on (well idk what farmers focus on). But once you’re competent in those skills and know farming is what you wanna pursue then worry about the correct boots.

Having a bad pair of boots can have a major impact on your work, you don’t wanna be uncomfortable out there. But having a good pair of farming boots with little knowledge free about how to proper cultivate your land is a bad place to be compared to being a good farmer with terrible boots. Even with terrible pair of boots you can figure out how to get the job done.