In the age of continuous everything, being able to write code quickly is often critical for being a successful developer. If it takes too long to churn out code for a new feature, you risk being the kink that holds up the rest of the continuous delivery pipeline. In short, faster coding is better coding (assuming that code quality and security is maintained to the standards you are working in, of course).
If that sounds stressful, worry not. Here are six tips for increasing the velocity of your coding technique and process (and, no, it’s not advice like, “Practice”), while at the same time maintaining code quality at the level that your team requires.
1. Choose a concise programming language.
You may not always have the luxury of choosing which language to write your app in. But when you do, you can achieve faster coding speed by adopting a language with concise syntax--meaning one that allows you to implement a lot of functionality with fewer (or shorter) lines of code.
Languages like Java and C++ are notorious for requiring lengthy code snippets. C tends to be much more concise. Languages like Python and Go are arguably somewhere in between.
When deciding whether a given language is too verbose for your needs, keep in mind that balancing the length of your code with readability is important. You may be able to write very concise code in C if no one actually has to read it. But if you want to write concise code that is also readable, Python might be a better choice. Python tends to be a bit more verbose, but its indentation rules can help to keep code readable, even if it’s written without a lot of care.
2. Adopt (and learn) a programming style guide.
Sometimes, the biggest obstacle between you and faster coding is struggling to figure out which programming conventions you want to use.
Should you use tabs or spaces? How do you handle capitalization in variable names? Thinking about questions like these can prevent you from churning out code quickly.
You can eliminate these uncertainties by making sure your team adopts and adheres to a programming style guide. A programming style guide defines the conventions that your team will use. In addition to helping to keep code more consistent across the organization, a style guide helps you write code faster by avoiding time wasted thinking about which conventions to follow.
3. Communicate with your team.
For some developer teams, the biggest source of delays in programming is not the code itself, but poor communication about who is supposed to be writing what. If you can’t write your function until someone else writes a different one, or if you duplicate functionality written by someone else, your delivery velocity will suffer tremendously.
That’s why having a game plan for each new development cycle is critical. Before anyone starts coding, your team should make clear who is going to write what and in which order, and how each person’s code will be integrated and tested.
If you are doing sprints, you can establish your plan during weekly or biweekly meetings. For continuous delivery operations, you will need to rely on real-time communication channels and source code management tools to help coordinate coding responsibilities.
4. Use a cloud IDE.
Cloud IDEs let you write and test code in the cloud, rather than having to set up a local IDE on your PC or laptop. While the time spent on IDE setup may not be very significant, the time wasted when your local IDE doesn’t have enough resources to do what it needs to do does add up quickly. If you can’t build and test your latest code efficiently because your PC has run out of memory or maxed out its CPU resources, you will end up coding more slowly.
A cloud IDE eliminates this risk because cloud IDEs have a virtually unlimited amount of resources at their disposal. In addition, they offer the benefit of allowing you to deploy code more quickly to cloud-based host environments, since you don’t need to worry about uploading it from your local machine--it’s already in the cloud.
Of course, the caveat is that cloud IDEs work well only when you have a reliable and responsive internet connection. If you do a lot of coding on the go, a cloud IDE may not work as well as one that runs locally. And if you are writing code where resource consumption is less of an issue, a local IDE may work just fine. But, in general, cloud IDEs can provide some important speed improvements when it comes to coding.
5. Choose the right IDE.
Speaking of IDEs, whether you use a cloud-based or local option, choosing one that works well for you is a critical step toward faster coding. There are a lot of IDEs out there. They have different interfaces and different workflows. If you have a choice (that is, if you don’t work for a company that requires you to use a certain IDE), spend some time experimenting with different options and choose the one that works best for you.
Keep in mind that some IDEs, like Eclipse, are truly general-purpose and work with an array of programming languages. Others, like Visual Studio, are designed to be general purpose but tend to work best with certain languages (like .NET and other Microsoft-friendly languages in the case of VS). And some, like JetBrains WebStorm, work only with specific languages. Depending on which language you are coding in, one IDE may help you code more quickly than another.
6. Don’t be a programming perfectionist.
Developers have important roles to play in optimizing software security, reliability and performance. The advent of the cloud has made these considerations even important (not least, because inefficient code can easily bloat cloud computing costs). Thus, as a developer, you certainly should take reasonable steps toward making sure your code is as secure and optimized as possible.
But taking reasonable steps does not mean becoming a perfectionist or obsessing over these things to the point that you slow down your coding operation. There is a point of diminishing returns for careful coding; when you cross it, you delay production of an application without achieving a benefit that justifies the delay.
As a developer, you need to identify what that point of diminishing returns is for the code you are writing. That will vary from organization to organization and project to project. If performance optimization is a critical priority for your company, for example, then spending some extra time to write optimal code is worth it. But if you’re a venture-funded startup whose managers care more about getting new features out the door quickly than keeping code lean and mean and avoiding unnecessary cloud hosting costs, then it’s probably not.
Security is a more difficult topic. I don’t want to go on the record advising any developer not to worry about writing secure code. Still, the reality is that security needs are higher with some applications and some types of companies than others. Plus, it’s impossible to guarantee that any code is free of security flaws. For both of these reasons, developers who code quickly and effectively are the ones who know how much consideration to give to security issues--and when to stop worrying and hand off the code.
Another factor to weigh is how thoroughly your code is going to be vetted after you hand it off. If you have a thorough QA operation that is likely to catch performance or usability issues before the code goes into production, you may not need to worry about spending as much time trying to perfect your code as you would if there is only basic testing being done prior to deployment.
Writing code quickly is a challenge, but it is increasingly important for modern developers tasked with keeping pace with continuous delivery pipelines. With the right tools (like an effective IDE and a programming style guide) and the right techniques (like a healthy perspective on just how much effort to put into application performance and security), programmers can meet these challenges and achieve faster coding in a fast-moving world.