DEV Community

What is your one piece of advice or best tip for getting better in Python programming?

Rose Day on April 24, 2019

Collapse
 
nielsbom profile image
Niels Bom

My one piece of advice for getting better at programming, period, is: sink time into it. You can have the best book, teacher, learning strategy, IDE, most easy-to-learn framework, but if you don’t put in the hours those are all not gonna help.

Collapse
 
rosejcday profile image
Rose Day

πŸ˜„ agreed!! Time is everything no matter what you are doing.

Collapse
 
apoclyps profile image
Kyle Harrison

Pick a project you find interesting, write a python script for it and keep iterating. As your projects grows, so will the stuff you need to learn.

A good place to start is with new language features. Why not try out fstrings or data classes.

Collapse
 
rosejcday profile image
Rose Day

Thanks!! I will have to look into data classes, have not used that before.

Collapse
 
sm0ke profile image
Sm0ke

Find a customer that pays well and promise something you don't know.
You will learn a tone. Worked for me!

Collapse
 
rosejcday profile image
Rose Day

This is interesting, I have done projects like this before as well. It is worth it with the amount you can learn.

Collapse
 
rhymes profile image
rhymes

Read source code, it helped me a ton. Maybe not from something huge like Django but something like a popular small library, like requests.

Also... give it time β˜€οΈ

Collapse
 
rosejcday profile image
Rose Day

Neat idea! I will definitely take a look.

Collapse
 
cuneyt profile image
Cuneyt

I will suggest four things:

  1. I second reading others' codebase as much as writing code. Trying re-writing some pieces of the codebase is also helpful. I personally found reading Django REST Framework's codebase super helpful.

  2. Reading a high-quality book is important to have structural knowledge. I suggest Python Cookbook in order to learn good tricks in context.

  3. Stick to a long-term project to keep writing code. Also, learn and use asserts and logs inside your code. Keep writing tests.

  4. Last but not least share your code with others, get reviews from others around you or you get into touch with online, ask for help in dev.to, make your code open source in GitHub.

Collapse
 
rosejcday profile image
Rose Day

Oh, interesting! Thanks for the book reference, I will have to look into it. I like the idea of keeping a long-term project to work on.

Collapse
 
d1p profile image
Debashis Dip

Don't be afraid of jumping into library codes.

Collapse
 
rosejcday profile image
Rose Day

πŸ˜„ yes yes!

Collapse
 
elfosardo profile image
Riccardo Pittau

Learn to build good tests, especially using unittest, and how to use mock.

Collapse
 
epogrebnyak profile image
Evgeny Pogrebnyak

Especially using pytest, I would say, and avoiding mocks as much as you can to enable learning about dependency injection. )

Collapse
 
rosejcday profile image
Rose Day

Oh cool! I have been working on that this week actually.

Collapse
 
rinsama77 profile image
imrinzzzz

What helps me is start doing some project and the requirement of what you have to learn will come later.

Collapse
 
alchermd profile image
John Alcher

Embrace PEP in all its glory.

Collapse
 
rosejcday profile image
Rose Day

Ohhh I will look! Thanks πŸ˜„

Collapse
 
juancarlospaco profile image
Juan Carlos

KISS Principle.
The most hipster tool is usually not the best.
Learn Nim lang.

Collapse
 
epogrebnyak profile image
Evgeny Pogrebnyak

Glad you mention Nim. I see it as a typed version of Python, which is everyone starts thinking of in a while after using Python, even eith type annotations. Nim also compiles to executables.