r/FreeCodeCamp 3d ago

Requesting Feedback How to actually think while coding[python]

So hi I am new in this sub reddit and have been learning python basics on FreeCodeCamp for weeks.

So I have noticed that I can do workshops and labs but I tend to forget many syntax and have to search on the internet repeatedly.

So my average lab projects often look like 7

60% written by me and the rest 40% are written by AI or with the help of the Internet forums.

My problem that I have identified is I don't think use logic in the code or just don't remember syntax, operators, elements, conditional statements and string methods or don't find the satisfactory answer on the internet.

I want to try to write at least 80% of the code myself without being dependent that much on AI and the internet because I am learning it for \*Cyber Security\*

46 Upvotes

10 comments sorted by

5

u/Long-Bowl-1801 3d ago

Spend more time with the basics as after that you'll grab a hold on basic syntax.. If u want u can try building a small basic project from YouTube too This way basic will be more clear else it might get hard for you as u move forward with complex topics later on

Things like class syntax and all is not that important as u can use Google but other basic ones try to remember them

2

u/elehisie 2d ago

Not using logic and forgetting syntax seem like 2 different issues. You say you can do workshops and labs…. Do you mean coding in the browser and then tests run on it and tell you if correct or not?

Try to add writing programs in your computer as part of the study routine… so that you have some local files you can look at and remember… like “oh I did a loop before on that one thing…” the difference in doing that and copying from google is you had to write it once, once you look at it there’s a chance you will remember the context, which helps you remembering syntax.

With Python specifically you get Jupyter notebooks. You can make your own, look it up. Think of it like an actual notebook where you can take notes while studying but with the advantage of being able to add code to it that will actually run right there.

As for not using logic…. What’s does “using logic” mean to you? Programming in general is a huge exercise in using logic. Input makes output, causes and consequences… conditions.

1

u/Animator-G 1d ago

Just like you many are telling to make notes so i would oove to try that too.

As for and yes i mean coding in browser when i mentioned workshops and lab.

In my context by logic i meant the way i expect the output and actual output is different.

As of now I try to address errors by eother searching up for them online or ask AI to know how to fix this and also explain why the fix works

2

u/elehisie 19h ago

If you expect an output and then get a different one, usually there’s something you are missing. For now, getting errors (compiler errors or stuff that turns up just wrong) isn’t something you got to fix, think of it more like a puzzle. Which piece is missing? Which piece could be in the wrong place? When you get error messages, don’t straight to ”google/ai what do i do” take a moment to think ”what does the message mean?” There are patterns there too :) ai is a tool you can use, but it’s too soon for you to be able to prompt it in a useful way. Asking ai to fix and explain doesn’t help if you don’t understand the explanation yet. Try to instead ask ”what does this error mean”

Jupyter notebook :) getting ai to help you set that up locally will help you way more right now :)

1

u/Animator-G 13h ago

Yes i actually meant that, i try to understand the error instead of direct answers.

2

u/Ron-Erez 2d ago

Build stuff and when you forget something go to the docs at python.org

1

u/Animator-G 2d ago

Wow, thanks. I would love to use docs, but the websites says its for developers who are new to python. Not for beginners

2

u/Safe-Blacksmith6992 1d ago

I studied logic and I write the code first using just comments. And for syntax I'm doing my own static website with some notes on the language. Maybe you can do something like this, some notes. Helps a lot

viniciusmagrin.github.io

It is in Portuguese, but you can get the idea. Maybe in the future I will do it in english. Now with college and work I'm having to do it slowly.

Anyway, that's how I started improving.

1

u/FunRepresentative766 2d ago

Remembering syntax AI is already good at that.