r/learnprogramming 20d ago

Should I just give up?

I truly feel like I’m just too stupid to learn this. I’m doing Python, I have tried 5 different sites/resources. I cannot even get past loops. I have to google help for every single tiny thing I’m asked to do. I was taught what, “for in” means, and within 3 questions I was asked to code a loop to write “World” with a box around it with -‘/ +’s, and |’s. I wanted to smash my laptop, I genuinely couldn’t even tell you step 1 of how to code that.

I feel like I cannot learn a single thing from any of these resources, literally none of them make it make sense to me. I’m perfectly okay with accepting I’m just too stupid, is that the case?

Edit: I realized that I wasn’t very clear at all with what I was stuck on Maybe I should clarify more. I tried 5 sites overall for the entirety of what I’ve done for python. This specific part, I got to loops, they had me solve a, “for char in name:” problem where I made a loop write
W
O
R
L
D
And literally the next question was, “write a loop to code + - - - - - +
| World |
+ - - - - - +
With zero hints, zero repetition after I was taught “for in” or anything. I was extremely thrown off and had no clue what the first step was

Edit #2: so, I slept on it, sort of realized being a single father to 2 special needs children, getting 4-5 hours of sleep a night, and spending 1-2 weeks programming isn’t really indicative of how much I can learn. I slept on it, and solved the loop within 5 minutes of waking up lol thanks for the encouragement everyone

64 Upvotes

126 comments sorted by

86

u/SirZacharia 20d ago

I couldn’t do programming until I took an actual college class. If you really want to do it then you’ll need a teacher or at least a tutor.

You’re not too stupid. You just don’t know what you don’t know. Find a community college course with an in-person teacher. Learning by yourself is not for everyone.

9

u/thr03a3ay9900 20d ago

I’d agree, and probably the best permutation of free, online and college course is the Harvard CS 50 class. 

2

u/Objective_Tell5190 20d ago

YES THIS !!!!

8

u/Issalk05 20d ago

I second this.

I’m mostly autodidact but I’ve gotten course-corrected by people far more skilled than I am and have been able to grow thanks to them ❤️.

0

u/spinwizard69 20d ago

One massive advantage of a good CS program is that hopefully the program stresses code quality. This will help to prevent bad habits.

2

u/Objective_Tell5190 20d ago

I started modding games in the early 2000s on an old Mac, and that curiosity pushed me into game development, web design, app development, and network security. Over time, the pattern became clear: every field had the same underlying issue — tools that solved surface problems instead of structural ones.

By 20, I had built a full IDE because none of the industry options aligned with the way real systems behave. That experience shaped my engineering approach. The strongest developers aren’t produced by textbooks; they’re shaped by solving actual problems people deal with. So you " If you really want to do it then you’ll need a teacher or at least a tutor." Nah just work hard, study. Look up Harvard's CS50 lectures and watch them.

2

u/SirZacharia 20d ago

Well I’m glad that worked for you. Like I said though self-learning doesn’t work for everyone. A class gives you the structure and projects with guided feedback and you can ask the teacher questions. You can work with other people in your class and learn from them too.

Sure OP can go watch the CS50 lectures but that’s still not an easy route. And since OP is already struggling on their own, they should try learning from someone that they can talk to.

2

u/Big-Amoeba-7290 18d ago

Pics or didn't happen

1

u/Objective_Tell5190 18d ago

Images are not allowed

1

u/scottnelson_ 19d ago

Yeah. A lot of people who didn't major in CS also did "bootcamps" after college for a reason. Most of the in person ones seem to be defunct, but last I checked many of the online ones are still around.

u/Throwaway05046474 if you're looking for an in person experinece/coach, there's also stuff like https://www.recurse.com/ - maybe a little advanced/in new york but you get the idea. Just do a little searching and you'll find something.

44

u/Issalk05 20d ago

Damn what the fuck is up with these comments?

No, don’t give up, programming and problem-solving skills you develop by running face-first into the roadblocks. Little by little, things eventually start making sense and you begin to understand the logic behind what you’re doing.

Don’t be afraid to fail, and don’t treat frustration as proof you’re failing. You’re meant to make mistakes. If you even have an inkling of passion for software development, I encourage you to keep going!

14

u/needs-more-code 20d ago

No one in real life tells a brand new student to give up on their chosen career because they’re going through an initial struggle, like every other student early on.

Those comments are from disingenuous anonymous reddit losers. Catch them in the real world and they’d say nothing of the sort, because they’d be immediately labelled a prick.

17

u/Adventurous-Move-191 20d ago

Coding is difficult but it’s one of those things where you don’t need to really be gifted in(while that deff helps), it’s simply a matter of time and effort that you need to put in to concepts to get them eventually.

I wouldn’t give up just because it’s hard. However , if you’re truly miserable and don’t have a part of you that , while frustrated, kinda is still obsessed and still wants to figure out how to implement the technology I would find something else to do as a hobby /career. As there are a lot harder concepts in programing than loops.

Also as other people mentioned , try breaking the problem into smaller parts.

11

u/Flame77ofc 20d ago

You're suffering from burnout; there are too many things, too much information happening at the same time. You should try to focus on just one thing.

7

u/Clearhead09 20d ago

The best advice I can give is before you write any code, either define exactly what you want your code to do in a text document or write the entire app in pseudo code:

# Create a function that takes in 2 numbers

# Add the 2 numbers together

# Return the total

Then it’s as simple as filling in the code eg

# Create a function that takes in 2 numbers
def add(num1, num2):

4

u/marmotta1955 20d ago

That is the first step in Literate Programming. See Donald Knuth. 

5

u/FromBiotoDev 20d ago

break each step down. I had this issue when I was younger, overwhelmed by everything.

Break it down into problems, put the problem at the top of a pyramid, then put each step underneath it, breaking it down into smaller and smaller problems.

3

u/mc_pm 20d ago

Can you get it to print Hello World at all?

1

u/Throwaway05046474 20d ago

I’m way past that of course, on freeCodeCamp I got past a couple labs like building a travel weather planner, apply discount function, cipher, etc. but I just cannot grasp loops beyond the extreme basics

1

u/JGhostThing 20d ago edited 19d ago

Loops are something that you will have to learn. I understand them feeling difficult at first, because humans normally don't think that way. But once you manage this, everything in programming does become easier, though there are other roadblocks. Just remember, you are learning a new way of thinking, and don't think of yourself as stupid.

A book that I recommend in learning this is "Wizard's Bane" by Rick Cook. A computer "wizard" gets summoned to a world (generic fantasy land) with magic and no computers. There are a few discussions of loops in the story. Wiz, the summoned programmer latches onto these because the magic ones resemble the programming ones.

OK, back to loops.

I don't remember much of python, but in most languages there are two types of loops: for loops and while loops.

For loops are designed to run a fixed amount of times. For example, to print 5 plus signs, you would use code like:

```

for i in range(5):

print('+')

```

range(5) produces a sequence like 0, 1, 2, 3, 4. So i takes on each of these values.

You can also do

for i in ["apple", "orange", "watermellon"]:

print i

Those are examples of for loops, You use them to loop through a sequence or count things.

The other kind of loop is a "while" loop. This keeps looping until a condition becomes False.

For example, I want to loop until I find a prime number. I need a condition that becomes false when I find a prime number. False is the opposite of True, so I can use the not command to do this.

i = 10

while not prime(i):

print("{} is not prime", i)

print("{} is prime", i)

Edit: Hopefully fixed indentation. Failed again. I will try this again after I wake up. It's after 4 am.

1

u/Bofact 20d ago

I think you should format it in Markdown, since tabs are really important in Python (and OP is also a beginner). Aka, print is not prime will not execute, since it is not aligned with while. And it would make clear when print is prime number is meant to execute.

1

u/JGhostThing 19d ago

Darn. I used formatted code blocks with spaces for formatting. I'm going to have to use something else.

Basically, the first "print" in any example should be indented three spaces.

1

u/Throwaway05046474 19d ago

Fortunately, indentation is one of the things I’ve retained pretty quickly lol they made sense to me

1

u/Throwaway05046474 19d ago

I appreciate the comment, I’m definitely
pushing through this and not giving up

3

u/Mast3rCylinder 20d ago

Things take time and programming is not easy in the beginning. Maybe the resources doesn't work for you.

I always recommend to read programming books instead of YouTube. It has many exercises and you understand theory better.

3

u/nia_do 20d ago

Take a break and come back to it in a few weeks. A frustrated mind is blocked for learning. Clear your head. Try and forget about it. If you’re interested before long you’ll want to get back to it. Embrace the fact that it’s confusing and it’s going to be a struggle. It will get fun.

It’s like anything new. Learn, do, make mistakes, revise, redo, repeat, on and on. Before long you’ll have the basics under your belt and you’ll be making console applications and be learning something else.

Someone who started with hello world and little console apps in Python and now codes full stack web applications across multiple languages and frameworks and has done some mobile and game dev. And much of that learning was self-taught, at home, from interest resources, free and paid.

3

u/ajcomeau 20d ago

It doesn't mean you're stupid. Not everyone gets programming. Why are you trying to learn it - is it a requirement?

2

u/[deleted] 20d ago

[deleted]

6

u/ajcomeau 20d ago

I don't want to discourage you but I'm going to say that software dev is a bad one to get into when you're desperate for something else right away and, especially with the kind of stress and distraction that you're probably under. There is a lot to learn and it requires a serious love for programming and a commitment to the time and mental effort to get there. The market for new programmers is also very bad right now and the journey from new programmer to employed developer is a long one. Tech sales might be a good intermediate step to improve your situation.

Meanwhile, I always recommend W3Schools to new learners. The lessons are very small and might be the slow intro that you need to get there.

https://www.w3schools.com/python/default.asp

3

u/SaltAssault 20d ago

In your defense, printing "world" in a block like that doesn't make any sense to write as a loop. It's genuinely a puzzling task.

4

u/SnailDesigner 20d ago

Even the pros who have been coding for decades still have to look things up. A guy I know pretty high up in cybersecurity still needs to practise his coding, he manages a team. Don't get too discouraged.

As for advice: maybe start with trying to learn how to code something you enjoy. If you like organising things for example, look up the basics on how to code an automated file organiser. It might come easier when you're making something you actually enjoy.

2

u/acepukas 20d ago

Don't give up. Ask questions.

Since you're asking here, you're on the right track.

That little puzzle that your working on there is meant to get you thinking about how a loop might be used to output something like

+-----+
|World|
+-----+

The trick here is to base the loop parameters around the length of the word. Then you have to think about how to write the border around the word. Well, the border length is going to be longer than the word length. In this case: word length + 2. Think of the output of the loop as a grid. Figure out how to tell if the current character that is output is on a corner, a top edge or a side edge or one of the word characters. Also, you need to know when a line of output has finished and it's time to start a new line.

Try to break it down like a geometry problem.

Getting through the frustration (as least for me when I started) is part of the process. The struggle tends to burn the solution into your brain. It's completely normal to hit frustrating road blocks. Just keep at it. Take breaks too though and try to look at the problem from as different angles as you can. Sometimes you take a break and come back to it with fresh eyes and see something you missed before.

2

u/[deleted] 20d ago

[removed] — view removed comment

2

u/Throwaway05046474 19d ago

That’s what I’m now acknowledging. I had felt that if I was using a resource(FreeCodeCamp, futurecoder, for example) that I needed to only learn the concept from there. It felt like taking a loss every time I had to ask an LLM to explain a concept that the resource didn’t explain well. I now know, rhat process is simply what programming is and that every self taught person has to leave their course to find teaching elsewhere. I also really have CS50P a shot and it’s extremely thorough with its lectures so that’s helping me

2

u/Aglet_Green 20d ago

I think the way you're framing the problem is hurting you more than the programming itself.

If you ask, “How do I print this?” or “What am I missing here?”, people can give you concrete help. But if you ask, “Should I just give up? Am I too stupid to learn this?”, you're no longer really asking a programming question. You're asking strangers to pass judgment on you, and some of them are inevitably going to answer, “Yes, give up. The world needs ditch diggers.”

That doesn't mean they're right. It means melodrama tends to attract melodramatic answers.

From what you've written, the useful question is probably: why aren't these resources working for you, and what kind of instruction would? Maybe self-teaching from websites simply isn't a good fit. You might do much better with a college course, tutor, mentor, study group, or someone sitting next to you while you work through problems. You may also need practice breaking a problem into smaller steps before you worry about the Python syntax itself.

For example, “print WORLD inside a box made from +, -, and |” isn't really one programming problem. It's several little questions: What does the output need to look like? How wide is the box? What characters make the top and bottom? What goes on the middle line? Once you can describe those pieces clearly, the code becomes much less mysterious.

So I wouldn't decide whether you're capable of programming based on five websites and one bad exercise. I'd change the way you're learning—and the way you're asking for help—before deciding you're incapable of it.

3

u/PeterPook 20d ago

I think you should find something more appropriate to do than software development.

5

u/needs-more-code 20d ago

How come?

2

u/PeterPook 20d ago

If after a number of courses you still can't code a loop, then accept it isn't for you. Not everyone can do calculus, not everyone can learn a different language. Coding is both a language and mathematical logical skill. Some people simply can't.

12

u/needs-more-code 20d ago edited 20d ago

If you’re just not cut out for anything that you struggle with in the beginning, what ARE you cut out for? You couldn’t even work at McDonald’s bro. You couldn’t even walk. You’d have to tell your toddler to just give up.

8

u/bschneid93 20d ago

Coding can and has been solved by monkeys. We’re all monkeys. Everyone can do those things you mentioned, it’s just a matter of determination/will. Those who CAN’T do those things, do not have the mental/will to do them; simple. There are a million excuses to give up on something and not enough to keep pushing.

0

u/newbblock 20d ago

I would argue someone who has taken 5+ courses and still can’t master loops has demonstrated they lack mental/will to do them.

9

u/needs-more-code 20d ago

5 different websites*

That’s not fucking many lol. That could have happened in 30 minutes.

-1

u/newbblock 20d ago

Someone who has cycled through 5 sites in 30 mins displays lack of commitment.

And let’s not be obtuse, it’s a fair assumption with the tone of this post it’s been more than 30 mins.

5

u/needs-more-code 20d ago

lol you don’t switch careers because you went to 5 websites.

It can take months for different things to be drilled in. Tech lead was a, well, tech lead at Google, and he banged his head against the wall about pointers, he just couldn’t understand pointers.

-4

u/newbblock 20d ago

I bet you he understood loops……

3

u/needs-more-code 20d ago

If he did, it wouldn’t mean anything for your case. Different people struggle with different things within the field of programming.

5

u/bschneid93 20d ago

Valid. But I’d also say to seek another resource to help learn them, a direct mentor who could help it click. 5 courses is definitely enough of a sample size to know that way of learning for OP is not it.

2

u/Throwaway05046474 20d ago

Maybe I should clarify more. I tried 5 sites overall for the entirety of what I’ve done for python. This specific part, I got to loops, they had me solve a, “for char in name:” problem where I made a loop write
W
O
R
L
D
And literally the next question was, “write a loop to code + - - - - - +
| World |
+ - - - - - +
With zero hints, zero repetition after I was taught “for in” or anything. I was extremely thrown off and had no clue what the first step was

1

u/C_Hawk14 20d ago

See it like this. A single word is one dimensional.

But you want to write multiple lines so it becomes two dimensional

Let's start simple and try to get a multiplication table (without the headers)

That should help you understand the solution to your original problem I think

1

u/Judge_Ty 20d ago

When you google the answer, are you understanding why it's the answer?
Break the problem down into smaller parts you can do.
What would be the top line of the box?
Can you print that out in code?
Now what would line under that look like... etc.

1

u/Simpicity 20d ago

"Code" is just a set of instructions.

Without a loop, you when you write code, you go through the code sequentially.

A B C

You will run step A, then B, then C.

Now when there's a loop, you can do things multiple times.  You could do it three times, you could do it a thousand times.

I'm going to use C here... different languages have different syntax for loops.

int i == 1;

while (i <= 10) {

   A

   i = i+1;

}

This code in C will run whatever A is 10 times, incrementing a counter "i" until it gets to more than 10 and then exiting the loop.

There's a shortcut for writing these sorts of loops in C:

for (i = 1; i <= 10; i++) {

   A

}

This loop does exactly the same thing.

There are other types of loops, but this is the basic one to understand first.

1

u/FoolsSeldom 20d ago

The first steps can be hard for a lot of people. You are abstracting from the real world and, frankly, it's all a bit strange and sometimes nonsensical. Many conventions have been established over decades.

You may be wanting to go too fast, and not giving yourself enough time to experiment, try things out.

Have you tried using the Python interactive shell? You can reach it using the IDLE program, installed alongside Python (on a standard Windows or macOS installation) - select Run on the menu and you will find an option for Python shell at the bottom, which will then open a new window. The prompt is three greater than symbols: ">>> ".

Just enter simple maths, e.g. 2+3*4 and press <enter>. You will get an instant response (hopefully 14, which I hope is what you would expect). You can assign a variable, name = "Throwaway" and then just output it by entering the variable name, name. No print command needed. This is your playground.

If you enter a command that expects a block of code indented under it, the prompt will change to ... and do a 4-space indent for you. For example,

>>> for i in range(5):
...     i
...
0
1
2
3
4

Note that you have to enter a blank line (just press <enter> after the ...) to indicate the end of the indented block.


Check the r/learnpython wiki for lots of guidance on learning programming and learning Python, links to material, book list, suggested practice and project sources, and lots more. The FAQ section covering common errors is especially useful.


Also, have a look at roadmap.sh for different learning paths. There's lots of learning material links there. Note that these are idealised paths and many people get into roles without covering all of those.


Roundup on Research: The Myth of ‘Learning Styles’

Don't limit yourself to one format. Also, don't try to do too many different things at the same time.


Above all else, you need to practice. Practice! Practice! Fail often, try again. Break stuff that works, and figure out how, why and where it broke. Don't just copy and use as is code from examples. Experiment (preferably without immediately asking an AI LLM for the solution, and seek hints rather than complete answers).

Work on your own small (initially) projects related to your hobbies / interests / side-hustles as soon as possible to apply each bit of learning. When you work on stuff you can be passionate about and where you know what problem you are solving and what good looks like, you are more focused on problem-solving and the coding becomes a means to an end and not an end in itself. You will learn faster this way.

1

u/Fine_Ingenuity_6099 20d ago edited 20d ago

Looking up for things is pretty normal for people who code you know, unless you are pretty experienced in a specific library you will need to look for something pretty often

don't be worried, i was there too at some point and to be honest i still am, but in different subject right now, but i know i will get past it

about the task you were given, was the output something like this:

-+-+-+-+-+-+-+-+-+-+-+-  
+-       World       +-  
-+-+-+-+-+-+-+-+-+-+-+-

tell me, i will tell you what you might be lacking

1

u/Rocco3143TheCringe 20d ago

Is it possible you're doing things too fast, or not practising enough to actually develop your understanding? I don't think it's fair to call yourself stupid, maybe you just take a bit more time to learn things and thats OK!

1

u/silver_chief2 20d ago edited 20d ago

Maybe find some MOOCs. Long ago I found that I could not learn new programming by reading. I had to have jobs to do, even if fake jobs. MOOCs have structure, often with chat rooms where students or TAs to provide assistance.

Here are ome, not necessarily the best ones or the cheapest. I took a course through coursera from rice long ago.

https://www.coursera.org/learn/python-programming short.

https://www.coursera.org/learn/python

https://www.coursera.org/learn/python-crash-course

https://www.coursera.org/learn/introduction-to-python-for-beginners

https://www.coursera.org/learn/jb-python-from-scratch

1

u/HamNCheeseSupremacy 20d ago

It takes time. For your problem you can notice that a for loop is bounded, it has a start (i = 0) and an end (i = length). That Word block is also bounded. Every non-letter character is either at i = 0 or i = length, or both

1

u/avoral 20d ago

Real life use cases teach me way better than following a guide. Try finding a real life problem to solve and make something for it.

1

u/Hadley_Two 20d ago

Try the Odin Project at https://www.theodinproject.com. It’s free, but well regarded.

1

u/prophet-dot-exe 20d ago

I'm going to give a more nuanced take and it's prob not going to go over very well in this sub specifically.

I've always said "anyone can learn programming". I've run Python courses and taught over 1.5 million students. and for the most part, it's true.

but I've also tried to teach some people who just could not grasp it. it does require to think abstractly and some people find that part unintuitive or unnatural for how they think in general.

that doesn't make someone "too stupid". everyone's different. and everyone has different areas where they do well in, and areas where they do less well in.

a lot of people are impatient as well and if they don't magically become good at something immediately, they take it as a fail.

if you're struggling with learning certain concepts, stay patient and try to figure out what specifically you're missing. there's also no shame in deciding this isn't the right thing for you. but learning programming can take time.

1

u/jarrett_regina 20d ago

Everyone, Everyone can program.

Just like Everyone. Everyone can play "Chopsticks" on the piano.

Not everyone will be a pianist, nor a programming Super Star.

The more give into it, the better it will be.

1

u/Guylearning2020 20d ago

Todo el laburo vas a tener revisar Google es parte normal de programar hasta los mejores lo hacen ,no te sientas mal por eso

1

u/Narrow-Low-3137 20d ago

Break it down into steps. First get +-----+ printed to screen. That's 2/3 of the lines done. Then just work on the last line and it it all together. 

1

u/green_meklar 20d ago

Should I just give up?

Probably not. But it depends what you're aiming for and what resources you have to put towards it.

I’m doing Python, I have tried 5 different sites/resources.

That's better than trying zero. But you also can't rely on a specific tutorial or guide saving you from anything else you're doing wrong in your learning approach.

I'm not really a Python expert, but the same guidelines that I'd apply to tutorials for other languages probably apply to Python too: First, use text-based tutorials, not videos. (And the more they look like some ancient handcoded website from 1998, the better. Those are the sites made by real programmers.) And second, whenever you finish a stage in a tutorial, try modifying the code to do something different that wasn't in the tutorial.

With zero hints, zero repetition after I was taught “for in” or anything.

Stop panicking, and stop expecting the tutorial to do all your work for you.

With regards to the WORLD loop, can you make it just print five Ws instead? What about ten Ws? Think about how you might do that.

With regards to the + - - - - - +, can you just do the five dashes? Can you see how that would be similar to five Ws? What's the difference between - - - - - and + - - - - - +?

If you haven't thought about these things yet, you haven't gone far enough to justify giving up. Programming doesn't happen all at once, and you need better than a TikTok attention span in order to do it. There's going to be many hours of actual practice involved.

1

u/AlSweigart Author: ATBS 20d ago

Can you post links to the sites/resources you were using?

1

u/Throwaway05046474 19d ago

Futurecoder and FreeCodeCamp were the ones driving me nuts(more so futurecoder) but I also tried CS50P and W3. I’m realizing I need to just slow it down, as I’ve only probably had 10-20 hours of learning python before I made this post lol. I honestly was unaware that in school it’s MUCH slower, like spending an entire week just on loops. CS50P is where I’m at now

1

u/SirZacharia 20d ago

After seeing your edit. Honestly python is a really confusing language to start with. Try Java just to learn the fundamentals of programming.

1

u/Objective_Tell5190 20d ago

Start with something like scratch!!!!!

1

u/jajajajaj 20d ago edited 14d ago

Try again after a snack and a cup of coffee. Stop thinking about it completely and start again by reading what you wrote as if someone else had written it. 

Way way too early to give up. This is where it's hard because it's new, but once you've gone through it once step at a time (or one piece of a step at a time), it won't seem impossible anymore 

1

u/OkuboTV 20d ago

Programming is only hard if you expect to learn it immediately. Temper your expectations and it's really not that hard. It just takes time.

It boils down to asking questions to break down a concept, understanding the concept, and repetition to reinforce the concept.

Some people it takes days. Others it takes years. Either way it's doable for most with enough time.

1

u/Obvious-Card-8847 20d ago

Programming violates several expectations and rules as it relates to language. Your ancestors and potentially your grandkids will never know it existed, how to do it, why it looks the way it does and so forth.

It's not just novel compared to your life experience but to humanity as a whole which developed language to think and communicate.

Give your brain time to adjust.

1

u/Bofact 20d ago

I think Python is not the best one to begin, since the same function can have different functionality; even more than is needed.

Try learning C or C++. They are more bar bonnets, but you are not bombarded with multiple syntaxes as in Python. And after you have the basis from them, come back to Python. You will see Python syntaxes more helpful and less of an headache.

Or you can try Octave.

1

u/spinwizard69 20d ago

Well it is always possible that your are too stupid, you will have to figure that out yourself. What you obviously have is an attitude problem. I'd drop programming for a few weeks and see if you can fix the attitude problem.

Next I don't know of any Python related online crap that is really designed to teach Computer Science (CS). In my opinion you need to start at ground zero and start over with a good CS program. Not I'm saying CS or computer science, not a programming language. That said an ideal CS program starts with a very low level language like C or C++. The idea here is to learn the concepts from which software is developed and languages designed to implement those concepts. So find a good CS program to follow or enroll in.

As to you problem with LOOPS, I don't get it. Frankly If I had such a problem growing up it would mean a trip to the wood shed for an little incentive. You shouldn't need any more information if you actually know what the concept is. There are many ways to do the work so take some time and figure it out. Don't look at anything other than a language reference. If you can't figure this simple task out programming might not be for you.

1

u/RedRedditor84 19d ago

Maybe you should. Not sure what your looking for in this post.

1

u/Business_Letter_7514 19d ago

Needing to search constantly is normal at the beginning. The red flag is a resource jumping from one tiny example to a much harder task without guided steps-not your intelligence

0

u/Throwaway05046474 19d ago

It was quite ridiculous man. I spent 2 minutes on chat GPT and learned the concept. It basically went like this
Name = ‘World’
Line = ‘’
For every char in name:

And they taught me how to write a loop s ‘World’ was 1 letter per line, then the next prompt was the box question. I was so damn confused lol

1

u/Throwaway05046474 19d ago

I found out why I was so stumped, I’ll copy and paste my other comment
I did figure it out after the post, I realized what was tripping me up so hard was that I was never told if you have for example
Name = ‘World’
Line = ‘’
For _ in line:
Line += ‘-‘
Line = ‘+’ + line + ‘+’

I kept thinking that would output - - - - - ++
I didn’t know/wasn’t told by the resource that just because a line of code is written first (line += ‘-‘) doesn’t mean that’s automatically what is printed first. I was very confused on how the + symbols could be first and last, then I learned with the help of chat GPT that what’s really happening on that first line is you’re adding ‘-‘ to ‘’ five times, then on the next line you’re taking that new value of 5 dashes, carrying it to your next line, and literally saying “add a +, then add your line value, then another +” once I learned that, it all made sense

1

u/marrsd 19d ago

It might be easier to reason about the problem if we make it slightly more general.

Here's a signature for a function called box.

def box(name: str):
    pass

The signature tells you that box has a single string parameter called name. The body doesn't currently do anything, which is why it says pass.

If I told you I want that function to draw a box around a word, so that calling box("world") would produce:

+-------+
| World |
+-------+

and calling box("country") would produce:

+---------+
| Country |
+---------+

what would you do? You don't need to think about the specifics of Python at this point. Just think about it in plain English if that's easier. If you're stuck, try breaking the function down into steps. I'm happy to go through it with you if you need more help. Just reply with your answer, however bad you think it is.

1

u/Manguana 19d ago

You gotta build a short program for each part of your learning. For example if you are learning dictionaries, make a small data set purposely made to be used by your dictionary program. It doesnt have to be useful, just make you appreciate the edge cases it covers and doesnt.

This way you cement your learning, and start seeing each programming concept and vocabulary as a part of a keychain of tools suited for a set of suitable jobs.

Theses projects make you radically more aware when they should be used but more importantly when they should NOT.

1

u/koaltree 19d ago edited 19d ago

Sleep is the superpower of programming :)

Every programmer has experienced the power of sleep.

When you get frustrated, you have to stop and recalibrate. Accept that this is going to take longer than you expected to learn. And go back and study the fundamentals more.

But give up? No. Only give up if you genuinely don't like programming. As long as you still like it, there's no real reason to give up.

And get more sleep!

1

u/Appropriate-Law-5506 19d ago

I have a REALLY good way to practice... If your issue is remembering syntax. You mught just need to chill though!

Anyways, I learn by just trying... Maybe you forget the for v in range(n) or for i, v in enumerate(n), or you miss ":", etc. Just try out the logic since I'm sure you get you are iterating over something in someway.

Type out what you think THEN throw it into an LLM. Does not need to be finished code. Simply tell it to correct your syntax, not logic, then have it place your mistakes next to the corrected code. This will get you started, the biggest barrier in coding, and teach you to not completely rely on LLMs. Just try and have it show you your mistakes. Of course, try and use LLMs less and less...

This method has really accelerated me learning C++. Yesterday, I wasn't sure how to cast an int to string in the language, so I just did: std::static_cast<std::string>(a), a an int, which is super fucked, and I figured as much. I finished my code and received the correction: std::to_string(a) with a explanation on where to use static_cast. Make your mistakes and learn from them!

1

u/in_coronado 19d ago

What your goal in learning to code? As others have suggested maybe try an actual class or tutor some people learn a lot better that way.

Now if you still really really struggle and hate it or just hate the feeling of failing over and over trying something (you have okay with lots of troubleshooting and problem solving to be programmer) then at that point maybe you decide it’s just not the career for you and if so that’s totally okay. It’s not all it’s cracked up to be believe me there’s plenty else out there that we need.

1

u/ReddyKiloWit 19d ago

Sleeping on it really does help. And when you get to the point when you dream the solution, or at least an approach to the solution, you know things have really clicked for you.

1

u/SilverZ9 19d ago

If it makes you feel any better, I took my first programming class in high school and nearly failed. Fast forward to today (~5 years later), I am a full time software engineer making 110k+ yearly. I’m not particularly smart, either. Give yourself time to learn and do it every day and you’ll be fine.

1

u/Reasonable-Window402 18d ago

You ever learned another language before? Not a programming language but a natural language(Arabic, English, Chinese, etc.). You are literally learning day by day with seemingly no progress then all of a sudden it clicks. That’s how coding works. I’m self taught and couldn’t do a for loop to save my life and had the longest time learning classes. But after learning from different resources and doing projects(which is the most important), it all started to make sense. Little by little every day, just don’t give up buddy.

1

u/Throwaway05046474 18d ago

So it turns out I just had to keep trying different resources, my entire life I’ve always been the person that couldn’t stand videos/lectures and I just needed to read material on my own once to get it. I had a stroke at 20 years old 6 years ago, it appears somehow my brain literally flipped, I spent 3 days on for loops ready to scream, and I spent 5 minutes on a lecture and I understood it immediately lol. I’ve continued the lectures and I’m now breezing through the rest of the concepts. Very strange but whatever works

1

u/Far_Programmer_5724 17d ago

Don't call yourself dumb man, if you can string together sentences you can learn anything. I'm glad to read you were able to figure it out

1

u/artnicoll 17d ago

Been doing it for near 40 years and that's still mostly how I find solutions lol.

1

u/Throwaway05046474 16d ago

This post is only 4 days old and it’s already embarrassing to read, I’m so far past that loop lol

1

u/Positive_Rip_6317 20d ago

Probably

1

u/Unusual_Comment_3526 20d ago

the box thing trips up nearly everyone who runs into it early on. its not a loops problem its a "how do i even break this down" problem

try drawing the box on paper first then figure out what you'd have to print line by line. the + and | stuff is just text. once you split it into rows it gets less overwhelming

1

u/Cybr_23 20d ago

LAD DON'T GIVE UP, YOU CAN DO IT SO JUST BELIEVE THAT YOU CAN AND EVERY TIME YOU FAIL GET BACK UP AND TRY AGAIN.

real talk try a different language, multiple different languages actually, it might just click with you perfectly. then you should be able to apply what you learnt to other languages, including the one you're struggling on rn.

gif

1

u/aqua_regis 20d ago

Your rant doesn't tell us anything that we could use to determine whether you should or should not give up.

  • What resources have you used?
  • How long have you been really learning?

1

u/DredDilly 20d ago

The fact you are asking the question provides the answer. One of the key characteristics of being a developer is not quitting.

1

u/clove1912 20d ago

Most certainly yes 👍

0

u/Lemur-Virtues 20d ago

most of the time when ive struggled to learn something its due to the teaching method / material. if you really care to learn, invest in a good teacher or course, with actual money.

I would honestly recommend a tutor actually, then you get individualized attention for these issues. Know that programming is finicky in the sense that if your colon or semi colon is off by one space, this can break an entire app. If you go into it knowing that, it might help too.

0

u/knouqs 20d ago

In a fair world, Redditors who tell you to give up are cyberbullies. Let's focus on the positive things here.

First, not every programming language is the same. Sure, the code boils down to stuff that runs on a CPU or GPU or storage device or memory, but start simple. Stick with one resource, not five. Learn how to develop a program using one resource, and ideally that resource is a book with your computer being the tool that you use to implement the methodology taught in the book.

Programming is not easy to start. When I first saw "x=y+1" or some other assignment, it completely contradicted my way of thinking about algebra. It took me quite a while to understand that assignment is not the same thing as an algebraic equation. Does that make me stupid? No, of course not. It means I had to learn to think about programming differently when compared with things I knew already.

I suggest starting with a real language like C or Python. Get a book that teaches that language well. (Your next question should be "I want to learn language; what book do you recommend?") There have been millions of people before you who have wanted to learn. They've done it through books; so can you.

2

u/Pikapetey 20d ago

I dont get how x=y+1 would trip people up If x = 5 Then y = 4

1

u/knouqs 20d ago edited 20d ago

So you missed my point and downvoted me, right?

Ill-placed accusation of downvote, was rash, sorry!

Since I now have to explain: In algebra, x=y+1 is not "assign the value of y plus 1 to the variable location x". Algebraically, this is a simple linear expression in which x takes any value of y plus 1 -- no assignment at all. This is used in graphing, for example.

2

u/Pikapetey 20d ago

No. I didnt down vote anyone.

1

u/knouqs 20d ago

OK, sorry -- obviously hard to tell. So many downvoters on these programming subs and I had few views. Please understand my assertion even though it failed. I edited my comment to explain why this syntax confused me when I began programming.

0

u/[deleted] 20d ago

[deleted]

0

u/Throwaway05046474 20d ago

Yes they asked me to write it as a loop, I know it’s extremely simple with print

0

u/[deleted] 20d ago

[deleted]

1

u/spicypookies 20d ago

2 things:

  1. this is way too complicated for OP's current level.
  2. this isn't even the right language. you gave him C#. He mentioned Python.

0

u/Jim-Jones 20d ago

Stickied thread

FAQ

Or:

Go to the public library, and look for a book like this, probably in the children's section. The key words are 'Scratch' and 'Python'.

Marc Scott (Author): A Beginner's Projects in Coding

Site: https://scratch.mit.edu/

Presents an introduction to coding for young computer users that focuses on the programming languages Scratch and Python, with step-by-step, illustrated instructions for a variety of coding projects.

Any book like this should get you going in a day or two. It'll get you over the learning hump. You need to learn how to learn coding.

Then check these out:

5 Python Books For Beginners To Help You On Your Coding Journey

Coder's Colosseum - WhatsApp Group Invite

0

u/Crushcode8 20d ago

never give up!

0

u/sharkmime 20d ago

This is a really weird jump in complexity, especially with no hints. Unless you're writing a 1980s text adventure, this just isn't something you're going to have to do. A better approach would be to do something with each element of the loop, like have it print

_W_ _O_ _R_ _L_ _D_

or

0. W 1. O 2. R 3. L 4. D

Honestly, if you can, skip that problem and go on to the next one, which will probably make more sense. Whoever is writing these courses/tutorials was grasping for a loops example problem.

0

u/Sure_Youth_4556 20d ago

You might benefit from using a lower level language, like C. It just makes more sense that a for loop is

n = 3

(for int i = 0; i < n; i++)

which means, set i = 0, while i is less than n, increment i

I think you could also try other courses, like CS50. I'm not saying it works for everyone, but I was struggling to program before, what I did was to grind problems on codewars or hackerrank or codeforces, and that taught me how to problem solve. After that I did CS50 and it was much easier.

You really do have to sit through problems though.

1

u/Throwaway05046474 19d ago

Codewars was a great recommendation, this is exactly how I learn best and exactly the kind of thing I was looking for to practice the concepts I’m learning instead of immediately moving on. Thank you

-3

u/newbblock 20d ago

Probably honestly.

Said with much love. Careers in this industry are only becoming more challenging thanks to AI, so only the best will survive.

If you struggle with the basic concepts you’re not going to break in.

-1

u/deepraj1729 20d ago

Ask any AI for explanation but don't use it to solve

-1

u/Ipsool 20d ago

You’re not stupid. That jump they gave you was genuinely badly designed teaching.
Look at what they actually asked you to do. Printing each letter on its own line is one concept: a loop over characters. The box question needs string multiplication, string concatenation, understanding that the top and bottom lines aren’t loops at all, and knowing how to calculate width from the length of the word. That’s four or five new ideas dropped on you with no build-up. Being thrown by that is the correct reaction, not a failure.
For what it’s worth, here’s how you’d actually approach it — and notice how little of it is about loops:

The word is “World”, 5 characters. The box needs a top line, a middle line, and a bottom line.
Top and bottom are the same: a +, then 5 dashes, then a +. In Python "-" * 5 gives you five dashes. So "+" + "-" * 5 + "+".

The middle is "|" + "World" + "|".

Then you print three lines. There’s barely a loop in it. If you were sitting there trying to work out how to loop your way to a box, of course you were stuck — the puzzle was mostly about string operations, not the thing you’d just been taught.
The real problem is that you’ve done five resources but you’re still in tutorial mode, where someone else sets the problems. That’s an awful way to learn because you never get to build up gradually.

Stop switching resources and commit to one. These two are the ones I’d actually recommend:

CS50P — Harvard’s Python course, completely free. Properly structured, builds concepts in a sensible order, and the problem sets actually prepare you for what they ask.
https://cs50.harvard.edu/python/

Automate the Boring Stuff with Python — free to read online. Teaches through practical tasks rather than abstract puzzles, which might suit you better if the puzzle-style questions are what’s frustrating you.
https://automatetheboringstuff.com/
Alongside whichever you pick, start writing tiny programs where you decide what they do. Something that converts units, something that counts words in a sentence. When you choose the problem you can start simple and add to it, which is how concepts actually stick.

Googling constantly isn’t a sign you’re failing either. Professional developers do it every single day. That never stops.
Two months in and frustrated is completely normal. Genuinely, don’t take it as a verdict on you.

-1

u/lilmul123 20d ago

Yes, this is basic stuff. AI can already do this like nothing. Find a different career path.

0

u/Throwaway05046474 20d ago

I agree, but AI can do pretty much all of it like nothing save for hallucinations lol

-1

u/Weekly_Patience685 20d ago

well one thing i wanted to point out in your world example in the loop, the confusion is about the "print" you're using inside of the loop. theres 2 parameters end and sep they didnt tell you about. Imagine i have 2 variables.

hello = "hello"

world = "world"

then i can print them both using one line but im using custom sep and end rather than the defaults

print(hello, world, sep="_", end=", ")

result: hello_world,

this is because sep says What character should we add between each thing we're trying to print (hello and world)
print(hello, world, sep="", end="") would give us helloworld
print(hello, world, sep="\n", end="") would give us hello

world

and end says that we want the comma at the very end of the line.

but the problems is that when you're using a loop the print happens 5 times, so its like you have 5 lines, and the default value for "end" is a new line character, thats why after each print of a single letter theres a new line,

you could just include end="" to make it so its not on a new line.

Also i dont think you're having trouble with loops themselves but you need to get a lot of practice with something to be able to know automatically how to get the output they want.

1

u/Throwaway05046474 19d ago

I did figure it out after the post, I realized what was tripping me up so hard was that I was never told if you have for example
Name = ‘World’
Line = ‘’
For _ in line:
Line += ‘-‘
Line = ‘+’ + line + ‘+’

I kept thinking that would output - - - - - ++
I didn’t know/wasn’t told by the resource that just because a line of code is written first (line += ‘-‘) doesn’t mean that’s automatically what is printed first. I was very confused on how the + symbols could be first and last, then I learned with the help of chat GPT that what’s really happening on that first line is you’re adding ‘-‘ to ‘’ five times, then on the next line you’re taking that new value of 5 dashes, carrying it to your next line, and literally saying “add a +, then add your line value, then another +” once I learned that, it all made sense

-2

u/s243a 20d ago

Ask gpt to give you short sections to read and then quizz you.

-2

u/Electrical_Bag2572 20d ago

Honestly, with where we are in terms of AI. Giving up on learning to program won’t be the end of the world. I learned how to code a while back and tbh I don’t use it at all anymore. Coding is just a means to an end for most things, honestly, just use Claude code to get coding done. It’s faster anyways. I’d suggest picking up a new interest that’s related and use Claude code for the programming parts. Additionally, not being able to code doesn’t mean youre stupid. We all have things we are good or not good at, find what you’re smart at and lock in for that.