I’m a beginner in programming, and I found out I cannot even reproduce a simple number guessing program I have earlier copied from a book.

Is it a beginner issue, or there is more than just continuing to learn to be able to code without hints?

  • Lovable Sidekick@lemmy.world
    link
    fedilink
    English
    arrow-up
    0
    ·
    16 days ago

    Hard to say without knowing more about the problem. I mean, what went wrong with the code you copied from the book. Could be a simple typo, and example code sometimes also has typos or is just wrong - surprisingly, authors sometimes confidently type in code exampoles without running them. Carefully comparing the code you entered with the code in the book might reveal the problem.

    • pixeldaemon@sh.itjust.worksOP
      link
      fedilink
      arrow-up
      0
      ·
      16 days ago

      It was not wrong - I literally could not remember what and in what order I had to write, although I did remember most of the general concepts introduced in the program.

      The original code worked fine when I was simply rewriting it looking in the book

      • folekaule@lemmy.world
        link
        fedilink
        arrow-up
        1
        ·
        16 days ago

        Programming is mostly understanding something abstract in your mind not rote memorization.

        Even for a very simple program, focus on understanding what it does and how it does it, and why, step by step. Write things down when you learn something new.

        Reading and understanding code, especially good code, will make you a good programmer. Just writing a ton of shit code will not. Trust me, I’ve done this for 3 decades and learn something new almost every day from reading other people’s code.

        So, focus on understanding what it does, and you will be able to modify and build programs from scratch soon.