First of all you must understand something. As a Software Developer you will never know enough, you will never be ready for what is coming. Something will always pop up and someone will always know stuff you do not know. This is the life of a Software Developer and this is how it will always be.
1. Test your code thoroughly.
We all hate when people come to us with bugs in our code, telling us that the feature we developed is not working properly, that bug fix we deployed is not really a fix or it broke something else. The most basic way to avoid this is to thoroughly test our code. Test again and again before submitting. If you want to avoid people coming to you with complaints or other developers ripping apart your code then you have to be more thorough in your testing and more sure that it works.
2. People will still rip apart your code
No matter what you do, there will always be mistakes in your code. Understand that programming is a combination of love for your code and willingness to hear to other people’s critique on your implementation. Different programmers have different insight to provide and different knowledge. As we said at the top you will never know everything and there will always be people with knowledge that you are lacking. You will need to remove your self worth from your code. YOU WILL make mistakes and code reviews are the best way to learn them and software testing are the best ways to learn from them. Would you prefer your mistakes going live to the customer, costing money to the company and then being blamed for it?
3. When you ‘Copy and Paste’ code, understand it
Google is our go to guide when we are looking for ways to implement something, looking for ways to work with an API or basically everything. But before copy pasting code from any website first understand how it works. Better yet do not copy paste at all. Read the implementation, understand it and then do it yourself. that way you can be sure that it is bug free, or if it’s not, fix any existing bugs in there. Use that code snippet and all others you find online as building blocks in your career so you can learn, understand and grow from them. Instead of throwing random code snippets in your project that just “work” learn from them, build a career not a house of cards.
4. Code Reviews
As stated above code reviews are important. People will review your code they will find mistakes, they will point ways that your solution could be implement in a different way, something more efficient, something less error prone, something more readable. Same goes when you are reviewing other people’s code. You will see how other people think, how they implement solutions. There always more than one solutions to a problem and it’s always good to learn more. And you will learn a lot from watching others get and give feedback. Yes some people are dicks when giving feedback, maybe you should give them feedback on their feedback (you might even help out their friends and lovers! being able to give feedback is crucial for all human relationships). Innovation and learning comes out of exposing your code and being vulnerable to feedback.
If you are in a company where code reviews are not valued pressure your team leader or your boss to enforce them. If they do not share your vision then leave while you still can.
5. Ask Questions
There is a balance between asking too few questions and too many. On one hand you may take too long to solve a problem and build that feature – on the other hand you may well piss off those who are senior to you or work close to you. This is tough, my general rule of thumb is to ask if you cannot figure it out after 40 minutes.
In my first job I think I did not ask enough from the get go. I did start asking questions after while but not from the start. I know I would have grown faster if I had. That said when you are interrupting someone who is in the zone, it feels, well, difficult. Also when they are in zone they often look grumpy, constipated or are frowning and generally look unapproachable. You will learn the clues on their face over time on when to ask. Of course my personal view is when my colleagues ask me for help, I will always help. I have this crazy notion that collaboration is fun, yes even face to face! In the end I find it easier to work in a place where I like the people and they like me.