What is better? A good code with few bugs or a bad code without bugs?

1 points by pauloortins ↗ HN
What is better in your opinion, a good code with few bugs or a bad code without bugs ? I have discussing it with some friends in the last days and I wanna see another opinions.

3 comments

[ 3.7 ms ] story [ 16.3 ms ] thread
The question seems rather nonsensical. How can bugless code be bad? The only thing I can think of is coding style. But then, I also consider picking a bad algorithm a bug.
Empathy with the developer who will refactor your code
You'll have to define what you mean by better, and to whom. And how you measure the goodness of code.

The user or client only cares that software does what it's supposed to do. The author of the code may feel they could have done better. The programmer who has to maintain it may curse the author for writing bad code. "Good" code that doesn't do what it's expected to do or crashes or loses data is bad no matter how beautiful the code is.