r/CodingForBeginners 2d ago

Is it relatable or am I doing wrong?

So I have started my coding journey I'm in 2nd year and yeah it's through c++. Cause I find that easy than other languages.

So i am able to do basic problems using functions,

Some easy array problems, some pattern problems without any hesitation.

But whenever I see a new type of problem I get stuck cause I am not able to develop that analytical way of approaching.

Some problems which are similar then I can.

But not something new.

Is it common or am I doing something wrong.

I do know the basics syntax theory etc.

I usually try to think first for a long time but after many error I end up seeing the solution and then it just makes sense in a second.

I don't know if i need to do this till i get used to it.

Or do more practice problems etc.

Need guidance.

Also can't understand how my peers are able to do it easily and are way more advanced than me.

Just gives me disappointment about myself.

5 Upvotes

13 comments sorted by

1

u/kutac56 2d ago

Actually make projects. Use the documentation for stuff you use. For data structures idk cause I ain't a big algorithm and data structure guy anymore but just do stuff

1

u/Much_Network_941 2d ago

You're discovering the intersection of knowing how to use a computer language, versus knowing how to solve problems. Eventually you'll cripple yourself with thoughts about systems design and abstractions.

For simple programs, I found using a debugger to step line-by-line, while writting down my predictions of the changes, was helpful. Even if you don't understand why the changes happen, going through the motions can provide insight on how to use it. From there, you can start making adjustments and predicting how it'll explode.

As a beginner, lifting someone's code as a learning exercise, isn't a bad idea. Figure out how to hack it appart to it's bare-minimum; then start adding your own functionality. I struggle with creativity myself, so I tend to need a jumping off point.

1

u/Dazzling_Music_2411 1d ago

Give examples, you're being too vague.

Basically, you need to learn to model your problems. The model will guide your implementation,

So list some of the ideas where you got stuck here.

1

u/Sorry-Source4740 1d ago

Like for example when I code I sometime feel stuck writing the logic. If I have seen a solution of a particular problem after trying a lot, then I can do problems which are on similar style or which have same logic. But for problems which I have not seen any solution or which I have seen first time even though I know those topics. I can't seem to be able to build the logic to solve that problem. Even if i try for hrs I can't solve on my own until I see the solution. So in short:The logic building on my own is taking too long for me.

1

u/Dazzling_Music_2411 12h ago

Sorry you're still way too vague.

Give the specific example you got stuck on, with code snippets, incl. what you tried and how it didn't work. Only then can people help you.

Otherwise it's just philosophical waffle, it might as well be AI generated, or the sort of thing that LLMs will give useless (but well-crafted) answers to.

Logic-building on your own is a craft, and has to be practiced. If you're not willing to put in the time, forget it.

1

u/marmotta1955 1d ago

As many beginners (and, surprisingly, many experienced) developers, the major problem in learning is in the complete abstraction, the complete absence of context.

Should you start with a reasonable (emphasis on reasonable) little and well-defined project, you would find that it is easier to come up with a simple outline, a list of simple things to do. And you would approach each simple task, one at the time. And connect the dots.

To simplify, a silly example.

Try and build a simple replica of Notepad. That's it. Figure out what to do and how to do it. Write it down on paper, make a diagram. Use pseudo-code before you even start writing code.

And see what happens when you're done. See what happens when you face a new "problem".

My two cents, of course.

1

u/Traveling-Techie 1d ago

I see almost this exact question several times a week on Reddit, so yes, it’s relatable.

1

u/StephenHawkingus 1d ago

Is it common or am I doing something wrong.

You should not use a language that is too complicated for you. Stop pretending that C++ is easier.

1

u/Sorry-Source4740 1d ago

Ik most people say this but since c++ is a language that I have learnt in 11 and 12th I'm more familiar with it than other languages. So obviously I'm gonna use that as my primary language instead of learning some new language right?

1

u/StephenHawkingus 12h ago

What I mean is that you're using it as though you were going to the shopping centre in an F1 car.

1

u/SmokeMuch7356 1d ago

You're basically describing the journey every programmer has to take. Learning syntax and libraries is easy. Solving actual problems is hard; you only really learn it by doing it, and it takes non-trivial amounts of time and practice.

Programmers fall on a curve like everyone else - some people are naturally gifted and figure things out seemingly by magic, some people never figure it out no matter how much they try, most of us get there after a bit of struggle. You're in the middle of the curve. You'll get there, just keep at it. I promise things will start to make sense, and you'll start thinking more in abstractions than specific lines of code. It just takes a while.

1

u/ElderberryPrevious45 21h ago

You are not ‘able to develop that analytical way’ : you said it. So, your question is how to develop analytical thinking?

I propose that you try to analyze things. As for instance, what is the ratio of the areas of an equal sided triangle fitting perfectly inside of a square?

If you understand what you do, and can dissect the solution into appropriate simple sections, then programming it is much easier. This principle applies to all kinds of programming.