I'm trying to learn programming and something I struggle with the most is trying to separate code mentally into chunks where I can think through the problem. I'm not really sure how to describe it other than when I read a function to determine what it does then go to the next part of the code I've already forgotten how the function transforms the data and I get stuck trying to figure out the solution. So instead I'll often cludge something together just to make it work but I don't feel like I made any progress. Has anybody else run into this issue where they struggle with abstracting code from text to mental instructions?

Edit: Thank you all for the suggestions and advise. I wish I could reply to everyone but there's been a lot of good information given and I have some ways now to try and train my brain to think about how to break down the code. It's also a little reassuring knowing I'm not the first to have these same struggles.

  • Kissaki@feddit.de
    link
    fedilink
    English
    arrow-up
    2
    ·
    1 year ago

    Contributing to existing projects as an introduction is very hit or miss. Project and task complexity vary immensely, supporting docs and guidance are most often non existent.

    I love Advent of code as a concept, but I agree - at least the ones I worked on - have a steep difficulty/scope curve.

    Something like a tic tac toe game is great because it is visual, interactive, and iterative as well as relatively small in scope. Any project you have a personal interest in and that has some or most of those properties is great.

    The Web technologies HTML css and js are great to get into programming but I feel like it's bad for teaching software development as software engineering, because it doesn't guide towards or ensure structuring and good practices. Which I thought you were talking about at first, but I guess you're not at that point yet with on and off beginnings.

    Going back to your original description, functions encapsulate a work unit. Use it to name and define behavior so that you can combine and hide away complexity in a defined and obvious manner. Separation makes overall complexity manageable because you can look at subsection of it.

    How did your tic tac toe game go? Was that something that worked out well?

    Have you looked at other projects? For example other tic tac toe implementations and how they did it? Which can be hit or miss in quality and readability of course.

    In my opinion the best way to learn, or environment to learn, is teaching or/and guidance through a good senior. The second best is interest and personal projects. Even if it's small hacks or projects, and even "unfinished" projects can give experience and knowledge.