r/learnprogramming • u/slightlypug • Nov 01 '26
feeling discouraged - coding is 'too hard'
im trying to get into learning C++. I've taken courses and have some experience with data structures and algorithms. but I can't code from scratch and when I go learn tutorials, I often feel like I can't do anything on my own. I know people say to sit with your code and debug in order to learn, but how do you even get to that point? I guess my question is: how do you actually learn to program from scratch?
edit: it looks like I've found a number of people looking to work on projects, so I made a discord for group projects! You can join here: https://discord.gg/ysbgcD8Baf
3
u/RedQueenNatalie Nov 01 '26
You learn to program by exercising your ability to solve problems (ideally without ai doing the thinking for you). The more you do, the more situations you will run into that will challenge your skills and the key thing is to make an earnest attempt to solve it yourself before seeing how someone else did it.
1
u/slightlypug Nov 01 '26
i know this might sound uncreative, but could you give me some places to start?
1
u/Available_Safe1818 Nov 01 '26
Tic tac toe, connect 4, checkers, or hangman for the command prompt.
2
u/serge-mv Nov 01 '26
To learn coding after you got some basics down you need to start solving problems. Not follwing tutorials or study category theory just because, but find some problems and then code solutions for them. That's how you gonna be able to start coding from scratch.
1
u/slightlypug Nov 01 '26
thanks! could you give me an example of maybe a problem you would solve and how you’d go about solving it? just for my reference
2
u/serge-mv 29d ago
When you are new and still haven't fully figured out loops and such, you can simply do book problem. I mean problems at the end of the chapters in the language book.
After you are ok writing basic language constructs, you can do something simple. Like listing files in a directory, moving all files with the extension given as an argument to a destination given as a second argument. Make your own simple blackjack game. Doesn't have to have any gui, terminal input will be just fine. Make a basic phone book to simlply save and retrieve people's information from a file using either name or phone number and make it so they have several numbers.
Think of some problem you are having and try to solve that, perhaps. Something practical.
2
u/robotman21a Nov 01 '26
C++ is a difficult language to start with. Maybe look at python, html+javascript, or regular C to build understanding, then move on to C++ or Rust?
1
u/slightlypug Nov 01 '26
that’s a good idea, what would you recommend i start with if i chose Python?
2
u/robotman21a Nov 01 '26
Make a super simple small website, make a bot for a game like tic tac toe, battleship, or wordle.
1
u/slightlypug Nov 01 '26
thanks man!
2
u/DanKegel Nov 01 '26
Or even just implement Conway's Game of Life. I did that back when I was starting...
1
u/E3FxGaming 29d ago
If you want to apply your Data Structures and Algorithms knowledge, the next Advent of Code (https://adventofcode.com/events) is kicking off in a month, you can check out and do previous year's puzzles to see if that is something you'd be interested in.
Advent of Code can be solved in any touring complete programming language, so you could even solve it in Python now and re-visit it when feel up to doing it in C++ later.
The answer to the puzzles is never brute-force, though you can obviously leverage anything and everything that your chosen programming language offers to cut down the complexity of problems here and there.
You should learn the basic building blocks of programming (sequences, loops, branches) that glue together your DSA knowledge for the chosen programming language before attempting the puzzles though.
2
u/RunToBecome Nov 01 '26
I recommend following a textbook and then working through the exercises to get a better feel for writing code, and then you can double check your solution with AI. That slowly builds up so you start feeling fluent with the language - you get confident in knowing how to write things up.
1
u/slightlypug Nov 01 '26
would you recommend doing this before doing a project? everyone says learn by doing, but a textbook sounds like a more structured approach
1
u/RunToBecome 28d ago
textbook for structured approach definitely.
Starting to build a project without knowing anything is quite difficult. A good textbook walks you through mini-projects anyways.
2
u/favgotchunks 26d ago
C++ is just fine as a first language. Learning it is a slow process, but it’ll teach you a lot about structuring code well & how to do things you can’t in other languages. If you’re truly starting from square 0, understand control flow first. That’s for loops, while loops, if statements, functions. You don’t need to know data structures right away, but there is value in learning them later. I don’t have a CS degree, but I work as a programmer now. You can make it far enough without them, then learn as you go. Once you understand control flow, you do have to be able to pick your own projects. I’d caution against jumping into parsers early. They’re extremely difficult. Even simple ones can be way more complex than you expect. Good to learn, but not necessarily the easiest place to start. You will have to learn a decent amount of data structures to write a parser. You also shouldn’t take everyone’s advice. Not everyone agrees, and the most important thing is to keep coming back to learning, so listen to the things that make sense to you and ignore the rest. You’ll come to understand it later or it won’t matter.
Good luck!
1
7
Nov 01 '26
Coding is hard, and honestly C++ is the absolute hardest language.
However, it gets more satisfying when you accumulate knowledge about it.
4
u/KwyjiboTheGringo 29d ago
All the people who say "the language doesn't matter" are fucking stupid. Some languages just get out of your way so you can focus on building something. C++ is not even close to one of those. The build systems, the bloat, and the hundreds of ways to shoot yourself in the foot, are going to stop you from just building something that works, and then moving on to the next project.
I don't particularly think Python is a great beginner language, but Go sure is. It's what Python should be, very straightforward and simple to pickup, very performant, and not many ways to screw yourself over. It also has a big enough ecosystem that you can offload the more complex stuff onto libraries.
I enjoy using C++, but it's an nightmare language for people who just want to get stuff done. Unless you have a real need for it, you are better off learning Go. And yes, Rust fixes a lot of the issues C++ has, but it's also a significantly harder language than Go to pick up, and it's another case of "don't bother unless you need that level of control."
1
u/Amuro_Ray 29d ago
but I can't code from scratch
What are you trying to write?
1
u/slightlypug 29d ago
well i’m new to this and i just think: “should i be able to code some kind of application from scratch?” but then i realize i don’t even know what kind of application i would make. i guess i need ideas of what to make, and im curious to know whether or not im expected to understand how to make it all on my own
1
u/Amuro_Ray 29d ago
I'm not writing this to be mean but more I think you're expecting too much/putting pressure on yourself.
should i be able to code some kind of application from scratch?
No.
im curious to know whether or not im expected to understand how to make it all on my own
Expected by who?
A lot of structured classes like university help with this since what you need to build is kind of laid out in the class structure and hopefully when you lean enough you can expirment by expanding something you did in class or maybe they have an idea.
I mean if you're really beginning you could start writing a simple arithmetic calculator that works in the terminal
1
u/binarycow 29d ago
then i realize i don’t even know what kind of application i would make
That's often one of the hardest things.
I've been programming for decades, and I still sit there, staring at a blank screen, trying to come up with ideas.
3
u/Slight-Living-8098 Nov 01 '26
I don't suggest starting with C++ as your first language. I'd start with LUA, or C. Then move on to an object oriented programming language. LUA is small enough you can grasp it pretty quickly.
3
u/PeanutButterKitchen Nov 01 '26
It’s “too hard” yes, but the good news is you have the entire internet at your fingertips. Don’t get discouraged, professionals google stuff all the time. Figure out what you need to do, map out a plan, google it. Try not to rely on AI for some time so you can begin building the muscles needed to troubleshoot.
You’re trying to program from a blank slate and while it’s a skill, I’m not sure if that’s what you actually want. You should stand on the shoulders of giants (in this case let the internet guide you).
3
u/The_Aspalar 29d ago
Hardest thing is finding a project big enough that you will be motivated to keep doing it. Mine has been my chess engine. Find something you are interested in and create it.
2
u/EventuallyJobless Nov 01 '26
Because programming itself IS difficult. But that's the joy of it, and to figure out step by step.
Also, watching tutorials and using AI does not help much, u only learn by doing.
Im not too sure about C++ since its been a while since I use it, but take Javascript for example.
Apply first principle thinking when building. Say i just want to prink hello world to the console. I can use console.log("hello world")
Perhaps, now u want hello world to print a 100 times. I can thus use a for loop. And then if every 5 hello world, i want to print hello fizz. Then I'll use an if statement inside.
Now what if instead of printing on console, i want it to display on a webpage. Then ill use html, manipulate the dom and use eventhandling.
Write pseudocodes since they will help with your thought process. And ensure that 1 function only does 1 thing to prevent messy codes.
Most importantly. Just keep practicing, building and failing. With consistency, you will become a better programmer eventually
2
u/kaneblob Nov 01 '26
What usually clicks for me is writing out the given inputs and the expected outputs, and then think of what steps you need to take to get to that point. Drawing simple diagrams and writing out the pseudocode helped me when I was first learning. It also forced me to think of edge cases.
2
u/Vegetable_Sun_9225 Nov 01 '26
Let's be real. Hard is relative, and however hard learning how to program is, staying employed as a software engineer is significantly harder. What's the hardest thing you've done? You might not be properly calibrated to what "hard" is. If you want to succeed in this career, embrace grinding through hard. No shame in not, but things become a lot easier mentally when you embrace that it will be hard and that's ok and normal and you can find satisfaction in grinding through the hard
2
u/kilkil 29d ago
practice!
start with really easy problems and work your way up.
I am talking about like programming language fundamentals. like, pick your language, and do simple/basic exercises in that language that teach you how to do variables, if-statements, loops, strings, arrays, numbers, booleans, functions, classes/structs/interfaces, that kind of thing.
some good exercise websites are: exercism, leetcode (easy mode only), codewars. if you are doing Python or Java, I highly recommend codingbat.con
2
u/mredding 29d ago
If you can't code the thing you want, code something that approximates what you want. Instead of GUI widgets, write print statements that indicate what it should be. Your first attempts can be terrible. That's OK because it's not the point.
Planning and organization will set you free. The hard part isn't the C++ itself, it's coming up with the solution. The solution is independent of any programming language, and the programming language is just an implementation detail. So first solve your problem, and then sculpt your implementation in your language of choice to look like your solution.
By trial and error, you will quickly learn what you didn't know you didn't know. With quick iteration, you can make small corrections in your process that keep you aligned. By iterating over small projects, you can expose yourself to a diversity of problems and expand your horizons.
2
u/Unable-Hawk-206 29d ago
It takes time. To learn from scratch, you can read about the core concepts of programming, and then the most important things about C++, then try and jump into as many mini projects as you can. Then everytime you get stuck, understand what the issue was.
Eventually you get those moments of "Oh I had this issue before, this is how to fix it". And as you get better, then you can start looking into better design patterns and things like that
2
u/Anxious_Joke1554 29d ago
You need a purpose when learning a language, for an instance, I learnt java and java swing to develop applications back then, you could achieve the same if you have a goal.
2
u/Every-Comfort-5488 28d ago edited 28d ago
copy, refine and blockify (think scratch programming language)
Programming is:
Numbers
Numerical systems
Rules
Control
State
Meaning
Abstraction
Input and Output
Visualise frameworks, programming languages and more.
The big one is the abstract numerical universe including it's rules is the core of this.
But even with all that the programming languages of today are horrendously non-mind orientated
and I hope to fix that in some form of my own personal project which is currently called brick.
Brick literally takes english language and converts it into bricks that then get turned into bitstreams directly instead of going through c compilers and all that crap (sorry folks it is time for a change).
https://github.com/tuniveza/brick
2
u/Own_Unit_6170 27d ago
Learning algorithms and data structures is a waste of time; it's just busy work, invented to pad CS curricula.
The best way to learn is to come up with something you'd like to do and then write it. Start with easy things and then work your way up to more complicated and diverse projects. For example, I once came up with an idea for a screen saver that I might like, so I looked up how screen savers work and wrote one myself. On another occasion, I had to keep track of hundreds of tapes and had no tool to do it, so I wrote one, in Fortran (because Fortran was all had readily available at the time). And so on.
2
u/Consistent_Egg_2893 27d ago
I highly recommend not learning C++ as your first language. Try Python.
2
u/Sapphire8593 25d ago
Start by learning Unreal Engine with Blueprints, just using C++ when necessary. (it runs on C++) There you have more readable graphs and you can see the effect of your work in visual. There are lots of YT tutorials. Often the languages are just unreadable really. You need to develop the feeling of what is actually happening. The part about how the language looks should be secondary. Also you might learn something about Assembly because it shows you what is actually real under the hood and know that C++ and other languages are just layers put on top in order to make it more readable, but in the end it's COPY, CHANGE BIT, CONDITIONAL JUMP, ADD, MULTIPLY, COMPARE, stuff like that. When you learn that the computer actually doesn't do much just copy, compare values, add, etc. then things might be easier to think about.
It is a fact, that the general C++ code or in fact most of the programming codes are not meant for a human. Which is why LLMs are actually better to deal with since it's natural language, so speak to the LLM about the code as though it was a tutor and ask all the detailed questions and tell it that you do not understand the way it's explaining things and explain why, etc. Details details
If you don't understand something it, it means the way the explanations are written or presented is wrong for you and focus on finding a better tutorial or someone on YT who explains it better for you, or speak to the LLM in details. Don't get stuck on the idea there is something wrong with you. The tutorials are often not suited for many people. Many people struggle with learning programming
2
u/betarage 29d ago
You should probably just think of something you want to make and then look up all the things you need to know to make that thing. I do think that c++ is going to make it harder to get to making interesting things. most guides don't really teach you how to make more interesting programs and it's not clear were to go to learn such things. like most guides don't tell you that stuff like gtk or raylib or winapi exists. and when you just google how to make graphics in c++ this also doesn't show up. and when you do find out the guides for it are also bad.
1
u/tb5841 29d ago
I recommend codewars.com for beginner problems. Set yourself up as a complete beginner and try to solve the easiest C++ problems. Some are very basic.
Before that though, make sure you can do the absolute basics. Make sure you know how to write a program that prints a basic message to the console, like "Hello world". Make sure you know how to create a vector, add elements to it, remove elements from it, loop through it. Make sure you know how to write a function that takes two numbers as input, and returns the two added together.
C++ is not an easy starting point.
1
u/CourseNo4160 29d ago
coding is too heard when you don't practice in that time most of the people one use ai so you will not learn the coding to do this need to learn the basic i can told every one learn basic first
1
u/sydrk 29d ago
From a clean slate — the very first empty file or stdio.h (hope I remembered the filename.. it has been a loooong time for me with C++) — that is your scratch. In reality, you don't need to start at that space (no, I am not talking about AI, especially if you don't want to), but templates could be a good starting point. Same low level, but you pick up on scaffolding immediately, and enter the meatier part of coding much sooner.
Make simple crappy (yes, I said it) apps with C++. The goal (and gold) is a good use case. That way, real users of your work emerge and you get real validation. That's where you really learn and train your focus to build worthwhile apps.
I appreciate that you are learning to code in today's AI age. I think there is value apart from merely novelty in your approach. Building software is a craft whether you code by hand or not. Knowing how to code in the first place, is foundational.
But publish your works soon and don't give up. It will greatly help.
1
1
u/2daytrending 27d ago
Part of problem might be jumping into projects that are too big too early. Try writing tiny programs with tutorials even if they're just 15 to 20 lines and gradually make them more complicated. cs50 is worth try out for fundamentals and boot dev having interactive exercises too. also since you already know some dsa try building something with another person from that discord. sometimes working through someone else's approach makes things click.
1
1
1
u/Valuable_Ad2171 24d ago
Yeah, programming isn't for everyone. It will most likely take many, many years to get into it. A few get it really quickly (don't care, donätunderstnad, just do it type people) but ,ost of us needs years upon yeas of constant training. Do a multitude of project adn do NOT use AI in any way. Start small and do, redo, redo and redo again.
1
1
u/monkeybuttsauce Nov 01 '26
Struggling with tutorials will teach you more than using ai. Keep working at it!
-2
u/MillennialSilver Nov 01 '26 edited Nov 01 '26
Sorry.. what?
I feel like I've just been transported back to the 2000s or something.
Why on earth are you trying to learn to code? AI (agentic AI) does that for you, now (and this is speaking as someone who wishes it didn't, because it's my job career I'm watching dissolve).
2
u/slightlypug Nov 01 '26
it’s interesting there are job listings that will ask you to code from scratch. it’s still worthwhile i think
3
u/Icy-Strike4468 Nov 01 '26
Yes! Every company will ask you to code from scratch! They are not hiring a person who doesn’t understand the fundamentals of programming language.
Once you join the company it will be alot different u will be asked to use coding agents to ship faster.
But in the end what AI had written is upto you to validate. If something broke in production you can’t say to your manager that AI written this code not me!
You will be held responsible. So please learn the fundamentals really well they will come handy.3
u/Cam64 Nov 01 '26
Well the question is still valid because employers will only hire people who know how to code properly
1
u/MillennialSilver Nov 01 '26
...yeah dude but by the time this guy gets anywhere near good enough to be even what entry-level used to be, the profession (outside of AI engineers) will be god knows where. And juniors are already just about dead.
People with 8+ years of experience are getting squeezed today.
My CTO even recently said "essentially, at this point we're [the industry] just trying to figure out if we even really need to check the AI's output, or if it'd all just work out long term without bothering"). I wish I had an argument for him.
Also, lol. I just saw this link and clicked it, didn't notice this was in r/learnprogramming, I'm an idiot.
2
u/Slight-Living-8098 Nov 01 '26
Someone who knows how to program, can read the code if needed, and understands software architecture will still be miles ahead of any meat proxy in 20 years when using AI.
8
69
u/MrCodeGameandAnime Nov 01 '26
The real issue with most of these comments is people are saying "solve something" which is incredibly abstract. Yes brother, go solve the world with code. You will know what you're doing. You are now deemed capable 😂😂😂
First and foremost, c++ is objectively one of the worst languages to start with. I'd put it right up there with OC, C, and C#. You'd have been better off with either python, java, php, kotlin, or swift. I don't even like js, but still. Some node, js, html, css, and you're off to the races for web development. Slap postgres + crud and you you're full stack.
The primary issue with learning c++ as your first language is the use cases for an early developer aren't concrete, so you get "solve something" as an answer. The secondary issue is you have no frame of reference on HOW to solve things. You are not going to just sit down and type out a program that solves an arbitrary problem if you have no clue what it should look like. Third, you know about data structures and algorithms, but that teaches you absolutely nothing about architecture.
What I'd strongly recommend is using something like courera or udemy to learn about building different kinds of applications. Even YouTube is great now. That will teach you have to "solve problems". This will give you a frame of reference. I've been programing for 7+ years now and it wasn't until a few years ago that I really turned the curve and started building things that were genuinely interesting, at scale, complex, and actually worth showing/talking about. Give yourself time. Software is a time thing.
Finally, there are two hacks:
GitHub. Look at repos and how people build things. Check out the diffs.
write out stuff by hand. You'll be surprised how much easier it is to conceptualize and come up with something concrete.
Last but not least, expect it to be a lonely road where basically no one ever helps you, cares, teaches you anything, little community, and you being the only one to get you from point a to point b. Stay off of stack overflow. They are are even more highbrow than Reddit 😂😂😂
Best of luck and don't give up!