Ask YC: What is "quality" code?
What is it? Links code that you consider to be great would be appreciated.
What is it? Links code that you consider to be great would be appreciated.
Besides, good code is inseparable from good architecture, for which beauty=simplicity applies as well.
You'll know it when you see it.
me = any developer
:o)
http://www.amazon.com/Complete-Microsoft-Programming-Steve-M...
In quality code, the cost of changing the code grows more slowly than the benefits.
Everything else flows from this: functionality, readability, clean design, appropriate technology to problem, appropriate effort spent on problem, availability of programmers who can work on such a system, management of legacy features, and foresight of problems and opportunities in the future. Lame 10-line bash scripts that even repeat a few lines can be quality code. And so can entire application frameworks coded in C++.
The Agile people might say that the cost should instead be proportional. They would argue that if extension of the system is too easy, you probably overspent on the initial quality. But I feel in my bones that this is wrong. We should really be aiming for a polynomial or exponential ratio of benefits to cost.
Can the person who writes the code be the authority on whether it is quality code? If one of the most important aspects of quality code is how easy it is to maintain or extend. Shouldn't it follow that code shouldn't be considered good until it's maintained or extended.
http://www.amazon.com/Standard-Template-Library-P-J-Plauger/...
Some of the books you might want to read:
1) Code Complete (MS Press)
2) Effective Java/C++ (Joshua Bloch/Scott Meyers)
3) Design Patterns
4) Refactoring
I don't know other books/library that can answer this question from other language (such as LISP, Python and Ruby)
And the Design Patterns and Refactoring should be considered starting points, not the be-all-and-end-all of programming. Every programmer should be familiar with them just for the vocabulary. But there are better examples of programming in SICP, On Lisp, Programming Pearls, and TeX: The Program.
I'm not currently programming in functional language so I can't really say how much SICP and On Lisp help people to write better software. To my understanding, despite the praise of LISP for clean code, the statement mostly come from experience developers with years of flight-time. I began to question whether LISP actually helped them much given their extensive experience.
Paul Graham (or insert any bloggers that praised LISP) said LISP helped him code in a better way (and etc etc etc) but Paul Graham never program in Java so how do we know if his LISP experience actually help the way he programs in OOP?
Other experience developers said Scheme helped them to have clean code but then again, they threw that statement after x-number of projects in which I'm sure they've learned a lot anyway.
SICP does teach you about elegance and introduces a wide variety of programming concepts. I guess these are valuable in the quest for "quality".
I do recommend Effective Java and Effective C++ (and its sequels). They show the limitations of the respective languages and how to overcome them.
Which leads us to code litterature.
And poetry.
And haiku.
$de&&bug( "Carpe diem")