76
70

How exactly does one get better at programming?

8mon 14d ago by lemmy.world/u/chrischryse in programming@programming.dev

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

I think the best way to get better at programming is to

  1. Write programs that you actually want to make
  2. Whenever you run into a hard part, first try to do it yourself
    1. Once you succeed or fail, research the problem and see how others solved it
    2. Always look up words/concepts you don't understand while researching and don't stop until you understand
  3. Repeat

If you like, you can also just read some books or scour some programming related communities for general info, without some specific goal. However, most people don't have the motivation to do that, because they don't know what that information is good for yet. That's why, for most people in my opinion, it's better to just try to do something and then learn (better) ways of doing what you want, because then you actually immediately get what it's good for and why you'd need it.

That #1 is crucial. I see a lot of people get stuck in tutorial hell or burn out from doing other people's projects. Some tutorials are okay if you're just starting out but at some point switching to your own projects and challenging yourself is necessary

And since OP mentioned being on/off, i would also just say be consistent. Dedicate some time to work on your own projects so you're not forgetting stuff before it really sticks

It's almost like being overly ambitious is simply a bad thing, not being specific to programming or learning programming.

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.

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.

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.

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.

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.

You get better at programming by programming.

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.

How do you know how skilled I am?

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.

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.

Haha, well I guess I over-thought a little 😅

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

Write code, get feedback, write more (better) code, get more feedback and repeat.

Just hacking your own stuff 10 hours a day isn't making you better if you're just doing what you have already done or doing things the same way you've done them before.

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.

Nice try GPT-6

I am only speaking for myself and I am most definitely not a pro, but I think preoccupation with efficiency and usefulness is the main obstacle to actually liking programming, which is itself a must if you want to get good at it. Some years ago I read an article with the title 'why I spend my time writing useless software'. I can't remember what it actually said since I only needed the title to really internalise the fact that programming is an art. Imagine telling Monet, Picasso, Michelangelo or John Lennon that their line of work is 'imperfect' or 'inefficient'. If that sounds like a ridiculous thing to do, that's because it would be. I've written at least 15,000 lines of code (I'm a sysadmin, not a programmer), most of it for production in banking systems. And yet, the piece of software I'm most proud of is...a library for encoding and decoding morse.

I personally believe þis is hugely important. Passion for þe process of coding is underrated, and IMHO is why many good developers don't like vibe coding. Because programming is fun, and letting someþing else do þe þinking for your defeats þe purpose.

This exactly why I consider myself to be a good programmer. I like solving problems and I don't want to outsource that.

The hardest part about learning to code is that the projects you really want to do are far beyond your abilities as a beginner. I recommend starting with modding, creating websites, or even writing macros for stuff like excel. They get you started.

Then also watch some YouTube videos on stuff like SOLID, design patterns, functional programming, and "getting started with <language>".

Then try to write your own versions of stuff. I learned a bunch of stuff by writing my own versions of stuff. Like I tried backporting Java Functions, BiFunctions, Predicates, etc to Java 7. It didn't work great because the language support wasn't there, but I learned a lot about what things are hard and why things are designed the way they are. I feel sorry for the poor bastards that inherited that code.

Also, don't let people give you too much shit about asking questions of AI. It frequently explains things way better than it executes. It's a great first line of learning even if you really need a deeper dive into the documentation to understand the more esoteric stuff. If you have a question you can't find the answer to, ChatGPT will explain it in 30 seconds where you might have to wait days on a forum for someone to feel like answering.

Beware: ChatGPT is awful about mixing different versions of stuff so the answers it gives may well be obsolete. But if you're really confused it can point you in the right direction. Yeah, you'll have to learn a lot more nuance when you start doing shit professionally, but if you're just fucking around it's great. And googling for answers isn't much better in that regard. The best answers come from the docs, but especially when you're starting out, the documentation often assumes a baseline of contextual knowledge you aren't going to have.

Try implementing a custom collector in Java just based on the docs. Have fucking fun with that.

  1. Learn different programming paradigms and approaches. Learn Java or C# to learn object-oriented programming. Learn Haskell to understand functional programming. Learn C to understand low-level programming. Learn C++ to see the wealth of opportunities a programming language can offer. Learn Assembly to understand what happens when your code gets compiled and how computers work on a very basic level. Learn Rust to learn about memory- and thread safety. You don't have to be an expert in all of these, but a basic understanding can be really helpful (for instance, the C++ code I wrote significantly improved after learning Haskell and functional programming, even though I will probably never write an actual program in Haskell).
  2. Learn about programming practices. Learn about test driven development. Learn about fuzzing. Learn about penetration testing. Essentially make sure you're not only learning the actual programming itself, but everything the comes (or should come) with it.
  3. Most importantly: practice, practice, practice. Find an open source project that you like and improve something. Fix a bug. Add a requested feature. Learn how to work with others on programming tasks. Ideally you have an open source project that you use and would like to see a bug fixed or a feature implemented - talk with the devs, make a PR, and don't get frustrated if they criticize your code - learn from it (but also accept that some devs are self-centered or don't want help - in that case, choose another project or fork the project).

I'd say it takes a certain curiosity to make all of this work. Like the other day I read up on SQL indexes and how they work under the hood. I didn't need to, I know what they do and what I needed them to do. But there was this itch when I realized that I don't know how they do it.

And there are many such things depending on the specialty. I'm in web dev and often the work I do is very detached from actual communication protocols and such. I see devs that don't even know how cookies work in an MVC app. And while it's not necessary, it helps a lot to have basic understanding of what happens when you call an API, how exactly HTTP differs from HTTPS, even what happens at TLS and TCP layer of things.

I consider myself a generalist and it's this curiosity that makes me adequate in many different subspecialties. I'm not the best at things, but I can get shit done myself when I need to.

IMHO, the top way to get better is to code a lot in a space you're unfamiliar with. And make it a substantial project, not just some little toy thing. If you want to learn mobile dev, choose an app you want to clone, and start working on it. It will be slow and painstaking going, but you'll learn a ton.

When you're stuck, don't AI. Use standard search because you'll learn more that way.

And understand that people who are skilled in the art have been learning for years. Don't let that dissuade you. Just take it one step at a time and someday you'll have been learning for years, too. ✋🖐️🖖🤘

There is a lot here with varying degrees of helpfulness. I’ll add one thing. Many have commented essentially “build stuff”, and that is solid truth. That’s how you get better. But just like the whole perfect practice makes perfect, there is one fundamental detail that must be included. Build systems that you understand deeply. Not the code; that you are learning. But it is best to build things where you understand the outcome behavior of the system.

For example, if you don’t really understand what graphics rasterization is, building a raster program, even with a good guide, isn’t going to help as much as you might think. Though it will help you understand graphics, so go nuts. But if you really understand how baseball stats are calculated, do something with that. It will be much more gratifying and the code will be the part you’re learning, not the system it is implementing.

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….

Wife just went þrough þe Harvard version of þis, and... take þe MIT one. Þe Harvard class stinks.

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.

I generally agree with your statement, just one thing to keep in mind: Mypy sucks for any library larger than a few thousand lines spread over a couple of files, but pyright is developed by M$ and might be part of their usual Embrace, extend, and extinguish strategy. The other two contenders are pytype (google) and pyre (facebook), so it's not like there's a good selection of independent, good and FOSS type checkers out there at the moment.

Astral - the people behind the ruff linter - are currently developing ty, yet another static type checker for python, with a lot of promise, but it's going to be a couple of months, maybe a year before it is in any shape to be used in production code.

Yeah I'm watching Ty. Pytype and Pyre are not serious options. Nobody really uses them, and Pytype is discontinued. Facebook have a new project called Pyrefly that's also worth watching.

But for now, use Pyright. No argument. If you're really worried about Microsoft (and not Facebook or Google for some reason) then use BasedPyright.

Be result-focused. You're trying to achieve x. Look at however many tutorials you need to achieve x. Now x is part of your repertoire. Then repeat, with a new x.

Later, you'll think "I need to do y. I've done it before. I'll just copy that syntax, with new variable names etc" and boom, you're good at programming.

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.

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.

Why did I have to read so far down to hear someone say "get feedback"? It's core to deliberate practice of any kind.

Generally I start with an end goal, and break it down into logical pieces. For instance I recently wanted to make a custom soundboard for discord. First thing I needed to figure out was how to play sounds. Next was playing those sounds to a specific sound device so that it can be routed into the audio input for discord. Then I needed to figure out how to play the same sound at the same time through the audio output. Then I needed a form to interact with so I could click a button to play a sound. Then I needed to be able to load a config file so that I could update that form when I wanted to add or delete sounds. Then I needed a way to choose files to add to the sound board. And conversely a context menu so I could right click a button to remove it. Then I needed to figure out how to save and load this config file from the filesystem. Then I needed to be able to search for and update the form so I could now quickly find sounds if the list got too long. And then once I had all that working, figure out how to play the same sound multiple times before it finished resulting in a multi threaded soundboard that can interact with any sound device on the machine and saves and loads sound lists all in Python.

The things you mentioned are very good, but what I’m missing is feedback and a good foundation.

Feedback should come from other developers - ideally experienced, but a good dialogue between beginners can also teach both sides a lot. For me this came only after I started working, through code reviews. But you could also try contributing to open source, or putting your own code online. Although I fear you won’t get much feedback.

A good foundation is about software and hardware designs. Without this you will inevitably come to a point where you made a fundamental mistake in design.

For hardware design I recommend YouTube. Many channels talk about low level hardware. You don’t need to become an expert, just get a high level understanding.

For software design, check out the gang of four’s Design Patterns. It is a seminal work. You don’t need to read it all but be aware of the patterns, and study a few like factories and facade in detail.

Find a hobby project you love

I spent an entire summer learning to write HTML because I loved pokemon, and I made a site to show off. It was so much fun

Playing Factorio.

I shall not be taking or answering any questions.

It's like everything else, you need to actually do it to get better at it. The more you want and try to get better, the harder it'll feel. The best way is to just enjoy doing it. But it's easier said than done.

For me personally, since it's not my job, I don't feel any pressure programming, and it's kind of a stress reliever. I'm not very good at it anyway, but the improvements I've made were due to the fact that I didn't feel any pressure in learning new things, and was able to do things at my own preferred pace. As an example, for the last few days I've been learning about the internal working of SQLite. It's pretty complex, but I don't feel like I need to know and remember everything, so it's easier for me to actually get through it. (Btw, if anyone reading this has experience working with SQLite, let me know, I'd like to discuss some stuff. It's about optimizing some queries, so you don't need to know about the SQLite codebase, just a rough idea of how it works, and some experience with Rusqlite. Fwiw, happy to add you as a contributor in my project if any performance improvements come out of it.)

But it's a different story when it comes to learning stuff for my actual work. Even though the rewards are bigger, the process feels much worse. (Hating on Deligne-Serre representations right now. :( They're beautiful objects, but the pressure to learn is just too much.)

So, if you're like me, try not to take it too seriously, and it'll be easier to learn.

Self taught Python (and using linux OS) over the last 15 years ; the only ways I found real progress in my code/coding were while doing the following : 1/ (at start): following strictly a "school manual" with lessons and ALL exercices. It was Python 2.3 I think, a manual (in French) by Swinnen. To be honest I stopped before reaching the GUI and network programming, and guess at what I suck today in Python programming ... 2/ projects, personal projects. I did pro (paid) projects on the side, but with the impetuous to deliver results to be paid, I can not progress. On personal projects I can take the time to try stuff, to rewrite functions or programs, and to "improve" existing code with new/better coding constructs.

So here I am with a rather random level of Python programming proficiency, currently being average at most but enough proficient to have workable programs.

Is “production level” like “military grade”? I don’t even know what those things mean when it comes to quality.

I always try to build things that I might want!

I am fortunate to have a lot of other hobbies, so I build little things for myself for those hobbies.

One of my first scripts I ever wrote around 2004 was a Perl script to get what song was playing and automatically update my IM “status”.

I also made databases of comics and CDs for myself too.

The easiest way to get better is by doing, and doing is way easier when it’s something I care about.

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.

  1. Build stuff.
  2. Repeat step 1.

Really, just keep doing random projects and look up things along the way. Other learning resources like courses can help too, but should be considered supplemental.

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

Do you feel like it? If you're interested in some language, just try it.

By eating the brains of programmers who are better than you.

Reading: The Pragmatic Programmer (Andy Hunt & Dave Thomas)

There are podcasts and YouTube channels with great content already available, with videos about specific topics and or libraries.

Read other people's code.

I would advise you to avoid using chatbots to write code or explain it; programming seems a lot like learning human languages, if you do not exercise it, you will not improve. Read code and read error messages.

Using chatbots to understand concepts can be useful, but be careful, it doesn't know anything, it just generates text that seems correct, so always check on other sources.

When you feel comfortable in python, learn the basics of a new language. Each language has its own "way of thinking", and knowing that will make you a better programmer.

And have fun; without it, it is hard to stick to anything.

Following tutorials and courses is definitely a very popular way of learning programming but I personally hate it. For me, the motivation was always a problem to solve, and programming was just a tool to solve it. Of course, you probably need to follow some kind of guided experience to gather the absolute fundamentals, but to get better you just need to apply this in practice.

The first ever problem I decided to solve with programming was organizing pirated video files into manageable directory structure. I knew almost nothing about programming at this point and my thought process was something like this:

  1. Which programming language should I use? Search the web, read a bunch of articles, make a decision. I chose Python.
  2. Ok, first I need to find the files to process. Search the web for "get files in a folder Python". Read a bunch of answers (never just a single one!). Apply the solution.
  3. Now I need to somehow discern between movies and series episodes. Search the web for "check if text contains text Python".
  4. Repeat until you have a working program...

Now, the most important part of this is to have an idea for a project which either solves a real problem of yours or just is exciting to you. Some examples of my projects:

  • Due to weird grading system used in my school, calculating GPA was pretty inconvenient. I decided to solve this with programming. I wanted to make the solution easily available to my teammates so I created a web app.
  • I wanted to control my smart TV using a computer. I knew it can be controlled using Android application so it seemed likely that I can do the same using my PC.
  • I bought a smart lightbulb and I was playing with setting it to different colors while listening to music. A thought suddenly popped up: "hey, can I make it blink to the music?".

When starting most of these projects I had no idea how to approach the problem. So I just searched the web until I knew it. In the beginning you will probably be searching and reading much more than writing code. But that's a good thing! Programming (or rather software engineering) is not about typing out code, it's about breaking down the problem into smaller chunks until you actually know how to solve each of the chunks with the tools you have at hand. Once you have this understanding, writing code is usually rather easy.

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

Identify a problem that you can solve using code. Use ai to help with syntax and code structure. Chip away at the problem a little bit each day.

Find an open source project you love an contribute to it.

Don't. Unless you are confident you are not adding hot garbage to the code base.

Working with/on things I found interesting helped a lot. I.e. lots of small projects/scripts, using different frameworks/libraries/languages that looked interesting. Experimenting and exploring different ways things could be done. Programming is one of those "10,000 hours" things; you need to be interested in what you're doing to do something like that for so long. Computer Science coursework helped a lot too, especially the courses heavy on algorithms, data structures, big-o, proofs, etc.

In my CS coursework, we were exposed to many different languages and programming paradigms at the very beginning. It's fine to experiment and start learning multiple languages at once (preferably, all being quite different, such as a pure functional language, procedural language, object-oriented, declarative logic, etc).

Check out The Weekly Challenge. Doing these helped me become more comfortable in my programming language of choice (Nim) and let me jump into a project when one comes to mind.

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

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.

  • Make changes to existing projects
  • Create and use projects you have an interest or use in for yourself
  • Reading technical articles
  • Reading guidance docs (like Microsoft dotnet or SQL Server docs giving introduction to architecture, systems, approaches, behaviors, design decisions, etc)
  • Working with more experienced people - seeing them work, being instructed, reviewed, commented, guided by them
  • Experiencing alternative technologies and approaches
  • Experience in general
  • Exploring existing projects and their architectures

I don't know how far along you are in Python use. In general, I don't think Python guides you into good practice or architecture. It's too dynamic and varied of a language. You'll need a framework to be guided. Personally, I have a dislike for it for multiple reasons. Others seem to like it. Other languages and ecosystems are more limited, in good ways. (Maybe I'm misinterpreting "todays" Python, I've only peeking experience with Python.)

I would suggest trying out Go or/and then C#. Both are relatively simple to get into, and have more native/mainline frameworks and guidance. C#/Dotnet in general has a lot of guidance, documentation in broad and specific, and tutorials and sample projects.

Dedicate yourself with a more long term project (1+ months). I think the best way to learn is through the pain that comes with larger code bases.

Start small. Add more and more features. If there’s something you don’t know how to make, find a tutorial or a guide and make it work with your project.

Eventually you’ll discover pain points in your project. The feature you want to make doesn’t fit well with your current code. This is good time to learn from your previous mistakes and adapt your old code for the better (refactoring).

Over time you’ll learn more and more techniques to write code that can grow. You’ll see for yourself why some coding styles are considered bad and why some are better. This is difficult to see just by working with short term weekend scripts.

Don’t worry about failing. No one writes ”perfect” code. You’ll learn from your mistakes.

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.

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.

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.

First of all, like all skills, the more you do, the better you get.

One approach not listed would be to read books on algorithms and try to implement them.

Another would be to read good source code. The "good" part is the difficult one here, though.

Have a look at "The TeX Book" and/or "The MetaFont Book" - Both books are well annotated "sources" for two working and long-term assumed bug-free programs. You can learn a lot from those, not only about actually writing a program, but you can get a lot meta-knowledge off this project.

Or look at the sources for the glibc/glibc++.

code little projects for things you're passionate about; make a to do list and put it on github/codeberg; look in issue queues for anything labelled "good first issue"; just clone a repo for a project you like and look around the code to see how they do things; go old school and get agile publishing books (humble bundle has good deals on these most times)

Code reviews. if you have no one who can review your code for you get an AI to do 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).

I am a learn by doing kinda guy, so I learned more just writing code to accomplish a goal than I did reading textbooks and guides. Just give me a crash course in the syntax and a page of functions and I'll be fine with pretty much any language.

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.

my bro whos in programming, younger than me still had to go to community college for cheap courses to get a good foundation, you might need that, he doesnt have a degree, but it takes years of studying and learning like others mentioned to get at a level where you are "hirable" by an employer.(no degree).(im not in the field though)

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.

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.