News for hackers. Stuff that matters.
Re:“Clean” Code, Horrible Performance by scotty79 on Tuesday February 28, 2023 @04:59PM (#34975513)
I heard it as

make it work

make it work correctly

make it work fast

Pretty was never in the picture. But if anyone wants to add it, it should come last.

Re:“Clean” Code, Horrible Performance by treis on Tuesday February 28, 2023 @05:23PM (#34975778)
I like

Make it work

Make it good

Make it fast

Re:“Clean” Code, Horrible Performance by gregjor on Wednesday March 01, 2023 @01:23AM (#34979353)
I can measure "works" and "fast." Good can mean lots of things, it's a subjective assessment of code quality, readability, and maintainability. More experienced programmers probably have a better idea about how to achieve readable and maintainable code, but so far no one has come up with a measurable way to make code "good." Bob Martin spells out his ideas of "good" in his books but I don't find his examples particularly good, or even real-world. The only useful guide to "good" code I've come across in 40 years programming is The Elements of Programming Style, which Bob Martin has managed to expand from a thin pamphlet to multiple large books.
Re:“Clean” Code, Horrible Performance by yCombLinks on Tuesday February 28, 2023 @07:37PM (#34977142)
Correctly is covered by make it work
Re:“Clean” Code, Horrible Performance by jzm2k on Wednesday March 01, 2023 @03:54AM (#34980208)
I don't think it is. There are times in projects where you're exploring the problem space and figuring out how to get implement whatever you're doing and to speed up that process, you can take shortcuts such as assuming that a value always exists, there are X many users, or this function will never fail so you `expect()` on it. Also very little testing and no documentation. Once you have something that works, it's time to make it correct by removing those assumptions and adding tests and documentation. I believe this is what the distinction between "make it work" and "make it right" is.