SECRETS TO LEARN AND WORK TO BECOME A GREAT PROGRAMMER

The following article is a compilation and selection of ideas and good answers to the question: What are the best-kept secrets of great programmers? These secrets suggest how you should think and act, rather than providing code snippets for you to copy and paste like on StackOverFlow.

1. About Code and Testing

  • In most cases, using inheritance is bad design, making the code hard to test and maintain. Switch to composition and combine it with interfaces. (You can read more about preferring composition over inheritance).
  • Don't use interfaces until you are clear about the domain of the program. (Each time you need to add a function, you'll have to add it to the interface and its implementation, doubling the effort).
  • Security/encryption is difficult. Don't reinvent the wheel, reuse existing libraries and algorithms unless you know exactly what you are doing.
  • There are countless reasons a program can crash: incorrect deployment, faulty input, misuse by users, overload, etc. Be prepared: log exceptions, test deployments on test servers, set memory limits, etc.
  • Network connections (HTTP, socket) are prone to issues. Always set timeouts, use libraries to wrap these connections, and retry when problems occur.
  • Each line of code added makes the program slightly more complicated and increases the potential for bugs. Removing code is often the best way to reduce bugs.
  • Validate user inputs to ensure security and minimize bugs.
  • Reusing code doesn't necessarily make your code easier to maintain. Reusing code across different domains may tightly couple them.
  • Only test what needs to be tested. Testing too little may overlook bugs; testing too much wastes time and makes updating test cases cumbersome when requirements change.
  • When committing code, keep the codebase small, functional, and write clear commit messages explaining what you did and why.

2. About Work Methodology

  • It's difficult to estimate the time required to complete a module/project, which is why people use Scrum.
  • Code for yourself and for others to read. Add comments explaining "why," especially where you think you might not understand your own code a year from now.
  • Understand the libraries/frameworks you use. Don't try to rewrite things that others have already spent time on.
  • Make project builds as quick and convenient as possible. Be sure you can build from the command line; it's very useful (e.g., for remote builds, CI).
  • Know your tools (IDE, source control, build tool, Photoshop). Try to learn and get comfortable with hotkeys; limit mouse use. You'll work faster and more professionally.

3. About Personal Development

  • The fastest way to learn and level up is to study the code of open-source applications and frameworks.
  • Code reviews are one of the best ways to improve; having someone evaluate your code helps you differentiate good from bad code and avoid basic mistakes.
  • Learning a new language can introduce you to new concepts and perspectives, making your thinking more flexible.
  • Understanding object-oriented programming is easy; designing systems in an object-oriented way is hard. Study SOLID principles and design patterns to deepen your understanding.
  • Always be learning, but don't always chase new technologies. That is, don't pick a technology for a project just because it's hot/new/good.
To become a great programmer, not only do you need deep specialized knowledge, but you also need critical thinking, a thirst for learning, and effective team-working skills. Apply these tips to your learning and working process to assert your value in this highly competitive industry.