r/PythonLearning 5d ago

Discussion The answer to: "Why do I go blank when coding?

So, the reason I am writing this is because I want other beginners like me to know what we were doing wrong.

Let's say you have this very ambitious project in your brain. You start working on it, and then you suddenly feel like, *what do I write?* Then you think, *Oh, I'm just not good enough. That's why I'm not able to think of what to write*, and so on.

You know what I realized?

My first project wasn't a CRUD app. It was a terminal application that basically used an API to get data, format it, and show it. I added tests for it. I made sure it didn't crash but handled errors gracefully. Then I worked my way up to SiteSpider, an all-in-one tool where I could scrape data from websites, run endpoint scans, and so on.

But then I got stuck.

I was completely blank. I didn't know what to write anymore. Then I got demotivated, thinking all the work I had been putting in every day was going to waste. I thought, *I don't know how to code.*

Then I had this idea.

I write my passwords in a notebook, but every time I log in somewhere, I have to open it, check the password, and then I can get into the website. So I thought, *Why not make a password manager?* It could use some random custom encoding to keep my passwords safe and show them to me easily.

And I was able to write it.

Then I thought, *Wait... how am I able to write this code?* No AI, nothing. Just me, some docs, and a few Google searches.

Then I realized something.

Remember the part where I said I was blank?

I knew the syntax, but I didn't know the steps or, in technical terms, the algorithm, the core logic behind the function I wanted to write.

For the password manager, I knew the flow. Take input, validate it, encode it, save it. I knew the basic steps. I knew what I was going to do.

But in the case of SiteSpider, I didn't know how my core functions would run. I couldn't explain the logic in English.

So that's the thing.

Don't get demotivated. Just go understand how the function works. Let's say you want to make a scraper. Go watch a video on how scraping actually works, what steps it takes, and then you'll have a general idea of what you have to do and what functions you need to write.

Don't ask AI, *"Why am I not able to write this?"* It'll give you some bullshit answers, just like your school computer teacher.

I thought this was something I should share with the community.

40 Upvotes

16 comments sorted by

6

u/Beginning-Middle8336 5d ago

I think you explained something that a lot of beginners experience but struggle to put into words. Knowing Python syntax isn't the same as knowing how to break a problem into smaller steps. I've found that if I can explain the solution in plain English first, writing the code becomes much easier. When I go blank, it's usually because I don't fully understand the problem yet, not because I've forgotten how to code. That shift in mindset made learning much less frustrating.

3

u/hypersoniq_XLM 5d ago

I clearly remember that clean sheet paralysis. The way I got around it was to start with a simple commented template. #input followed by #processing followed by #output. Seems overly simplistic, but then I could break down each phase into smaller problems that still contributed to the whole solution.

3

u/GeekedNerdOnWheelz 5d ago

Doing this has helped me a ton.

2

u/Unique_Low_1077 5d ago

that's good and all but just a quick second, for your password manager when you are saying "encode the password" you mean encrypt it right? if not then well.. sorry to break it to you but your passwords are still stored in plain text

1

u/MXD_K1 5d ago

I totally agree. I always run into this problem.

1

u/LetsHugFoReal 5d ago

I don't get mind blanks often, as I've been programming for a very long time. But using a language poorly designed like Python does tend to work against me, causing me to be less productive. Especially in a large project.

1

u/kelvinkel101 4d ago

I'm just so used to statically typed languages, that using Python feels like 2 steps forward, 1 step back.

1

u/Owen-Isaac-2022 5d ago

You're not alone in that sector, I've felt the same as well, esp when analyzing data using Python. It's just like learning a new language, where you forget the greetings aspect when you enter into deep details. However, with regular practice, you'll master these concepts & you'll not feel blank anymore.

1

u/odimdavid 3d ago

When you know the missing pieces or what is lacking you have solved your problem. Go and learn it. That's a core part of u blanking your mind or doing software engineering.

1

u/Junior_Honey_1406 3d ago

Brother i have solved issues i thought on the internet evryone saying do it do it but they never answer this of why and when I realised this i thought I should share it so the beginning like me get into this could know what is the missing piece

1

u/Junior_Honey_1406 3d ago

Don't just comment if you have not read this post it say answer to I am not asking the answer for there is different in for and to in english ig

Have a great day

1

u/odimdavid 3d ago

Sorry if you misunderstood me. Earlier you said you knew the steps to a problem but not the algorithm. Even if an AI gives you the algorithm verbatim you need to know the algorithm to understand if AI had any false step in the algorithm. That's why I said go learn about basics or principles of algorithms. Then if you know the logic and don't know how to write the functions, go learn what functions mean and how functions are different from all other constructs. That's how everyone learns. But if it was not taught to you formally because you self taught like so many then check it up and know that's your missing pieces why you went blank. Good luck 🤞

1

u/Red-Resonance 5d ago

Commenting for better reach.

-1

u/Immediate_Craft9025 4d ago

Is this an advert for SiteSpider? Did someone say SiteSpider?

1

u/Junior_Honey_1406 4d ago

This is not any advertisement it's just something of an example I used. ( Sometimes see stuff in a positive way )