When I was in school in the 70's. (That's NINTEEN seventies.) There was this book called The Psychology of Computer Programming. This predates the microcomputer era as we know it. Punched cards were still common when the book was written. A computer was to control a new assembly line for a car company. They couldn't get the software to work. They called in an outside insultant. The outsider developed a program that w…
> Correctness comes first. Not always. Have you ever used a SNES emulator? There is one emulator that is more correct than all others combined - it's called BSNES and it's the most true to the original SNES hardware of all the available emulators. Yet it is horrifically memory/cpu hungry - that correctness comes at a huge cost. So no, correctness does not always come first, especially if you value other things like u…
Simple, correct, fast: in that order
201–210 of 349 posts
Re: Simple, correct, fast: in that order
#202Earlier quoted context omitted.
> Correctness is achieved by simplicity. That's... literally what I just said? "Achieving correctness is the whole point of making things simple, after all."
That's... literally what the author said. If your solution is not simple, it will not be correct or fast. Correctness may be the end-goal. But correctness is absolute. So it is a bad performance indicator to set as the goal. Yes, we can track bugs. But the absence of open bugs is no guarantee for correctness. I can never say "We are 5% more correct than last week. Keep up the good work!" Simplicity is a much better g…
Excellent, so we both agree with the author that correctness is the ultimate point and that simplicity is just a useful tool for achieving correctness. :)
> Simplicity is a much better goal for the day-to-day work. Because it can be tracked, measured and evaluated for every individual change.
How does one purport to measure simplicity?
Re: Simple, correct, fast: in that order
#203Earlier quoted context omitted.
Correctness is achieved by simplicity.
> Correctness is achieved by simplicity. That's... literally what I just said? "Achieving correctness is the whole point of making things simple, after all."
It's the other way around. Correctness is obviously the goal (and likely performance too, depending on your use case), but the way to achieve it is through simplicity. So simplicity should be prioritized - as it allows you to ensure correctness.
Re: Simple, correct, fast: in that order
#204When I was in school in the 70's. (That's NINTEEN seventies.) There was this book called The Psychology of Computer Programming. This predates the microcomputer era as we know it. Punched cards were still common when the book was written. A computer was to control a new assembly line for a car company. They couldn't get the software to work. They called in an outside insultant. The outsider developed a program that w…
More info here: https://en.wikiquote.org/wiki/Donald_Knuth
Re: Simple, correct, fast: in that order
#205Earlier quoted context omitted.
That quote actually refutes the OP by reinforcing that correctness is more important than simplicity. Achieving correctness is the whole point of making things simple, after all. To put simplicity before correctness would be missing the forest for the trees.
Correctness is achieved by simplicity.
Re: Simple, correct, fast: in that order
#206Earlier quoted context omitted.
Correctness is achieved by simplicity.
> Correctness is achieved by simplicity. That's... literally what I just said? "Achieving correctness is the whole point of making things simple, after all."
Re: Simple, correct, fast: in that order
#207Earlier quoted context omitted.
That quote actually refutes the OP by reinforcing that correctness is more important than simplicity. Achieving correctness is the whole point of making things simple, after all. To put simplicity before correctness would be missing the forest for the trees.
Correctness is achieved by simplicity.
For every problem there is a solution that is simple, neat - and wrong.Re: Simple, correct, fast: in that order
#208Correct, simple, fast, in that order.
In other words:
- First get a correct solution working that solves the problem correctly for typical as well as corner cases, hopefully with good test coverage for both typical and corner cases.
- Then improve the solution to make it simpler while preserving correctness.
- Spend time on making it fast when there is actual evidence of performance problems such as data from performance testing with current workload and expected future workloads.
The reason why I like to ensure correctness before simplicity is that many times what might seem like a simple solution initially might turn out to be the wrong idea when all corner cases need to be accounted for. Ensuring correctness first requires me to think through the corner cases well and write test cases early during the development phase. With correctness taken care of and protected reasonably well with test cases, it becomes easier to iterate on the solution and increase its simplicity.
Re: Simple, correct, fast: in that order
#209Earlier quoted context omitted.
Correctness is achieved by simplicity.
> Correctness is achieved by simplicity. That's... literally what I just said? "Achieving correctness is the whole point of making things simple, after all."
>> Simplicity is a much better goal for the day-to-day work. Because it can be tracked, measured and evaluated for every individual change.
>How does one purport to measure simplicity?
There's 40 years of research into that. And loads of tools to support dev teams.
You can start here: https://en.wikipedia.org/wiki/Cyclomatic_complexity
Also related are costing models: https://en.wikipedia.org/wiki/COCOMO
Re: Simple, correct, fast: in that order
#210When I was in school in the 70's. (That's NINTEEN seventies.) There was this book called The Psychology of Computer Programming. This predates the microcomputer era as we know it. Punched cards were still common when the book was written. A computer was to control a new assembly line for a car company. They couldn't get the software to work. They called in an outside insultant. The outsider developed a program that w…
Your example is a case of premature optimization. That is not what the author is concerned with. The problem are not the programs that obviously do not work or who break in a very visible fashion. Programs whose deficiencies are known can be fixed or worked around. The real problem are programs that appear to work correctly but aren't. To say it with the words of Tony Hoare: There are two ways of constructing a softw…
I think he is. Premature optimisation is putting the order: fast, simple, correct.
So although the author doesn't explicitly state it, premature optimisation is something that would be avoided if you followed his advice.