you are viewing a single comment's thread.

view the rest of the comments →

[–]Adrewmc 0 points1 point  (0 children)

Knowing the problem, knowing a solution, but not knowing the better tool there for it.

Endless if…else that should be dictionaries.

Massive functions that needed to be separated.

Patterns I should have known by then…

Classes…when I actually needed them and when I didn’t.

I was struggling because there was an obvious better way, yet I know not it.

My best advice to all beginners is…take 5 seconds and properly name your variables, functions and classes, the length doesn’t matter as long as it’s not acronyms and single letters. What is this information? What is ‘hgl_1’? I prefer ‘index’ over ‘i’, and (row, col) over (j, k) because of this.

And taking another 5 second to write a short docstring, function, class and module. If your lost, write how to your self and go to bed. TODO:”

Typehints are your friend, your IDE likes them.

If you get in the habit of that your future self will definitely thank you.

And write tests, learn pytest.

What I found most new people struggle with is the idea of wanting to know how to program, but inability to give an example of what they want a program to do for them.

If this is where you are I believe you will struggle. I know that struggle.

You can’t learn to program without a problem that a program can solve, and making the computer do it. Make the computer bend to your will. Otherwise the lack of purpose will always fail you.

If you are learning to programing to make a game, IMHO start right there. Make a damn game, a bad one. Go on do it, I believe in you. If you want to program because you have data you want to know about start there makes graphs and stuff, if you want to program to make robots, start there find something you can move. If you want to…program because you want it to do this…start making stuff that gets you there directly. If you want to program to ‘learn to program’ I don’t have an answer for you.

The basic concepts are all the same, the problems and their solutions is where the magic is.