7

I just don't like copy-pasting the code. can I become a good programmer?
please give honest opinions in the comments.

Comments
  • 4
    Well then write your own.
  • 2
    Copy paste paste paste paste paste
  • 1
    If you don't like doing something, especially one that doesn't make you good, stop doing it
  • 0
    Good, maybe. Fast, probably not.
  • 5
    Writing it yourself increases ability to remember it, but that's not to say you can't copy/paste appropriate code and blend / rewrite it for your requirements.
  • 1
    As some wise people said, you shouldn't be copy-pasting it but typing it (even if it's verbatim).

    And you may already know this, but copy-pasting isn't something you should rely on, especially if it's the main thing you do instead of coming up with your own solutions.

    I mean, if you copy paste a short code and spend time reading and understanding it, it will never be as helpful as typing it because you'll
    - better understand what it does, what's going on,
    - see how the solution came to be vis-à-vis a problem it's trying to solve,
    - realise how *you* would have done it (like, "oh! I'll have used this instead of or not put that here"),
    - notice snippets that could be used to solve other problems or provide new ways to solve problems you already solved.

    And if you end up copy-pasting your own code, then it may be time to refactor (c.f. DRY principle).
  • 0
    Copypasting verbatim is a bad thing only if you do it without understanding the contents. I wouldn't say it's bad if you look something up, find that it suits your use case (and already understand what it's gonna do because of that), and then just paste it in. Chances are that you'll need to do some edits though, kneading the code if you will.

    For example recently I found on https://forums.whirlpool.net.au/arc... that you can in fact convert internal packets with MTU 1500 to the Wireguard tunnel's MTU 1412. I did have to adjust it a bit to make it use the Wireguard interface and not a PPP one. Understanding the fundamentals of what you're pasting in helps a lot with that. After that you can just reference it for later review, when you need to recall why you did things the way you did.
  • 1
    Serious question: why would you ever copy/paste code? Reimplementing a radix sort?
  • 0
    I would think copy lasting something comes with an effort to understand ehat is being copy pasted.
    Do that and you will be ok.
  • 0
    I'm confused. Is this about copy-pasting examples without understanding what they mean, or like, refusing to ever copy/paste some boilerplate code and preferring to type the whole thing out every time?

    Any devs worth their sort will generally avoid the first one of those like the plague, but almost every dev will do the second, particularly in boilerplate heavy langs.
  • 1
    @AlmondSauce Or spend hours abstracting it away to save them minutes of typing. That’s what I do. It’s great.
Add Comment