3 ms·
At the end of the day, good code is code that solves your problem. Trying to define "good code" without considering the problem will not deliver much punch. If
by ysavir 10y ago
At the end of the day, good code is code that solves your problem. Trying to define "good code" without considering the problem will not deliver much punch.
If we're talking a small application, such as a new startup, writing efficient and optimized code is hardly a concern. In this case, good code means flexible, easy-to-change code. The code must make it easy to modify existing features and add new ones.
Compare that to, say, Google's search. The feature isn't evolving much anymore, in terms of functionality, but it needs to be as efficient and optimized as possible, considering the bulk of data it needs to read through, and the immense traffic it gets every second. Sure, you still want flexible code, but speed is critical.
If we're talking an open-source project, the most important part could very well be documentation and ease-of-read. when you have dozens to hundreds of people writing new features, making optimizations, and solving bugs (in their free time and without compensation!), quality of communication takes on a new significance.
These are, of course, simplifications, and the accuracy can be debated (as these situations always have an incredible variety of factors), but the point is that "good code" is not something that can be defined in a vacuum: it can only be defined in terms of the situation at hand.