Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Failing for a bit, thinking hard and then somehow getting to the answer - for me it was usually tutorials, asking on stackoverflow/forums, finding a random example on some webpage.

The fastest way for me to learn something new is to find working code or code that I can kick for a bit until it compiles/runs. Often I'll comment out everything and make it print hello world, and then from there try to figure out what the essential bits I need to bring back in, or simplify/mock, etc, until it works again.

I learn a lot more by forming a hypothesis "to make it do this, I need that bit of code, which needs that other bit that looks like it's just preparing this/that object" - and the hypothesis gets tested every time I try to compile/run.

Nowadays I might paste the error into chatgpt and it'll say something that will lead me a step or two closer to figuring out what's going on.



Why is modifying working code you didn't write better than having an AI help write code with you? Is it that the modified code doesn't run until you fix it? It still bypasses the 'hard won effort' criteria though?


I forgot to say, the aim is usually to integrate it into a bigger project that I'm writing by myself. The working code is usually for interfacing to libraries I didn't write - I could spend a year reading every line of code for a given library and understanding everything it does, and then realise it doesn't do what I want. The working code is to see what it can do first, or to kick it closer to what I want - only when I know it can do it will I spend the time to fully understand what's going on. Otherwise a hundred lifetimes wouldn't be enough to go through the amount freely available crapware out there.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: