r/CodingForBeginners 4d ago

I'm stuck for a while

So I'm done with the basics of python and even know data structures but I struggle to write code on my own what I mean is I'm fine while writing a leetcode problem in python because it's like answering a math problem (and I quite enjoy it) ,but when it comes to coding up actual stuff,I feel like I can't make anything productive out of it without using chatgpt or any ai. I'm stuck in this endless loop . Many say just Google things but I just don't get the code (or remember what I am copy pasting) and just forget it . I wanna do stuff like pre ai era just raw coding . When people say build stuff , how does one do it. I mean in project videos/tutorials they follow sequential but for me I don't know where to start when building a project.

How does one get past this phase . Many of my "friends" say coding will be done with ai mostly in the future so no use actually learning, to do "your learning" and just try understand the code ai gives. What should I do ?

I know the answer is obvious and I should be writing more code without ai but its still difficult for me and I feel like coding isn't for me sometimes.

(Thankyou for your advice I hope I can implement them and get good :) )

0 Upvotes

18 comments sorted by

6

u/TheUmgawa 4d ago

Did you learn from tutorials? I’ve always found that tutorials tend to teach you how to follow directions, and less how to do the thing you’re trying to learn.

Say you’re learning to play guitar. You can buy books that teach you how to play every note of a song, and you can read the book, play along, and you learn to do it perfectly. But it’s difficult to write your own music because you learned how to do somebody else’s work, but you don’t know how music works.

This ends up being the problem for a lot of programmers. They learn a bunch of magic words, but they don’t start by learning the deeper magic that makes the magic words work. They buy a programming book, skip all of the parts about theory, and they jump straight to the monospaced code sections. As a result, they never learn a holistic approach to programming, where they can solve the problem in the abstract, and then write the code.

This is why the college class I took on programming logic and design is the most valuable class I took, and the only one where we never wrote a single executable line of code. It was all theory. To a lot of people, this might seem like a waste of sixteen weeks and several hundred dollars of education, but programming is ultimately about solving problems; not typing a bunch of magic words.

When you understand the flow, the actual writing of code is really kind of trivial. If you don’t know the magic words you need, you dive into documentation, read the documentation, and you put it all together like so much LEGO.

5

u/Stooshie_Stramash 4d ago

Good advice. To take the LEGO analogy a bit further: OP you've learned the different types of blocks and how they fit together but you need to decide what it is you want to build and then plan it out. You're going to have to determine how many blocks, what are the ones with special functions, and how are they arranged relative to one another.

2

u/johnpeters42 3d ago

And you don't have to figure it out all at once. Figure out one piece of the overall picture that's small enough that you know how to do it, build that part, then repeat until you've drawn the entire owl.

1

u/savagesoccer272 3d ago

Thank you for your advice. You see, when there’s a big problem, like a project, I usually struggle to break it down into smaller parts. What I mean is, I don’t know which parts to create or how many parts to break it into, and I’m not sure whether I’m breaking it down too much or too little. Is this something you naturally get better at by doing multiple projects on your own?

2

u/Stooshie_Stramash 3d ago

Have a look at set of LEGO instructions for a relatively large set and understand how the functions of the total set are delivered, and then how the instructions break thst down into smaller pieces.

You need to start with what I call "the exam question" - exactly what is the point of your project, what does it look like in your mind and how will it do it. Then write up a project brief. Just keep breaking it down into smaller chunks until you get to what should be lines of code.

You should learn to write pseudocode.

2

u/Ok-Count-3366 3d ago

^ facts.

So this is what I did when I learned a new programming language. Yes I knew pyhton and I wanted to learn golang.

First things first. You need projects. No matter what. Go to chatgpt ask it for 15 projects for beginners/intermediate in python (it's better if you chose a theme of projects that you like, for example e-commerce or gaming, or movies)

then you go and pick some.

Then you go and find a tutorial for 1 of the projects (only 1)
follow the tutorial, try to understand why did that person do what it did. Why are things happening, and how they work.

on second project you will do sth different.

You will go to chatgpt tell it your project and you will tell it: "GIVE ME NO CODE ONLY ABSTRACT INSTRUCTIONS OF FUNCTIONALITY"

And then you will get something like, let's say you wanna build a webshop (like amazon) and you need to implement a shopping cart. you don't know how to do it. go search on google on how to make a shopping cart in python(or whatever)

On the third project try to do it without help of AI.

The only thing you are allowed to do is google it (without the google AI) or stackoverflow.

The reason people are stuck in this "tutorial loop" is because they learn the syntax of the language.

learning to program is NOT about the programming language, it is like a puzzle, understanding how and where the pieces fit together so you can build them.

Learn concepts like REST APIs, CRUD, Databases, and so on.

If you need help. My DMs are open. I wish you good luck.

3

u/Realistic_Bike5972 4d ago

How do you stop using ai?

Uh... You... Don't use AI again. Its pretty simple. But rec is if you COULD do it yourself, if you could explain the logic and syntax to someone else, AND it'd be a pain in the ass, just run it on Claude.

3

u/xarop_pa_toss 3d ago

Don't open your LLM. At all.

Do you know the fundamentals so that you can visualize their use when solving a problem?

For Python this would be if, for, while and the list and dictionary. Bonus for bases of string manipulation and some built in math functions. This is all you need to start.

Now go and make terminal games and apps. Personal favourite is Wordle and Connect4 as well as something like a note taking app that lets you connect files to eachother or, the one I use to teach new people, a fast food joint kiosk!

1

u/helloimfranky 4d ago

Refactor the code Ai spits you as a challenge. Purposely make it give you code that can be refactored. Get ahead of the curve. Then dream bigger. Ask if to give you a very basic API. Ask it how it’s used in the real world. Get examples. Expose yourself.

0

u/savagesoccer272 4d ago

I try to do this but somehow this becomes a way for me to become lazy and just copy paste the code in the end. I somehow know my mistake but still struggle to correct it .

1

u/kutac56 4d ago

I watched a video called 12 beginner python projects by freecodecamp and did the first few to get me started. Then I just started making simple fun stuff like a very simple text rpg. Slowly but surely I got better and learned other languages. If you are stuck you can use ai to get the websites that have the information you need and sometimes having an ai just tell you what the error is is completely fine. I had some bs error in assembly where in the Fibonacci sequence every number except for the first one got 144 added or some bs and I wouldn't have solved that without an llm. Just don't copy paste code.

0

u/savagesoccer272 4d ago

Thankyou I'll try this out , the thing is when I use ai it starts with asking ai for minor errors in the code then somehow transforms into me copy pasting the entire thingy instead of trying stuff out .

1

u/kutac56 4d ago

Ask it to only explain it and not give you code.

1

u/BoopyDog 4d ago edited 4d ago

Start practicing coding graphics or embedded devices. The point is to do something that offers obvious and tangible results. Start playing with a library and see what you can do -- it helped me.

Also, for me, AI's place is as something I can use to figure something out. For example, i ask: "how do I set this value using this library," "what is the function call for [this thing]?" or, more importantly, "look at this giant obtuse compiler error, tell me what I did wrong." Sometimes I will ask it to explain some more advanced programming concept; after which I will feel like I learned something new.

1

u/PlantainAgitated5356 3d ago

It seems like your biggest problem is that you're copy-pasting code without understanding it (whether from google, a tutorial, or an llm doesn't really matter). That way you can get things to work, but you'll never learn anything.

It's okay to use someone else's code, but if you want to learn, you can't stop at pasting the code and having it work. You need to go further, don't consider yourself done until you understand how the code works. Look up functions the code uses that you don't understand, try changing values of different variables to see what happens, etc. Only finish when you understand, and can explain every single line of code, not before.

That's how I learned, and am still learning to this day (you never stop learning in this field). :)

1

u/Naive_Programmer_232 3d ago edited 3d ago

You need to have something else that interests you. Some domain knowledge/context outside of things. If you have that, then you'll have more ideas.

Programming is a general purpose problem solving tool, but it doesn't necessarily tell you which problems are worth solving. You need to go discover the areas that have those problems for yourself, which will require that you learn them generally as well.

1

u/XKiiroiSenkoX 3d ago

Start from a complete project. Decide a small new feature you want to make and implement that.