June 9, 2016
There are many different paths that go into being a skilled programmer. Whether it’s starting out with interest in coding from the beginning, or entering from a different background, being a skilled programmer doesn’t have to be linear. From utilizing bootcamps to networking with those established in the field, being a programmer takes a lot more than just having knowledge of the languages you use in the field.
In fact, being a good programmer can come from sources that you hadn’t considered before.
A recent post on Quora looked at advice from a variety of programmers at various stages of their career. Here’s some of the top pieces of advice given that can help you on your journey to becoming a better programmer.
Proper encryption is hard. Don’t invent it yourself unless you have a good reason to.
About Side-Effect Free Logic
Side-effect free logic is nice. It makes it easier to reason about state and generally simplifies automated testing.
Concurrency can be hard without the right primitives. Threadpools, queues, observables, immutability and actors can sometimes help a lot.
Know your basic data structures and understand time complexity. It’s an effective way of making your code much faster without adding complexity.
An application will eventually break; bad deploy, unintended behaviour, unintended input or unintended external load. Plan for that. This includes making sure you log uncaught exceptions, test a deploy works after it’s out (and potentially roll back), should run tests continuously, but also should make sure to set (sane!) limits on all in-memory queues and thread pools.
Be Prepared for This, Too
If you monitor the size of a queue, it’s generally always full or empty. Plan for that.
Networks and external services should always be expected to be flaky. Always set socket timeouts on your sockets and read/connect timeouts on HTTP calls. Consider wrapping external network calls in a retrying/circuit breaker library
How to Write Code
Write code as you want to read it. Add comments where you think you will not understand your code in a year’s time. You will need the comment in a month.
Building Your Projects
Making sure your projects can build from command line makes things so much easier down the road.
The Value of Open Source
Popular Open Source projects are a great way to learn about good maintainable code and software development process.
Every piece of infrastructure (databases, caches, message queues etc.) your application is a source of bugs, requires maintenance & new knowledge. Not to mention that such dependencies might slow down productivity. Weigh new infrastructure against productivity carefully. Can you replace an old piece of infrastructure with your new?
Code paths that handles failures are rarely tested/executed (for a reason). This makes them a good candidate for bugs.
Always Keep Learning
Learning a new programming language is a great way to learn about new paradigms and question old habits.
Build Your Toolbox
Know your tools; That includes your editor, the terminal, version control system (such as git) and build tooling
Learn to use your tools without a mouse. Learn as many keyboard shortcuts as possible. It will make you more efficient and is generally more ergonomic.
Reusing code is not an end goal and will not make your code more maintainable per se. Reuse complicated code but be aware that reusing code between two different domains might make them depend on each other more than necessary.
Listen to Your Body
Sitting for long time by the computer can break your body. 1) Listen to what your body has to say. Think extra about your back, neck and wrists. Take breaks if your body starts to hurt. Creating a pause habit (making tea, grabbing coffee) can be surprisingly good for your body and mind. 2) Rest your eyes from time to time by looking away from your screen. 3) Get a good keyboard without awkward wrist movements.
You can read the whole post over on Quora.
Image Credit to Dino Latoga / Flickr.
Did you like this article?
Get more delivered to your inbox just like it!