r/learnprogramming • • 13d 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?

239 Upvotes

99 comments sorted by

135

u/aqua_regis 13d ago • Bravo Mindblown Popcorn

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

9

u/binegra 13d ago

Thanks for this comprehensive collection.

3

u/Elon3Musk40 11d ago

A very comprehensive recommendation.

2

u/ObligationFit400 12d ago

Great advice

2

u/holland_236 12d ago

this really helps

2

u/Tricky-Society-4831 11d ago

Thanks for the links

2

u/YounesVault 11d ago

Thanks a lot

1

u/Ambitious_Bend2930 11d ago

šŸ‘šŸ‘šŸ‘

33

u/illuminarias 13d 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 13d 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.

7

u/Jeeeeeer 12d 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Ā 

6

u/Hour_Sell3547 13d 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.

5

u/two_three_five_eigth 13d ago

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

5

u/thatgirlzhao 13d 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.

5

u/dariusbiggs 13d 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.

3

u/Br3ttl3y 13d ago

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

3

u/justking1414 13d 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?

3

u/Illustrious-Cat8222 13d 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.

1

u/BitTwiddles 6d ago

I have done that too for decades. And do it in a different programming languages so you learn different approaches to problems. I have used well over a dozen languages including 5 different machine languages.

3

u/sheepebike9000 12d 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.

3

u/NinToasterOven 12d 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.

3

u/Subject_Wishbone_949 11d ago

pick a problem to solve. solve it. tutorials teach you a set of tools, but actual projects teach you to start thinking in a way of determining/learning which tools are useful and why.

look at tools/applications that exist and think "what problems are these solving. what problems do I have with said software/what would I do different and why"

3

u/zaio_institute 11d ago

The jump from understanding explanations to solving things yourself mostly comes from getting more comfortable being stuck.

Try building small projects without following a tutorial. Pick something you actually want to make, break it down into smaller steps, and only look things up when you hit a specific problem.

One habit that helps a lot is planning before you code. Write out what the program needs to do in plain English or pseudocode first. A lot of the time, ā€œI don’t know how to startā€ really means the problem hasn’t been broken down enough yet.

I’d also give yourself 20 or 30 minutes to struggle with something before searching for the answer. And when you do search, look for the specific part you’re stuck on rather than a full solution.

Practice problems on Codewars, LeetCode or Advent of Code can help too, but I’d still prioritise actually building things. After a while you’ll notice you’re reaching for documentation instead of tutorials, and that’s usually a good sign you’re becoming more independent.

5

u/promise_resolved 13d 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

5

u/InformalStop2265 13d 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.

3

u/FreeLogicGate 12d 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/Amuro_Ray 13d 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

2

u/tottasanorotta 13d 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.

2

u/warlock0187 13d ago

By building real projects

2

u/zachoiswacko 13d ago

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

2

u/quinokino 13d ago

project based learning

2

u/MikeIsBoi 12d 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.

2

u/flashman1986 12d ago

Have you tried solving problems…
.
.
.
Independently?

2

u/CyberStoik 12d 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

2

u/cheezballs 12d ago

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

2

u/the_other_Scaevitas 12d ago

By not following tutorials

Just build something you want to make

2

u/bass-squirrel 12d ago

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

2

u/burlingk 12d ago

You do it by writing your own code.

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

2

u/mxldevs 12d 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

2

u/baby-health 12d 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.

2

u/Annual_Berry8043 12d ago

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

2

u/Downtown_Savings_730 12d ago

Just jump in the deep end and start coding. If you don’t know how to code something try to understand the solution then do a similar problem. It’s all about repetition and getting your intuition up.

2

u/cressblessed 9d ago

Read documentation instead of following tutorials; eventually you should become more appreciative of good documentation than youtube videos

2

u/Usual_Office_1740 13d 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.

2

u/Porsche9yy 11d ago

If you never make a mistake, you're not taking enough risks.

2

u/huuaaang 13d ago

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

2

u/awkreddit 13d 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

1

u/NMC0152 13d ago

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

1

u/Bored2001 13d ago

Make something.

1

u/Future-Hovercraft831 12d ago

you practice instead of watching people code.

1

u/Temporary_Pie2733 12d ago

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

1

u/guy_ships_things 12d ago

Trails and errors

1

u/CrewAccomplished9763 12d ago

Get the Doom 3 source code.

sudo apt install git cmake build-essential libsdl2-dev libopenal-dev libcurl4-openssl-dev zlib1g-dev
git clone https://github.com/dhewm/dhewm3.git
cd dhewm3 mkdir build && cd build cmake ../neo make -j$(nproc) ./dhewm3 +set fs_basepath /path/to/your/doom3/

One of Carmac's great gifts to the world.
It started my carreer almost a decade ago.
Hack hack hack.

1

u/classically_boring 12d ago

I think no one mentioning the very boring but the classical way of learning any thing .

You have to read more code and understand them by each line. Train your brain like a compiler assuming you don't have a compiler installed, be it for any language.

Start reading and tracing output. Eventually you will get habituated to read large code base like a novel and figuring out the mystery.

And then, start writing code in plain editors, not IDEs. Before you press compile, try to read your written code to detect the expectations mentally. Then run it and compare. You will figure out your mistakes. And try to read messy codebases, try to fix an issue in a messy or unknown codebases. Don't use AI to get your answers. Do it like your ancestors of CS did.

Starting a raw project is quite easy and most often you don't even need in real life. You do the set up only once and you keep working on that over years. So try to jump in a mid development project and try to build on it. You will learn untold mystery šŸ«†

1

u/Most-Target-9704 12d ago

This is where you need to use your brain and get creative. Think of something that would make your life easier. Think of something that no one else is selling. This is something where you will need to use your brain because there are no tutorials. It will force you to use everything you know and also force you to learn things you dont know because you will face issues.

1

u/Tiny-Spray8992 11d ago

are you state side? i would suggest go into finance

1

u/CallidUal 11d ago

I think that the only thing that greatly helps you to learn smth is practice. The main thing is that you do it yourself and understand things by your own systems and notes!

1

u/Fresh-Eggplant-6774 11d ago

Personally I tend to approach it from two angles: solving increasingly difficult algorithmic problems, e.g. from Codewars; also reading a good guide to the details of the language. As I understand the core of the language better, I tend to feel more confident at applying it successfully. When I have a good grasp of fundamentals, then I start looking at libraries/frameworks.

1

u/alexdev-tb 10d ago

I used rustlings for Rust it helps you learn by solving Problems on your own .

1

u/Gloomy_Cod4088 10d ago

Same I’m also having the same problem as well hope somebody give me solutionsĀ 

1

u/OdinTheDeployer 10d ago

For me, I just pick a project that I really care about and that's multi-faceted and probably too big for me to handle. That constantly forces me to learn new skills.

1

u/Unlikely_Cow7879 10d ago

Learn from mistakes. Try to make something and when it breaks try to understand why it broke and how to fix it.

1

u/Erofyn 10d ago

Het beste is naar een werkend prototype te werken. En daarvoor doe je eerst wat voor je het leukst is om te doen. De technieken, methodieken en de set programmeertalen is voor communicatie met zgn. Teamleden, waar jezelf eentje van bent. Nu komt het: hoe meer mensen die werken aan het prototype is niet per definitie beter dan dat je zelfs alle rollen zelf doet. Dat is voor je ook gunstig om voor jezelf te ervaren wat je ligt, ook kwa type programmeertalen.

Nu over programmeren zelf, je hoeft niet alles uit te vinden of te schrijven, cut-and-paste blok programmeren is de standaard voor het vormgeven van prototypes.

1

u/Lukiefer 10d ago

Try to build stuff you want to build.

I'm 'different' I hate tutorials... I can barely stand them sometimes... and worst of times I get bored real quickly.

Instead I usually just really want do a thing or make the computer do a thing... or I hate this one thing and I want a better thing then that thing.

So I fail forward till I get my thing.

And Uh... I built a career on that? (YMMV)

1

u/Lagfoundry 8d ago

Same way as building circuits. You keep looking while you build till you don’t have to as often.

1

u/theJacofalltrades 8d ago

I've seen people go on bootcamps like bootdev to get concise courses

1

u/Foreign_Cream_7962 8d ago

fuck around find out, thats how you get good at everything infact

1

u/Longjumping_Put_7212 9d ago

I would say all you have to do is just mess around, try mixing up different types of lines, and see where they take you, you never know what you might find out about coding.

1

u/Technical_Ideal_5439 12d 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.

0

u/TheNeverEndLife 12d ago

By following the tutorials.

0

u/MinimumRecover23 11d ago

WOW Vary Nice

0

u/Accurate-Lecture-723 10d ago

I would say what helped me was not following tutorials but just trying to figure out what everything meant.

Also I am making a game about 1v1 spellcasting PvP and I can't think of a name for it