DEV Community

Christian Lutz for InspiredProgrammer

Posted on

Should you follow a tutorial about a specific topic and implement it into your project? πŸ€”

I'm working on an authentification function for my project "ServerMonitor". My knowledge about such a topic is quite small, so I searched for a tutorial on YouTube to get it done.

Working through this tutorial helps me a lot but it feels wrong.
Everything I have programmed so far was a one to one copy of this tutorial which brings me to the following question.

Should you follow a tutorial about a specific topic and implement it into your project?

I mean, you get a lot done and learn something but it is not your own code.
Should you rather try to get through the documentation and try to solve everything on your own?

How do you deal with it?

Discussion (5)

Collapse
vuild profile image
Vuild

Yes. Copy exactly if you need to or learn if you need deeper experience.

When iPhone apps launched I was copying 12 yr olds on YouTube to learn Xcode tips. Nothing to be ashamed of (the opposite, I'm impressed). Pretty much everything that exists came from people copying people.

If you can copy, then improve, value add or extend, that is usually better.

All the biggest sites in the world are copies of other sites, all the most famous art is copies of other art, same with design, development, product, anything really.

Try not to copy the wrong stuff though.

The truth is: The result matters. Does the thing do the thing it is supposed to do? How well does it do it compared to other things & how long did it take you? (if budget/time is critical, which is most of the time).

If you copy paste a site that improves a life, it still improves a life. The feelings should be invested in the result (impact) rather than the tool itself (it's nice to appreciate craftsmanship & all that of course).

Don't code airplanes like this.

Collapse
chrislutz profile image
Christian Lutz Author

Thanks for your comment. πŸ‘πŸ»
I got it.
Copying (if allowed) what you need and then expand as you need it is better than writing everything on your own because the result matters more.

Collapse
vuild profile image
Vuild • Edited on

You're welcome.

It's a bit like a Chef, you can get hung up on 13 course meals that the customer doesn't even like but a tiny bunch of snobs praise you for or you can deliver 10,000 meals a day to hungry workers but seem useless. It depends what you are looking for in terms of results or career too.

Example:

  • Make your own CMS & not publish much but have a small audience of devs who think what you do is cool.
  • Take WP, install, publish some tips, promote & influence more people.
  • Spend years refining one thing.

I do a combination of whatever is needed, I don't really think one is better than the other. For example, on my site I made my own share buttons because I don't want the privacy violations or slowness that all other options offer. I used the WP vanilla theme & customized instead of write one from scratch.

I work this way:

  1. Desired result (enhanced performance, control & privacy share btns, no plugins).
  2. Best way to achieve it (look at options, decide I need to write a better one or use someone else's that meets my needs. I did a bit of both - it's still copying stackx or whatever).

Result:
CSS customizable in-theme inline SVG share icons on posts that do not notify the service provider (twit/fb etc) of every visitor to the post (no embed, nice privacy for all) or slow things down (the fb btn is heavier than the sites I build). At the moment it has no share count (also solvable easily while private) but I am taking off social icons everywhere for the most part so I probably won't update it.

Effort? Slightly more than grabbing the regular code or using an existing plugin but I use it many times & it is much faster (paste into new theme & go, no updates, downloads, code inspection etc). Now it is a tool in my toolbox (they add up over time).

  • The end result is exactly what I want for my users, which is the goal.
  • Time-wise I am up already. Cost/resource wise (this matters, because most failure is misplaced resources).
  • Industry respect, don't care. They all use those bad options but praise each other. People who are willing to do what they want against the crowd are always more interesting.
  • Worry, none, too busy implementing something else. Can't even remember that other thing that well anymore as long if I chose well.

Good code changes a lot. Bad code doesn't. How likely is V1-2 to be good?

My advice is do it the way you think is right (but know why). That's how we got exactly where we are today.

Collapse
coreyja profile image
Corey Alexander

I agree with what Vuild is saying here, but wanted to expand on one bit as well!

You said this in your post:

Everything I have programmed so far was a one to one copy of this tutorial

And it made me think about the difference between actually copying the code, and watching a tutorial and recreating the code. And I think there is a big difference between the two!
You probably could have gone to Github (or wherever) and found a completed project that already implemented the code you needed, and just copy and pasted it. And that probably would have got the job done.
BUT I think if you recreate the code in the tutorial, you are at least going through the physical act of writing the code and that helps you learn! Just cause it wasn't a completely original piece of code doesn't mean you didn't actually write it.

And I'll specifically say something about this question too!

Should you rather try to get through the documentation and try to solve everything on your own?

It obviously depends on the problem and you're comfort in the area, but one big factor is what your goal in this project is. Are you interested in getting a working project done quickly and well? Is your goal to learn? Do you like building things from scratch and don't have a time constraint?
All these come into play when for instance I decide how I am going to approach a project, and especially a side project.

I'll give a little example! My currently deployed blog is written in a Ruby framework called Middleman, and it works pretty well! I have a custom CI/CD pipeline setup and I like it. BUT simply having a working project isn't really my main focus for my blog. It's also a place for me to play around and learn new things! So I recently decided to rewrite the guts of the thing using Gatsby! I'm gonna get a few nice 'user' facing benefits out of it like better offline support, but that wasn't really what motivated my decision. I wanted to learn Gatsby and that was more important that the project I actually shipped. And also, since I already have an existing blog I have no time pressure to finish the rewrite. All that boiled down to deciding to completely rewrite the project in Gatsby. I'm gonna take my time and do it how I want to do it, (copying liberally from online resources and projects πŸ˜‰) and learn a lot along the way.

Collapse
chrislutz profile image
Christian Lutz Author

Thank you for your comment!πŸ‘

It really makes a difference if I simply copy and paste an existing code or working through a tutorial, despite it was exactly the same.
The result is what matters and if I work on this part of the code in the future, I will surely extend it on my own.