As a developer we tend to do two things which are coding and designing. We basically start from coding but have you ever thought that what do we do before coding? Yes, the purpose. What ever we do, we do with at least a purpose. I’m not saying about the requirements. We have to complete the requirements for sure. What we want to discuss here are our standards. Before we get our hands into business we ask ourselves many questions.
- How to do our best?
- What are the meanings of what we are doing?
- Are we getting hurry to complete the tasks with bad or basic qualities?
- What make us different with other developers?
- Why to be difference? Get better job?
- What is the value of this job? What is the problem we solve.
Many questions and we have also many answers. For me, I focus on Value. Value is the most important. We are solving problems for customer. We have to make sure that we solve current problems without generating many other problems from our solutions.
I. Five Values
Whenever writing our code. We always remember 5 values?
1.1. Readable
First of all, the code must be readable. We code not only for us but also for other team to read. Imagine that those tasks only we can do. We will get stuck at them. One year later we look back our code and can’t understand ridiculously. Focusing on interfaces. Coding somehow we know the purpose of code by interfaces without reading the implementation. Separating the interfaces, following Interface Segregation. Small understandable interfaces.
Apply S.O.L.I.D, design patterns.
1.2. Extendable
Ease of scaling. Following open/close principle we code somehow separating what regularly change from what stay the same. As we modify our code, we also take risk. Can’t avoid that but we limit chances to modify code. Changes come with at least a reason. Practising Single Responsibility we isolate the responsibility. Thus, only one reason for change for any pice of code. Decoupling classes and functions by using Dependency Injection for exam. At the end, we must ask ourselves is it easy for extending? What changes will be made in future? How can I prevent the modification but doing additional implementation instead, by using inheritance, mixin etc.
Apply S.O.L.I.D, design patterns, best practices.
1.3. No Error
Customers hire us to solve problems, not creating problems. Many errors we have to fix will make bad productivity. Because we get stuck with bugs, can’t create features witch is the key help customers.
Apply Automation Tests. Think before code. Cover edge cases. We have a change to think of many scenarios before writing our code. We catch exceptions, make it fault tolerant.
1.4. High Performance
Obviously, performance is crucial. Performance in this post is the performance of code, not whole system. But entities related to each other. We always ask why we do this, not do that? There is no best solution. Only better solution. Can we improve it more, better and faster? Always trying to find more than one solutions for problem.
Memory Leak, Garbage Collector, Database etc.
1.5. Security
Obviously. Security in code. OOP 4 principles: inheritance, encapsulation, polymorphism and abstraction. Session, cookie, cross site request forgery etc. Rails security.
SQL Injection, Authorized Mechanism, Encrypt/Descrypt etc.
II. Conclusion
Those are five values we have to always think of whiling coding. Coding is the foundation skills of any developers or even architects. A good architect needs to be good at code arrangement. Building system, buildling applications.