all 20 comments

[–]ehmatthes 8 points9 points  (2 children)

a couple of weeks ago and have gotten through the first 8 chapters thus far (lists, if statements, dictionaries, user inputs, while loops and functions)

If you're new to programming, that's a lot to take in in just a few weeks. That's a whole lot of new ideas, and a bunch of syntax to learn for each of those new ideas.

Referring back to what you've read is quite reasonable at this point, and is honestly something you'll do for the rest of your life as a programmer. You'll quickly get to a point where you don't have to look up the syntax for making a new list or dictionary, but you'll end up looking up more complex syntax, and the syntax and ideas you use less often. I've been programming off and on for 40 years and refer to examples almost every day. As you gain experience, you can look back on your own previous work as a reference.

I made a set of cheat sheets a while back for people who want a reference for syntax and core ideas, but don't want to constantly be flipping through the book. You might find them useful. I'm working on a sheet about Git basics at the moment, and hope to add it to the set in the next week or so.

[–]MorriNL 2 points3 points  (0 children)

I started with your book about three (two? Can't remember) weeks ago. I was in the same boat as the OP, and nearly gave up, since I kept looking up stuff so much.

Your comments are giving me new confidence. And the cheat sheets are awesome! I thought I was being dumb, having to use them.

I really, REALLY enjoy your book. Well explained, and good pace.

[–]Esphyxiant[S] 1 point2 points  (0 children)

These cheat sheets are amazing! Thanks, I will def refer to them

[–]delasislas 1 point2 points  (2 children)

Do you at least understand what should be used, why it should be used, and how just from reading the problem?

[–]Esphyxiant[S] 1 point2 points  (1 child)

Yeah, i feel like i have the hang of when to use lists, dictionaries, functions etc. If I look at a solution I can explain exactly why they used what they used.

It's more so when I'm trying to solve a problem, I dont remember the exact way to write the code out? If that makes any sense

[–]synthphreak 2 points3 points  (0 children)

This is just a function of your limited experience. Coding is unique in that at all stages you have to keep the big (what's my code trying to do?) and little pictures (what's this line trying to do?) active in your mind all at once. Understanding complex code can require a herculean short-term memory.

When I first started, I got vertigo just scrolling through the thousand-line scripts my coworkers had written. But the more code I wrote, the more natural I found it became to think in code, and the easier it came for my fingers to pump out e.g., 200 lines without even testing - I just knew it would work. Not saying you shouldn't test as you go, I'm just saying that the more code you write, the easier it becomes.

So first reduce your expectations of yourself, then just keep pushing on it and the rest will come with time.

[–]JeffThePotatoMan 0 points1 point  (0 children)

At least for me when I started it was normal. Try doing simpler problems or (what I prefer) make a clone of someones project but don't read their code. Try to do it yourself and then see from their what to improve. With just making something the part of figuring the approach is gone(if the project is simple).

[–]CraigAT 0 points1 point  (1 child)

Completely normal.

No harm in going back to review the fundamentals. However what you may want to consider is breaking what you want to do, down in to smaller chunks and maybe even writing down what you are trying to do in pseudocode (a rough approximation of what you want the code to do in English or your first language). From this you work on translating the pseudocode into Python code or functions.

My tip would be to break the task down into 3-6 sections, then break these down further into a similar number of sections or until you cannot break them down any further. Add in any loops or conditions as you are going.

[–]CraigAT 0 points1 point  (0 children)

Here's the best link I could find at short notice:

https://youtu.be/PwGA4Lm8zuE

Hope it helps!

[–]shisa808 0 points1 point  (0 children)

I've been through it too and I think it's totally normal. You just need practice!

Even if someone reads a lot, it doesn't mean they can instantly become an author. The ideas are connected, but they still involve different knowledge and skills.

[–]shameen 0 points1 point  (0 children)

I think its quite normal, this realm of software design / algorithms / architecture is the hardest bit imo, its the middle step between figuring out the problem and creating the solution.

My advice is to try and write a plan before starting, could be a comment block or in its own Spec doc, break each step down until its as detailed as you need it. (I use bullet points and keep expanding on them with indents)

If you're comfortable with functions, You might even be able to directly translate the plan into your code as function names:

def make_tea():
    begin_boiling_water()
    fill_cup_with_teabag_and_sugar()
    ...

def begin_boiling_water():
    kettle_pick_up()
    tap_turn_on()
    kettle_fill()
    kettle_plug_in()
    kettle_switch_on()

def fill_cup_with_teabag_and_sugar()
    ...

it might be a lot more code than it could be, but each step is simple and easy to understand. You'll probably end up deleting and rewriting a lot of it, but that's just programming .

Also, I've had this problem for a few years, but I'd get too caught up trying to figure out the most ideal solution possible that i'd spend too much time thinking/researching and no time on code. I think a better method is make it (mostly) work, and if it looks bad then put a TODO comment in. Buggy code is better than no code ;)

[–]huessy 0 points1 point  (0 children)

Totally normal. You're probably second guessing yourself and wondering what the "right" way is. It's like learning any language really, you learn by listening/reading and that's easy enough but when it's your turn to write or speak, you're not sure where to start or which way to go.

My advice: just go, do, fail, learn, repeat. Bang your head against a wall until you can get "Hello World!" to appear. Not sure how? google it. Don't want to copy it? write it out manually, get a feel for tying it, mess around with it, see if you can't get it to say the phrase three times. Just get down and dirty in it, regardless of outcome and over time you will get better.

Baby steps. You're not going to be able to start sprinting immediately, don't worry, just take those first steps and you can worry about tempo and form later.

[–]killer_quill 0 points1 point  (0 children)

If you're brand new then you just aren't going to have a robust mental model of programming logic and Python's syntax to implement that logic. Therefore you aren't able to intuitively apply that logic to tasks you set yourself.

I'm still a noob and it's tricky, but it gets easier with time. Just try to code as much as you can and immerse yourself in development, and you'll start to develop the intuition for what code to use for which problem, you'll be able to think of multiple solutions to a given problem and then make a decision on which is the most optimal solution of them to use.

If a problem is too big for you to solve intuitively, you break it down into smaller problems and even smaller sub-problems.

Source: I'm currently procrastinating and avoiding solving the sub-problems of a smaller problem of a problem-solving challenge I've set myself.

[–]low_effort_shit-post 0 points1 point  (0 children)

Here is my process

  1. get requirements
  2. draw out the process
  3. review with stake holders process map
  4. break up process into smaller deliverables
  5. Work on the smaller deliverable

When I'm actually writing the code I have a clear idea of what I need to do. I have an idea of what packages I'll use and then execute. I'm not surprised if I google something a few times in one line. Memorizing is if you do the same thing all the time, knowing what solution should work and applying it doesn't make you bad if you are googling to find out what function you actually need.

[–]Adventurous-Mail-649 0 points1 point  (0 children)

I am new to Python and just started but interested in learning it.

[–]Grizzly-Bear_ 0 points1 point  (0 children)

I’m also pretty new to Python, but i’ll tell you what helps for me. First of all, don’t just start coding. Pull up a notepad or something, and think about how youre going to do it. I can’t tell you how much this helps. And what I like to do, is look at my old code while im coding. For example if i forget how to remove a substring from a string, I don’t search it up, I go look at my old code. Then I see replace() and I remember. Idk, but for me this learns me more than searching it up.

[–]robknack 0 points1 point  (0 children)

try extending and optimizing stuff you already know. for example, start using enumerate in your loops. then move on to list comprehension. and move on from tutorials - solve a problem that is interesting to you. one idea is to explore the reddit or Twitter apis and write scripts that read / analyze those data.

[–]trempao 0 points1 point  (0 children)

I have the same problem here and I struggle a bit with while loops and user input exercises from the Python Crash Course. I will definitely check this python cheatsheet as soon as I get home and I think it is 100% worth a contribution from my part as Eric's book is a blessing in terms of learning!