r/learnprogramming • • 15h ago

Tutorial How do you get better at coding without constantly following tutorials?

I'm a third-year engineering student trying to improve my programming skills. I can understand concepts when someone explains them, but I want to become better at solving problems independently. What exercises or habits helped you make that transition?

109 Upvotes

48 comments sorted by

60

u/aqua_regis 13h ago

How did people do it before the internet with its countless tutorials existed (which is less than 35 years ago)?

These people picked a project, sat down, analyzed it, broke it down, split the project into smaller parts and worked individually on each part.

You are running into the typical tutorial trap where you only think that you understand the presented topics, while in reality you only copy-pasted (even if you typed the stuff out yourself).

Tutorials are good in one thing: they serve and spoon feed you the solutions, while at the same time being horrible at reasoning the solutions.

The key is to either not use tutorials at all or to use them in a different manner: When something is introduced in the tutorial, try to predict the code. Try the code on your own. Use good old Dr. Google and the documentation of the language or framework/library. Figure out what the tutorial will present you next. Do not wait for the tutorial to give it to you. Only go there once you have tried your best. Once you have done it, check with the tutorial.

Stop looking for tutorials for everything. Start thinking on your own, independently. Start learning to design solutions.

Also, change your approach to programming: Do not focus on the implementation in code. Focus on the design considerations that lead to the solution that then can be implemented in code. Code is only fairly late in the process, never the starting point.

Start away from the computer, with pencil and paper. Analyse your task. Break it down into smaller subtasks. Solve each of these your way. Write the steps down. Use flow charts, bulleted lists, pseudo code, whatever, but not real code.

Some older, closely related posts:

And finally, some book suggestions:

  • "Think Like A Programmer" by V. Anton Spraul
  • "The Pragmatic Programmer" by Andrew Hunt and David Thomas
  • "Structure and Interpretation of Computer Programs" (SICP) by Ableton, Sussman, Sussman
  • "Code: The Hidden Language of Computer Hardware and Software" by Charles Petzold

Last, a great practice site: https://exercism.org

7

u/binegra 13h ago

Thanks for this comprehensive collection.

28

u/illuminarias 15h ago

Start working on passion projects, start doing more than just what the tutorial suggests, start thinking about assumptions you have when coding, then try breaking them to see what happens.

gotta work those brain muscles somehow yknow

8

u/13oundary 15h ago

When I first started learning many moons ago, it was purely a hobby for me, so I would try to mod PC games of the era or write automation scripts for games I liked. Depending on what you're into, try to find small projects that apply to your current hobbies and that way you're more likely to stick to them. When you start feeling like you've got the basics comfortable pick a bigger project.

When you have a better idea of what the end goal should look like, you tend to have a better way of breaking down the process of getting there into smaller chunks, that's why smaller easier to define projects within your hobbies are great imo.

4

u/Hour_Sell3547 14h ago

Focus on solving problems and engineering algorithms/solutions. Coding is a language thing, mostly muscle memory. The more you do it, the better you get at it. But problem solving is an intuition which will decide what code you need to be writing.

3

u/two_three_five_eigth 14h ago

Pick a project where you would have to combine 10+ tutorials to finish it.

5

u/thatgirlzhao 14h ago

Start with a problem you’re experiencing or a product you love and build the solution. Start with the simplest prototype and then slowly add complexity. For example, if you like tracking your habits build a habit tracker for yourself. I find I am most motivated to build on my own when I feel like I have skin in the game. I also find this is the most natural way to find edge cases and work through trade offs.

3

u/dariusbiggs 14h ago

Write code. You'll still be looking up documentation and example code no matter the level you are at even as a subject matter expert.

Start small, break it into pieces, no, too big, smaller. Keep chopping until you have discreet bite sized pieces you can chew on.

Find a simple task you are interested in, write code for it.

You can go for the classics

  • manually implement a sorting algorithm
  • parse roman numerals into decimal
  • tcp or udp echo server with client
  • puzzle solver
  • pong game
  • frogger game
  • basic platformer game
  • simple web server, perhaps a REST API to say hello "name", or server side rendered instead
  • implement your own md5sum program
... etc

There are so many possibilities..

But here's a suggestion, pick one or two with a reasonable breadth of language coverage, then implement those every time you want to learn a new programming language.

Mine is the md5sum one, it covers file IO, reading command line arguments, reading from standard input and writing to stdout/stderr, parsing text inputs, using crypto/hashing to do the checksums, error/exception handling, etc. One tiny program that touches a lot of pieces in a languages standard library. And it lets me learn about the environment of the language, compilers, linting, testing, and all the devops bits to go from code to a deployed or deployable thing.

4

u/promise_resolved 15h ago

Build something on your own. You can still get help from AI or stack overflow, but you really need to build something without some one telling you what to do for every step.

You need get from point a to point b alone, and enjoy the journey and the bugs

4

u/InformalStop2265 13h ago

One of my mentors always used to say there's no shortcut to getting better at solving problems, you just have to solve a lot of problems. :) As you solve more problems, you develop your own heuristics and start to recognize a new problem as a variation of one you've solved before.

1

u/FreeLogicGate 4h ago

Indeed, and the mind has, through repetition, built the neural pathways that have been shown to excel at pattern recognition and thinking in terms of architecture and structure.

2

u/Br3ttl3y 14h ago

The master has failed more times than the student has even tried.

2

u/justking1414 13h ago

I always found it helpful to try and go beyond the tutorial.

Example: the tutorial showed me how to make a shopping list using a dictionary and add/remove things from it. Well what if I had another dictionary with prices of the various items, could I write a function to calculate the total cost?

2

u/Illustrious-Cat8222 12h ago

Take it from a retired SWE: Don't be afraid to code small sandbox programs to explore language or library features. I did that all the time throughout my career.

2

u/sheepebike9000 11h ago

It's almost the essence of being a programmer that you solve problems by breaking them down into smaller problems, which you can then solve trivially.

You need to remember things like the simple hashmap have had MULTIPLE PHD papers about them, improving them.

The skill you need is combining all the tricks you learned to solve small problems, and extrapolating them to larger problems. And then learn some design patterns. Maybe do some leetcode if you really like algorithms but want to do something with literally no real world purpose.

Essentially though, you get better at coding by trying to do something you don't currently know how to do, and achieving it. So do that. Eventually it'll be second nature.

2

u/flashman1986 10h ago

Have you tried solving problems…
.
.
.
Independently?

2

u/Jeeeeeer 4h ago

If you use AI, use it to explain concepts rather than generate code. Even if you're not copy/pasting it, it's preventing you from forming those neural connections made from working it out yourself

I'd recommend to put a persistent rule in to prevent it from generating code 

2

u/NinToasterOven 3h ago

personally i got into hobbies and niches like video game homebrew and low-level, learning about what problems they tried to solve and how. Finding a niche helps. It can get as weirdly niche as embedded devices, file formats, operating systems, compilers, algorithms, graphics, even things like cybersecurity, malware, demoscene, retro computing, archiving, preservation, containerzation, devops, libraries (standard and otherwise). You can even go down the theory pipeline and get into complexity theory, combinatorics, and the mathematics of computations.

its important to know that you can always tackle a solved problem as practice, or even read about them. Reading up on the programming of older systems and the approaches developers and programmers have taken when faced with major limitations has given me a real sense of perspective. this is also an excellent non-ai approach, if it matters to you (and really it should) since getting a good sense of judgement and wisdom involves gaining a variety of experience. Anytime you use ANY software, start thinking about how you think they approached a problem or implemented something. if the software is open source, you can go and see how it was done and compare your thoughts. You could even use ai to try to summarise concepts for you but dont let that be your only source of information, much like everything else

basically, instead of being stuck in tutorial hell, find a niche and be curious about it. you dont even need to stay in one niche for long either. quite literally just go out there and see how deep the rabbit hole can go. You don't even need to be good or even actually come up with something new, broadening your horizons into how we've approached problems gives you a lot of perspective.

1

u/Amuro_Ray 14h ago

Since your at university have you like asked your peers or the teaching staff. They probably have some good insight. When I was at university there were events and other things like research work that required programming

1

u/NMC0152 14h ago

Code a project, then use AI to suggest improvements. It's so much simpler today than when I started in 1985.

1

u/tottasanorotta 12h ago

First try to build a solution on your own that works somewhat ok. Then look for a better solution and find out what you could improve on. You can look for other people's similar projects or ask AI. It doesn't really matter what you use as long as you remember those patterns for future projects. It's important to try yourself first, because just looking up a solution will give you the illusion that you understood it.

1

u/warlock0187 12h ago

By building real projects

1

u/zachoiswacko 12h ago

Go beyond what the tutorial teaches and work on your own hobby projects.

1

u/quinokino 12h ago

project based learning

1

u/Bored2001 11h ago

Make something.

1

u/MikeIsBoi 11h ago

Honestly with enough. stubborness and creativity you can you can achieve really good results. Then using your creativity just write down solutions that interest you and see which is the one.

1

u/Future-Hovercraft831 10h ago

you practice instead of watching people code.

1

u/Temporary_Pie2733 10h ago

Following a tutorial is as much like coding as learning to spell is like reading.

1

u/CyberStoik 9h ago

By practicing solving problems on your own, sometimes by writing algorithms on paper (no computer). Also, by thinking in terms of logic and math. Start by doing simple problems on your own and move to more challenging ones

1

u/guy_ships_things 8h ago

Trails and errors

1

u/cheezballs 8h ago

You need to learn to Google, first. Literally asked every single day on here with very simple answers.

1

u/the_other_Scaevitas 7h ago

By not following tutorials

Just build something you want to make

1

u/bass-squirrel 7h ago

Pick some problems and solve them. Until you experience the need for a solution no solution will be memorable 

1

u/burlingk 7h ago

You do it by writing your own code.

At first it is hard, but you will get better over time.

1

u/mxldevs 7h ago

You need to solve problems yourself.

You don't learn how to solve problems by having someone else solve it for you and explain the solution

1

u/baby-health 6h ago

I've been working with Java for over 10 years. My advice is to build small projects on your own. When you get stuck, try to figure things out before looking at tutorials. That's how you gradually become better at solving problems independently.

1

u/TheNeverEndLife 6h ago

By following the tutorials.

1

u/Annual_Berry8043 4h ago

By failing. Make something shitty. Review it. See what you can improve.

1

u/Usual_Office_1740 14h ago

Failure. Every mistake I make teaches me something. Using the debugger and walking through my code so I can visualize the flow of data also helps me.

1

u/huuaaang 14h ago

Just stop watching tutorials. Op n a project if your own and when you get stuck, google it.

1

u/awkreddit 14h ago

I'm going to add because we never see this but it's crucial : read books about patterns, systems, about best practices, etc etc. A lot of them are available for free online

0

u/Technical_Ideal_5439 10h ago

Coding uses AI now, so you are assembling bits generated by AI. What;s important is how the bits go together, TDD and maintainability.

You simply need to stop following tutorials and build something. Following tutorials is a trap you think you are progressing and its fine the first time to learn something new but if you are relying on tutorials then you understanding is lacking.

The ideal is to have code/pattern that you wrote for every approach you are likely to chose when writing something. It does not even need to be in the same language, have a look at design patterns but you need to internalise them.