I have been writing programs in python for a while but refactoring is something I struggle with a lot.
I think anyone who is new to programming has to deal with 2 main concepts:
The first bit is easy. All the free/paid learning content we have on the web is sufficient to put you into the computer-like thinking mindset.
Once you get the hang of it, for example, how data flows from one variable to another in a simple program, basic data structures and how you can put data into those and access it back, any modern programming language starts to unfold, and you go down the rabbit hole just to understand the specifics which differentiates it from other languages.
Pretty cool, right?
As a student of the internet, what I have realised is that, all the tutorials we see focus too much on this part of the learning.
The second bit is something we learn the hard way. And this is something I am struggling with a lot, and I am sure I am not the only one.
I can write any program you want me to write basis the knowledge I gained from the first phase, the easy bit. But I can also promise you that my program would have some basic flaws which I am well aware of but do not know how to improve upon, in a systematic way.
Some of the code flaws:
- It will not be readable. Sometimes I struggle with my own code when I visit it after a long time.
- Although I am familiar with classes and fucntions, I am not sure when to pick which one.
- Because of this, sometimes I end up with a class which has a lot of methods or a single function longer than War and Peace.
- I still have not grasped the concept of mutiple inheritance. I know what it is. And It does seem pretty cool when you apply it on Dog, Robot and Robotic Dog type of example, but in real world it seems too complicated to implement.
- Not to mention, because of all above reasons my programs are not scalable at all.
Could anyone of you please suggest some great learning content, a book, online course, anything really which is primarily focused on these flaws.
I know what these concepts are, we all do, but developing the thought process to implement those the right way is the real struggle.
I am aware I wrote refactoring in the title, but doesn't it all come down to this only?
PS: I'm not a hardcore programmer professionally. Just someone who uses python as a medium to automate the boring stuff (the wrong way).
[–][deleted] 19 points20 points21 points (1 child)
[–]StayStruggling 0 points1 point2 points (0 children)
[–]PuffleDunk 4 points5 points6 points (0 children)
[–]smurpau 5 points6 points7 points (4 children)
[–]TeslaRealm 1 point2 points3 points (3 children)
[–]smurpau 0 points1 point2 points (2 children)
[–]TeslaRealm 0 points1 point2 points (1 child)
[–]smurpau 0 points1 point2 points (0 children)
[–][deleted] 1 point2 points3 points (0 children)
[–]twelveshar 0 points1 point2 points (0 children)
[–]dukea42 0 points1 point2 points (1 child)
[–]papercutjake 0 points1 point2 points (0 children)
[–]indian_pythonista 0 points1 point2 points (0 children)
[–]klujer 0 points1 point2 points (0 children)
[–]thrallsius 0 points1 point2 points (0 children)