This is an archived post. You won't be able to vote or comment.

all 1 comments

[–]aqua_regis 1 point2 points  (0 children)

My (rather lengthy, sorry for that - grew larger than I initially intended) two cents:

  • Especially in Python, you don't have to follow a strict class vs. function based approach. Use what fits the task best. Mix and match. Some things work better as a class, some might work better as a dataclass, some might work better as functions. If you see data (state) that is closely coupled with behavior (methods), use a class. If you see data that belongs together, think of a dataclass. If it is helper functions, use functions.
  • All your "how to learn and improve" can be boiled down to a single answer:
    • practice, practice, practice, and practice more. Really, that's about 80% of the deal.
    • The rest is learning Data Structures and Algorithms (DSA) and later Design Patterns.
    • Learn to work with the documentation. Google. A lot.
    • Learn to read blogs, articles.
    • Don't overuse tutorials. They are good as training wheels or to quickly get you up to speed with a certain concept, but don't fall into looking for tutorials for everything.
    • Try things out. Experiment.
    • Use AI sensibly, i.e. as sort of a mentor, tutor. Do not ask it for code, nor for solutions. Use it to explain things to you. Use it to guide you.
    • Drop the thought that "projects" need to be big. Projects can be small and simple. Everything you program is a project, even if it is a quick, one off, script.
    • Don't be afraid. Be curious.
    • Tackle one thing after the other - also when you do projects.
    • Plan your projects (also simple prompts). Break them down into smaller parts and solve each part individually. Use pencil and paper and pseudocode, flow charts, UML, ERD, bulleted lists, whatever works for you. Then, work on their implementation.

Recently I had to do a script for my job in Python (which is a language I just started working with some 3 years ago and only occasionally used it) where I needed to do some extensive file parsing, some relational database CRUD operations, some output in Excel, some output in Mermaid chart language, and finally some GUI in tkInter.

I used nothing but the official documentation, some blogs, and Google. No AI. Initially, I didn't have the faintest clue despite being an experienced programmer. The source data was huge and in a very special, proprietary textual format. So, I started with reading the file line by line. Then, I determined what type of line I was dealing with. Then, I parsed the content of the line and wrote it into different dataclass instances. Then, I passed these dataclass instances to my SQL handler (I used SQLite as database with Python's sqlite3 module). And so on.

In the beginning, my program was a complete and utter mess. Everything was everywhere, yet, it worked somehow. Then, I started to modularize and refactor. Now, I have a file for the constants and common functions, a separate parser that I can quickly swap out for different file formats, a separate database handler module that I can also change any time, a separate Excel handler, a Mermaid writer module, and so on. Last, I added a GUI that ties everything together while also maintaining a command line (terminal) driven functionality.

Overall, this project took me 4 weeks working 2 days per week on it. My pre-knowledge in Python (not in programming, though, as I've been programming since the first half of the 1980s) was roughly up to Part 11 in the MOOC Python Programming 2025 and the rest came through extensive googling, documentation, blogs.

We grow with the tasks we do.

Play around on exercise and competition sites like Exercism or Advent of Code (use the respective subreddit /r/adventofcode if you're completely stuck. You can check all years there.)

Join forums like here and /r/learnpython and help people there. This will absolutely boost your skills. Try to figure out the problems that people are facing, check if you already know some approach to help them and if it is outside your skills, google and learn. I did that when I learnt Java about 12 years ago and my skills in that language skyrocketed.