Hacker News new | ask | show | jobs
by bowlofpetunias 4406 days ago
Uhm, that's how I still learn new languages. Copy, paste, modify just to get something done.

The modify part leads to more concrete questions, more Googling, more detailed reading of docs, until at some point I'm engaged enough to go back to zero and actually start learning the language from the basics.

(This doesn't work for those languages who's paradigm you first need to understand before being able to do anything, but most languages allow for hacking straightforward procedural code at the basic level.)

1 comments

I mean this in the best way possible, but do you like actually take your mouse over to the webpage, highlight the code, copy it, and then paste it into your editor? I am genuinely curious.
Yes. I do this from time to time. Recent example, wasn't sure what the event was called in JavaScript when the window changed. Couldn't remember if it was resize or windowResize or whatever.

SE had a sample dummy event listener add function, complete with // do stuff here. I cut and paste the whole thing and added what I needed.

I suppose I could've retyped the addEventListener function from scratch but...I dunno, that seemed inefficient. I just needed the name.