Becoming a Better Software Developer
Being a developer is not simply knowing how to write all computer languages or using the most sophisticated algorithms, being a good developer is to build a piece of software that is going to be maintainable, flexible, secure, easy to use, and that is going to have good performance. Besides accomplishing these points, you are also responsible for continuous self-development, learning new technologies and methodologies to build better software. Becoming a good developer takes studying, frustration, mistakes, wins and loses, sleepless nights, pretty much real world experiences (personal experience, if you spend more than 1 hour in one piece of code and it doesn't work, take a break, go get coffee, walk around the building, when you get back at the code you will find the solution within minutes. It happens way too often). In a high level overview these are some of the topics to become a better developer.
Maintainability
What does it mean to have maintainable software? Let's take a look at this scenario, you just finished writing your code, you know better than anyone how the code works; now you moved on to a new exciting project. Two months later the product manager wants to add more features to the software and a different developer is in charge of this. The code written should be easy to understand by any developer (Jr - Sr) in order to add functionality in as little time and with the least risks as possible. A good developer knows how to structure the code in a way that it reads like a story, easy to follow and easy to troubleshoot in case the software causes issues.
A good way to keep the code maintainable is to follow industry best practices and some simple rules:
Documentation - You will be thankful you did
Consistent naming schema - camelCase, underscores
Don't Repeat Yourself (DRY) principle - Create reusable methods
Keep it simple - Avoid doing complicated code and deep nesting
File and folder organization - Keep your files organized in folders based on logic
Write less coupled code - Avoid monolithic software, aim for micro-services approach
Flexibility
By writing more maintainable code as described above, would pave the way to have more flexible code. Organizing your code and writing less coupled code gives you the flexibility to add functionality to the program without making big modifications in the existing code. Keeping it simple and following the single responsibility principle which states that one class or module is responsible to do one specific functionality of the program gives the developer flexibility to create more classes or modules to accomplish the next feature without changing or potentially introducing bugs to the existing code base.
Secure
A good starting point to writing secure code is to look at the OWASP top 10 security risk here are top 4 in the list
Injection - Attacker's attempt to send data to an application in a way that will change the meaning of commands being sent to an interpreter
Broken Authentication - This happens when the attacker gains access to the application through brute force attacks, social engineering, poor credential management etc.
Cross-site scripting (XSS) - Enabled attackers to inject client-side scripts into web pages viewed by other users
Insecure Direct Object Reference - Occurs when user supplies input that is not validated and direct access to the object requested
Easy to use
As mentioned earlier, writing maintainable and flexible code makes it easier to use and implement. Because the code is separated by its function you can reuse pieces of the code whenever it is needed without having to re-write it or test it again. For instance, if you write a function to mask someone's social security, you can invoke the same function every time you need to mask a SSN without having to write the logic again. This makes expanding functionality of the software easier and faster.
Performance
Another piece of good software is performance, nobody likes slow software. This requirement depends on the use case of the software you are building. Ask yourself and the proudct owner a few questions. Do you need the page to load in milliseconds? Is it acceptable to load within a couple of seconds? If you are building a input-output software, you might want the page to load in less than one second, if you are building a reporting portal, a couple of seconds might be acceptable. As a developer you are responsible to write the code as performance oriented as possible. In case of APIs, make as few calls as possible, keep the payloads as small as possible. Performance tuning is a big topic that we can spend hours and hours discussing, just keep performance in mind when designing and building software.
Self-Development
Technology keeps evolving every day, from new computer languages to new frameworks, software architecture and even methodologies to organize development teams to be more efficient. In order to become a better developer, one needs to stay on top of where the industry is moving to stay relevant. Software development is not just a science and art (Learn more about the art of Software Development) but is also a business, in order to stay competitive one needs to stay educated (Learn more about ways to get educated about software development).