r/learnprogramming • u/slightlypug • 25d ago
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
69
u/MrCodeGameandAnime 25d ago
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:
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!
3
u/RedQueenNatalie 25d ago
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.
2
u/serge-mv 25d ago
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.
2
u/robotman21a 25d ago
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?
2
u/RunToBecome 25d ago
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.
2
u/favgotchunks 22d 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!
7
u/[deleted] 25d ago
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 25d 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 25d ago
What are you trying to write?
3
u/Slight-Living-8098 25d ago
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 25d ago
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 25d 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 25d ago
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 25d ago
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 25d ago
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 25d 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 24d 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 24d 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 24d 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 24d ago edited 24d 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 23d 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 22d ago
I highly recommend not learning C++ as your first language. Try Python.
2
u/Sapphire8593 21d 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 25d 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 25d 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 25d 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 24d 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
u/ObjectiveDetail8498 24d ago
Im a 3rd year 2nd sem student. Is starting dsa now is ok?
1
u/2daytrending 23d 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
u/LegitimateDesk6328 22d ago
brother learn c
1
u/Dora_Rempel 22d ago
Hang in there, every coder started feeling this way at some point!
1
u/Valuable_Ad2171 19d 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
u/Hadley_Two 18d ago
Try the Odin Project at www.theodinproject.com
1
u/monkeybuttsauce 25d ago
Struggling with tutorials will teach you more than using ai. Keep working at it!
-2
u/MillennialSilver 25d ago edited 25d ago
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
jobcareer I'm watching dissolve).8
u/[deleted] 25d ago
[removed] — view removed comment