So I’m an on/off noobie but have been focusing on actually sticking with programming what I’ve been working on is Python but this question is for programming in general. For me it’s hard but I want to see how I can get better

Like are these good ways to get good:

Follow tutorials, then work on ways of adding your own twists or changes? Or trying to code it in something else?

Work on assignments from a resource you’re using like in my case Python Crash Course and attempt to redo the assignments without looking back?

Experiment with multiple libraries and library methods or built in methods?

Please share any other ways especially ones that helped you

Also when would be good to start a new language after learning one

  • FizzyOrange@programming.dev
    link
    fedilink
    arrow-up
    7
    ·
    2 months ago

    I would say:

    1. Just practice, do projects. Also if you can work on projects with other people because you’ll read a lot of bad code and learn how not to do things (hopefully).

    2. Learn lots of programming languages. They often have different and interesting ways of doing things that can teach you lessons that you can bring to any language. For example Haskell will teach you the benefit of keeping functions pure (and also the costs!).

    If you only know Python I would recommend:

    1. Learn Python with type hints. Run Pyright (don’t use mypy; it sucks) on your project and get it to pass.

    2. Go is probably a sensible next step. Very quick to learn but you’ll start to learn about proper static typing, multithreading, build tools (Go has the best tooling too so unfortunately it’s all downhill from here…), and you can easily build native executables that aren’t dog slow.

    3. C++ or Rust. Big step up but these languages (especially C++) will teach you about how computers actually work. Pointers, memory layouts, segfaults (in C++). They also let you write what we’re now calling “foundational software” (formerly “systems software” but that was too vague a term).

    4. Optionally, if you want to go a bit niche, one of the functional programming languages like Haskell or OCaml. I’d probably say OCaml because it’s way easier (it doesn’t force everything to be pure). I don’t really like OCaml so I wouldn’t spend too much time on this but it has lots of interesting ideas.

    5. Final boss is probably a dependently typed language like Lean or Idris. Pretty hardcore and not really of much practical use it you aren’t writing software that Must Not Fail Ever. You’ll learn loads about type systems though.

    Also read programming articles on Hacker News.

  • Lojcs@piefed.social
    link
    fedilink
    English
    arrow-up
    4
    ·
    2 months ago

    In addition to ‘just write anything and stick with it’, getting someone who knows what they’re doing to look at your code and criticize it can be useful.

    • zalgotext@sh.itjust.works
      link
      fedilink
      arrow-up
      3
      ·
      2 months ago

      I was gonna say, having my code reviewed by senior devs and SMEs was the single biggest factor in me progressing as a developer. That doesn’t mean you shouldn’t research and try things by yourself first, but having your code looked over by expert eyes will point things out to you that could otherwise take years for you to learn to notice on your own.

  • ozymandias@lemmy.dbzer0.com
    link
    fedilink
    arrow-up
    6
    ·
    2 months ago

    MIT made several of their classes free online, CS 101 will teach you python and foundations of programming….
    https://ocw.mit.edu/

    tutorials just teach you how to do one specific thing, not general coding….
    it’s kinda hard but you can go at your own pace… just remember a class is supposed to take months, not a couple days, so it’s okay to take some time doing it….

  • Just keep coding. Feel free to use as many guardrails and tools as necessary in your IDE (linters, auto completes, mouse over definitions, etc) to make it easier. To use a language metaphor, you want to be focusing on how to communicate, not on things like who vs whom, the subjunctive case, or adjective order. If you need projects, there are plenty of lists out there, but doing something you actually care about and breaking it down into chunks small enough to do is probably more sustainable than a bunch of random tasks someone else recommends.

    As for learning new languages: when you have to. If there’s something specific you want to do and it’s only done in a specific language, then go for it, but there’s nothing inherently good about knowing multiple languages, especially if spreading yourself thin prevents you from improving in your main language (or is detrimental because it muddles the patterns you’ve learned in each).

  • Ŝan • 𐑖ƨɤ@piefed.zip
    link
    fedilink
    English
    arrow-up
    3
    arrow-down
    7
    ·
    2 months ago

    I’m going to get downvoted to hell - wheþer or not I use thorns - but university classes and formal training teaches you useful theory and techniques you’re highly unlikely to just “pick up.” Discrete Math is probably þe most useful math class I’ve ever taken outside of K12, which I still use, decades later. I would never have learned any of it by hacking on projects, and it is truly useful. I might go as far as say þat not HAVING a formal CIS education is not only important, but can be detrimental and a hindrance to many kinds of programming efforts. Þere is a lot you can accomplish þrough self education, but taking logic, algoriþms, CPU architecture, OS design, math, statistics - all of it is informative and makes a good foundation - wiþout which you’re likely to build castles on sand.

    Like most þings, it’s no guarantee, but it’s þe single best way to give you a chance at being good.

    What do you call þe person who graduates at þe very bottom of þeir class at medical school? “Doctor.” Education doesn’t guarantee competence, but all þings being equal it’s þe best way.

    • PodPerson@lemmy.zip
      link
      fedilink
      English
      arrow-up
      4
      ·
      edit-2
      2 months ago

      Only downvoting for your repeated use of the thorn. No one uses old English anymore and it’s silly to try to just throw those conventions in because you think it’s hip. Distracting to read.

  • rozodru@piefed.social
    link
    fedilink
    English
    arrow-up
    10
    ·
    2 months ago

    I’ve been doing this for well over 20 years now and I taught myself by building Geocities sites and random stuff.

    Just build things and push them to a repo. Have an idea for something? build it. could just be something like a TUI for Mastodon or like an eReader with AI driven text to speech, I don’t know i’m just spit balling here but my point is you just have to build stuff. It’s like anything, the more you do it, the better you get at it. Like drawing. you just draw something every day and eventually you get good. it’s the same for coding. just work on something every day and you’ll get good at it.

    So just build something or contribute to your favourite open source project.

    • koala@programming.dev
      link
      fedilink
      arrow-up
      1
      ·
      edit-2
      2 months ago

      And also, you learn to make programs of a given difficulty by making programs of a smaller difficulty first.

    • inzen@lemmy.world
      link
      fedilink
      arrow-up
      2
      ·
      2 months ago

      This. For me personally It helps to think of programming as as craft. It also helps a lot if you have someone more skilled than you available to discuss.

        • inzen@lemmy.world
          link
          fedilink
          arrow-up
          4
          ·
          2 months ago

          I’m not sure I understand the question but I will try to answer. I did not mean to question you skill in particular, I know nothing about you.

          I agree that programming requires repetition e.g. more programming, that’s why I said “This”.

          What followed was a generic advice that helped me personally to improve a lot as a developer. I got the chance to work side by side with developers experienced in different types of projects, developers I consider more skilled than me in different ways. I consider this avaluabe experience.

          Hope that clears it up a little, nothing to do with you’re skill in particular. English is not my first language so maybe my phrasing is a little weird.

          • Diplomjodler@lemmy.world
            link
            fedilink
            arrow-up
            4
            ·
            2 months ago

            You wrote:

            It also helps a lot if you have someone more skilled than you available to discuss.

            Which could be read as you addressing me directly. Which of course I’m aware was not what you meant. I was just trying to be funny.

  • slazer2au@lemmy.world
    link
    fedilink
    English
    arrow-up
    1
    ·
    2 months ago

    Experiment with multiple libraries and library methods or built in methods?

    I would argue that you shouldn’t use external libraries. No need to import and entire lib to do one function, try making the function yourself. Yes it will not run as good but you can then optimise from there and see how the library does it after.

  • limer@lemmy.ml
    link
    fedilink
    arrow-up
    1
    ·
    2 months ago

    After coding a lot, and talking to many people, I have decided that while most people can be trained to be decent programmers; the critical ingredient is both an interest and the ability to sit down and do it for long periods of time.

    As long as you have both you will find your path.

    For me I learned a lot by reading books, coding my own things, and reading other people’s code. Often on first read, I was intimidated. Sometime I had to take a while to figure out new things. More than once I had to stare at a few dozen lines of code all afternoon.

    It really helps to have a debugger to step through each line of code as it runs . This shows the values of variables at each step

    And that assumes the code runs at all. I learned to debug my own code, when it would not run, by making every conceivable error several times until I could read the output in my sleep and know how I messed up. That takes a while to make that many errors!

    But debugging is definitely very important

    • vrek@programming.dev
      link
      fedilink
      English
      arrow-up
      2
      ·
      2 months ago

      Since the op is talking about python, I recommend pythontutor.com it is a visual debugger and not only shows the values of variables but shows the scope which each variable exists in.

  • melsaskca@lemmy.ca
    link
    fedilink
    arrow-up
    1
    ·
    2 months ago

    Lots of good advice here. I’ll add a bit more that is non-technical. Get and study the book “Symbolic Logic” by Irving M. Copi. It’ll help you to think more critically and expose you to different logic patterns. More philosophical than technical but I see it as being like math for words. As with everything, you get better over time if you keep at it.

    • BlameThePeacock@lemmy.ca
      link
      fedilink
      English
      arrow-up
      6
      arrow-down
      1
      ·
      2 months ago

      Repetition doesn’t improve programming in many situations. Even when you get stuck. I could write a bunch of nested if statements every single day, and If they work, I wouldn’t get stuck and ever learn that there can be better ways to do it in many cases.

      Especially for people like me, who self-learned and didn’t take any courses, I simply don’t know what I don’t know.

      Everything from O notation to Object oriented programming is abstract in a way that you can’t accidentally learn it. I had to find these concepts and learn them, and not because I got stuck.

      • jasory@programming.dev
        link
        fedilink
        arrow-up
        1
        ·
        2 months ago

        Time and space complexity can become very prevalent, you can quite literally see it from the runtimes. Unlike OOP, which in many cases (Java excluded), you can get away without ever writing it.

      • Azzu@lemmy.dbzer0.com
        link
        fedilink
        arrow-up
        7
        ·
        2 months ago

        Well… At one point, these abstract concepts all did not exist. The first people to invent them did get stuck and had to invent them to do what they want.

        Maybe you’ll never “learn O-notation” by yourself (why would you call it O?), but if your program is slow and you don’t know how to solve it, you are actually stuck, and need to think about why your program is slow. And eventually you might figure out that no, you don’t need to iterate over all of your entries times all of your entries, it might just be possible to iterate only over all of your entries. And now you have learned “O-notation” or that O(n²) is slower than O(n).

        What I’m saying is, when people say repetition, they don’t mean “write if statements again and again” but “solve problems creatively again and again”. Many people have never learned creative problem solving, and so they’re stuck writing if after if.

        • BlameThePeacock@lemmy.ca
          link
          fedilink
          English
          arrow-up
          3
          arrow-down
          1
          ·
          2 months ago

          If you had to re-invent everything that came before you, there would never be any progress.

          Humans achieve progress by learning from other humans.

          I actually learned O notation from an interview question for a job I applied for, I’d never actually had a program run too slowly before that.

            • N0x0n@lemmy.ml
              link
              fedilink
              arrow-up
              2
              ·
              edit-2
              2 months ago

              Haha, I feel that… My first bash script to loop over my files and use mkv or ffprobe to modify either metadata or encode my files were if statements for every file xD

              It worked but was ugly as fuck, tedious and surely not efficient… I had to change each file name manually…

              I keep those scripts as “things of the past” to remember myself where I come from :) I’m still chuckling seeing those horrible things, but they worked and I was happy that I did it all by my self :D.

  • ExperimentalGuy@programming.dev
    link
    fedilink
    arrow-up
    3
    ·
    2 months ago

    This isn’t exactly answering your question, but one thing I see a lot of people get wrong is not knowing how to express what they’re trying to do. An example I recently ran into would be when I was trying to enforce that an input to a function is a child class of an abstract class. If you express the problem with the right vocab you won’t end up googling “how to make sure a variable is of the right type” and getting a different answer completely. I find that having taken classes and followed through books has helped me the most because the vocabulary to define my problem is ingrained in me. That’s what I’d recommend the most, is increasing exposure to concepts and vocab so that it doesn’t feel weird when you have to express a new problem.

  • Agility0971@lemmy.world
    link
    fedilink
    arrow-up
    1
    ·
    2 months ago

    Learn different languages. A tool is good for problems it was designed to solve. Here is a list of programming languages i would recommend in addition to python.

    • c
    • elixir
    • rust
    • go This would give you different perspectives on how a problem can be solved. And stay far away from jacascript.

    Tutorials are nice to get the mechanics of the language but you should not stick with them for a long time. Start doing your own projects as soon as you feel comfortable with the language.

  • 0x01@lemmy.ml
    link
    fedilink
    arrow-up
    2
    ·
    2 months ago

    I’ve taught a few developers and have pretty extensive experience on the topic

    Tutorials are fine, but don’t get stuck on the idea that you need guidance through the whole process, it’s better to avoid tutorials entirely than it is to follow a bunch of tutorials.

    For example, when I started out my most recent student we began with some challenges that I knew would provide some context for future projects, then immediately jumped into those projects. Depending on what you’re passionate about, the best project for you can differ, but we did the following projects:

    1. A lemmy face wizard page, literally just a list of lemmy faces that clicking on will copy to your clipboard
    2. An invoice maker, since they needed to send me invoices because I was paying them for their time
    3. a react native sudoku app, this one was challenging and took them a couple months, but when they were done they took over one of my contracts for mobile development

    And the challenges that led to these projects? Everything from basic algorithms to api interaction puzzles.

    My advice would be to pick something that you love and come up with the tiniest project you can possibly think of, then cut the scope a little more.

    For example, love pokemon? Maybe make a website that you can click on one of the types and it will highlight the strengths/weaknesses of that type. Love golf? Maybe make a golf score tracker mobile app, a big button to add a stroke and another to move to the next hole.

    If you are passionate about something it gets a lot easier to get better at programming because the stuff you’re missing will become obvious and you’ll need to look it up to finish your project.

    My very first project nearly 30 years ago was a windows 95 app that moved your mouse to draw in mspaint automatically.

    I’d say starting a new language is a pretty big mistake until about 4-5 months after you feel proficient with your first language. Starting over with new syntax has actually caused more than one of my students to quit

  • asudox@lemmy.asudox.dev
    link
    fedilink
    arrow-up
    1
    ·
    2 months ago

    The best way is to try and make projects you want to make.

    It is important to make ones that you really want to do yourself. I don’t know how it is with the others, but I immediately got demotivated after a day of trying to develop something someone else made just for the sake of learning.

    In my experience, you will learn better and faster by developing things you actually want to develop. And you will also be rewarded with a good amount of dopamine.