First Year Advice To Be A More Productive Developer
My first year of coding professionally has taught me a lot about being a productive developer. Here are some lessons I've learned about coding and improving your workflow:
Learn Your Development Environment
Does your development environment support multiple cursors? Does it have a way to help you refactor code or change all instances of a function name? Is there a built in way to run your code? Knowing your environment can make you a more productive developer by being abel to do certain tasks faster.
Figure out what development environment you want to be primarily using and learn all teh important features. I primarily use VS Code, and I really enjoy the vast amount of extensions available to customize the environment that best suites my needs.
Text editors and IDEs also may have the ability to install separate plugins or extensions, making development nicer and easier. A couple of my favorite extensions on VS Code are: Better Comments, Bracket Pair Colorizer, and Live Server.
Better Comments changes the color of your comments, making certain comments more noticable when you need to remember them later. Typing 'NOTE', '!', or '?' all change the color of your comment that makes it easier to find certain parts of your code that you need to come back to.
Bracket Pair Colorizer changes the color of parenthesis and brackets depending on their level of nesting. This helps you to identify what block of code you are in and can help you debug any missing opening and closing parenthesis and brackets.
Live Server is useful if you want to run an HTML page that updates on your save changes. This is great for developing so that you no longer have to refresh the page whenever you make a change to a file. Even though this extension isn't needed when working with a front-end framework, it's useful when you want to test out a simple HTML/CSS/JS project quickly. I find this handy whenever I want to test some HTML and CSS code from a tutorial.
Project File Structure
This is a topic I've seen have a lot of mixed solutions because just like coding, there's no one right solution. Everyone may have their own preference for structuring their code. As more files and folders get added to projects, it's beneficial to adopt a proper file structure. For example, when using a front-end framework such as React, rather than grouping everything into a components and containers folder, it may be better to group everything by the component name.
One thing is keep in mind to being a productive developer is: don't spend too much of your time thinking about your project structure. Start coding and you can always make changes over time! However, if you know you'll be working on a big project, setting up the structure for a large project right away is beneficial and can save time in the long run.
The First Draft Is Always Messy
You've just been assign a task: Implement Feature A. You have an idea of what to do, but you need to read the documentation or watch some tutorials first. Maybe the tutorial is slightly outdated or the documentation isn't helpful. As you're trying to convert what you just learned into implementing your new feature, you may notice the code has become a huge mess. And that's okay!
Especially when it comes to learning something new and implementing it for your first time, it's likely the code you write will be messy and not follow best practices. Software is always about iterating, progressively making things better each time you work on it, just like writing an essay. As you progress in your skills, learn better coding practices, and receive feedback on your code, you can go back and update your code.
For example, it may not always be obvious at first that you should be encapsulating parts of your code in a class. As you write more code and start seeing a lot of repeated function calls, that's when you realize it's time to improve the code. To be a more productive developer, you need to be able to move on to new things while maintaining the old.
Think Slow
I think a lot of people assume that working fast, or appearing to be working fast, is the way to go when you work in a company. Yes, it makes you look like a great employee, but I don't think it's the best when it comes to coding. When you rush things, that tends to lead to sloppy code, which leads to more bugs, and... now you're trapped in a maintenance nightmare. I believe that having more time to think about your solution will benefit the business much more. Your solutions will be easier to debug, maintain, and easier for other developers to collaborate on new features.
Manage Your Time
As a developer, time is of essence. Don't spend too much of your time just watching tutorials, instead go out and try to implement what you need to! You'll learn more when you struggle because it forces you to have a better understanding of the code you are writing. There have been plenty of times when I've followed the code from a tutorial and ended up having no idea how it worked.
You also don't want to spend a bunch of your time making your code perfect. If that were the case, you'd never be able to launch your new product or feature! It's important to be able to ship your code to production, as that's what drives business. Writing clean and concise code is important when it comes to maintaining projects, but the road there doesn't happen overnight.
Structure Your Day
Knowing how your day is going to pan out is, in my opinion, critcial to your success and ability to get through the day. Find out what schedule works for you. Experiment with the different times to work, take breaks, and take care of your chores.
For me, I've found coding to me most productive in the morning. I'm more awake and ready to tackle on the day's challenges. Accomplishing things in the morning makes me feel better in the afternoon because as the day is winding down, I can see all the things I have achieved and have less to worry about. In the afternoon, I try to focus on any design or creative items when my brain is a bit tired, and it also tends to be more fun for me. This makes it easier for me to get through each day and help prevent burn out.
Structuring your day that's best for you takes time to figure out, but once you've done it you'll be able to be a more productive developer.
Take Breaks
One thing I've learned is how important taking breaks are. Spending hours coding and reading documentation all day can leave you exhausted and more likely to burn out. I prefer to be taking breaks and not burning out over burning out and needing days or weeks to recover. Would you rather be coding for a few years or many years?
I've solved countless problems when all I did is just take a break. Maybe go out and take a walk. Let your mind try to figure things out in a new environment. Maybe just that short 15 minute relaxation can do wonders for your mind and body. You'll come back to work with a fresh mind that's ready to tackle the next challenge.
Don't Spend Much Time Criticizing Code
You will work on codebases where you question why the team chose to implement things in a certain way. Maybe the code quality is terrible, there's a lot of repeated code, and the framework being used is pretty much ancient. You can complain all you want, but that won't get you anywhere. A productive developer doesn't waste time complaining. They come up with solutions. It's important to be understanding and aware that the team who last worked on the project may have unexpected circumstances such as trying to meet a deadline or having newer developers working on the codebase. Maybe the tools they are using was brand new at the time and there was no good documentation provided. Instead of criticizing the code, find ways to improve it!
There Will Always Be New Things To Work On
Software is constantly evolving. There will constantly be new things to add, revise, and update. Tools and libraries update all the time, so it's important to be aware of what you choose to use in your project. I remember working on a project using Flutter, a cross-platform mobile UI framework that was beginning to grow rapidly, and there were a lot of frequent updates going on. It was hard to keep track of all the changes. That's what happens when using new technologies. As software matures, this becomes less of a problem (At least, that's what we hope for!).
When wanting to introduce a new package, library, or dependency to your project, ask yourself, "What are the pros and cons of adding this?" If you only need one function from the library, can you just implement it yourself? Does the library get updated often? The developers would have to keep a closer monitor on these changes, which may not be the best use of their tiem.
Technology advances, design principles change, and new tools are introduced over time. There will be plenty of things to learn and work on.
The Value of Testing Your Code
I took a class on Software Testing where we had to build out a project and then test it. It didn't make much sense to me at first. Why am I spending my time doing this? What do I need to test? Once I started working on production code, it all made sense. Writing tests helps ensure that the features don't break as you create new ones.
When you write tests, it documents what your code should do and shouldn't do. This also helps with CI/CD (Continuous Integration/Continuous Delivery) and you can have higher assurance that the code being deployed won't break.
How many tests should I write? Sure, you could go out and write a hundred different tests for one function you made, but that's not the best use of your time as a productive developer. So what should you do? Focus on the tests that provide the most value. That may consist of: valid inputs, invalid inputs, and any edge cases.
Rewriting Software is Tough
When it comes to writing software to use a new framework or programming language, it can get quite difficult. Frameworks change the way we write code. Consider how different writing code can be for a Vanilla JS project vs a Vue.js project. In Vanilla Js, you may need to have a folder for models, views, and controllers. A React or Vue project on the other hand encapsulates these within a single component.
When you decide to do a rewrite, you have to ask yourself: Is iti worth it? Is it worth all the time and effort to do this?
Keep Learning
There's a ton of things to learn, and it can get quite overwhelming. The best thing you can do is to just constantly keep seeking out new challenges and learning new skills to really advance in your career. Keep exploring new technologies and working on side projects gradually over tiem. Being a good programmer is all about being able to adapt to the new tools and technologies that change over time. But remember not to stress too much, because all the hot technologies and buzzwords you hear take time before they are adopted in the industry.
Summary
These are things I learned in my first year of coding professionally that I will take with me in my career to being a more productive developer. Programming is not an easy task and there are a lot of things that people overlook when they look at developers. It's exciting to learn new technologies and new skills, but you also have to be able to understand the upsides and the downsides.
To summarize:
- Learn your development environment to increase your productivity.
- Structure your project in a way that is easier to manage and maintain.
- Don't stress over your first draft, just code!
- Take your time to come up with good solutions.
- Spend your time on the things that provide more value.
- Plan your day so you know what you need to get done.
- Give your mind a break so you can be ready to tackle the next challenge.
- Look for ways to improve codebases rather than just criticizing them.
- Software is constanly evolving, so be prepared to update your code.
- Test your code! You wouldn't want to be woken up in the middle of the night because there was a bug in your code.
- Rewriting software is a big task, so before attempting, weigh the pros and cons.
- Continue picking up new skills and challenges!