I’ve been wanting to learn how to code for a while so I figure now is as good a time as any to start. I downloaded VS code on my laptop for python but I don’t really know end product I should try to code and I also am just bad and barely know what I’m doing. Does anyone here have any advice on what to code and how best to learn?

  • Max-P@lemmy.max-p.me
    link
    fedilink
    arrow-up
    1
    ·
    1 year ago

    Been coding for 17 years, started when I was 13. A few advices in no particular order:

    • Don’t let yourself get demotivated. It can take a while before it clicks and you feel like a real programmer. That’s fine! My fiancée is coming up to 3-4 years, and she’s barely starting to feel competent at her job. Stuff is hard, and the people you see online with massively deep knowledge has been at it for a really long time, or at the very least, has a lot of experience coming up to that.
    • Code quality is important, design patterns are important. But what’s more important is coming up with something that works: don’t get demotivated by people telling you your code is bad. Take the advice, consider the improvements, learn about the value of said improvements. But getting a project working, even if it’s horribly slow, even if it doesn’t work well, is a success. You made a thing, and it works! Celebrate the victory!
    • It’s very easy to become overwhelmed by the size of a task. Take a deep breath and deal with things one step at a time. Everytime you’re stuck, try to divide up the problem into smaller and smaller steps until you figure it out.
    • Try to work on projects that are fun for you. If you’re not into gaming, don’t make a game, even though it’s a good starting point. Try to find small utilities you wish you had, and make programs to help you with those tasks. It helps feeling rewarded for your efforts rather than feel like you’ve completed a throwaway project for the sake of learning. I got into this because I wanted a website, and so I learned how people make websites. If games are your thing, there’s nothing wrong with starting with something like Godot or Unity or some other free game engine. Heck, if you’re having troubles with a spreadsheet, learn how to make Excel macros.
    • Most programming concepts are portable between languages. Everything related to algorithms, how you approach problem solving, will work mostly the same in other languages.
      • If you feel like you just don’t vibe with a language, it’s worth trying another one for the sake of trying. Establish parallels between them, learn the differences and how it makes you feel about your development experience.
    • If you get overwhelmed and don’t go anywhere, don’t give up. Allow yourself to take breaks, come back to it later. Go at it at your own pace. Having fun makes it a lot less of a chore.
    • Another good way to start is by modifying other people’s code for your needs. Got an open-source software you like but you’d like to switch things around, even just for fun? Figure out how to compile it, make some changes. Observe how it’s made and take inspiration from that.

    Also, there’s embedded programming languages in a lot of things. Many games come with embedded languages to do things, often called “scripts”. Heck, for just dicking around, you could install ComputerCraft for Minecraft, and automate some stuff in-game with the turtles. I’ve seen a fair amount of people get into coding that way: start with just simple things and you’ll find yourself wanting more.

    Did I mention, try to have fun?

  • Hangry @lm.helilot.com
    link
    fedilink
    arrow-up
    0
    ·
    1 year ago

    Do you have a virtual machine, or a filesystem that you could mess with?
    A good project idea would be to manipulate files on your system. Sort them, duplicate them, add programmatically one line to their content. The possibilities are plenty and you can see the result of your code.
    Besides that, look for tutorial repositories on Github (or codeberg.org).
    Last but not least, VSCode is my personal favorite, but you could check out PyCharm for beginning, as it has more features out of the box.

    • 14th_cylon@lemm.ee
      link
      fedilink
      arrow-up
      1
      ·
      1 year ago

      A good project idea would be to manipulate files on your system. Sort them, duplicate them, add programmatically one line to their content.

      you really think this is good advice for someone who just downloaded their first ide and are asking what to do next? i think you skipped few steps ;)

      • Hangry @lm.helilot.com
        link
        fedilink
        arrow-up
        0
        ·
        1 year ago

        This is why I said it should never be done outside of a VM or sandbox. But you are right, this is playing with fire haha.

        • 14th_cylon@lemm.ee
          link
          fedilink
          arrow-up
          1
          ·
          edit-2
          1 year ago

          that’s not the point. the point is person first has to learn how to print hello world and few other things, before they get to manipulating content of the filesystem.

          it is like if person asked “so i don’t have a driving license and have no idea how to drive a car, what should i do to change that?” and you would reply “well there is this cool racetrack where people are driving their muscle cars at 100 mph and they really know their stuff, you should join them!”