Thursday, February 23, 2017

The biggest dev mistake: don't use your creativity

Outreachy program to me is more than over (actually now the applications are open to the next round after mine), but I decided to keep this blog as my dev blog. So today I figured out the worst thing you can do as a dev: don't use your creativity! That's a horrible mistake.

It happens when you just copy and paste code from internet without even realizing what the code is doing instead of just understanding the code to know how it would fit better to your code.

So I had to do a Spring Boot application for a Uni class, and I was only looking for on internet "How to do a PDF file with Spring Boot" because that was what I need to do, but there aren't many tutorials on that (like, how many would be to find . Ok, there aren't many, but I found a few: one that I find to be pretty good was that one. I blinded followed the tutorial, copying and pasting the code to my application, without only changing the name of the class (e.g. "Book" on the tutorial to "Tarefa" on my code). But the code didn't make sense on my application's contest, and I was breaking on some configurations file. Instead of trying to understand what was going on and trying to fix it, I tried to find a new tutorial that would match exactly with my problem just changing the name of the classes.

The thing is that in our dev's life, we'll never find something that matches exactly: and you will lost a lot of time trying to do so! The right way to use web tutorials are to figure out what they say and then think about your problem: it is not just copy and paste code changing class's names. When I gave up of looking for a sea of tutorials, and gave a think about it, i found a easy solution that was there right under my nose!

So this one was my today's lesson! I hope those thoughts can help any of you.