Live data from Hacker News

My favorite principle for code quality

pathsensitive.com

1–10 of 115 posts

Re: My favorite principle for code quality

#2
Robert Piersig illustrates these higher-level concepts, which he calls forms,

Pretty sure that's attributed to Plato. Well I guess he called them είδε but he couldn't wait around for English to get invented.

Re: My favorite principle for code quality

#4
seems the article ends up with what was first done decades ago in PHP - separation of presentation and business logic. Btw i don't understand all this animosity toward PHP, especially given that pretty much all the modern web development is basically PHP-like, in spirit if not in actual implementation.

Re: My favorite principle for code quality

#5
> The Embedded Design principle, which I briefly introduced in a previous post, states that you should always code in a way that makes the design apparent. It’s like pixie dust in its ability to make code more readable, loosely coupled, and impervious to bugs.

I'm all for good software design, but claiming a design process can eliminate bugs is more fantasy than reality. Bugs typically come from unforeseen requirements or application states.

Yes, planning reduces bugs, but bugs are still inevitable no matter what software design process we use.

Re: My favorite principle for code quality

#6
I prefer a more focused version of this principle: you should organize your data in a way that makes the design apparent. The code will follow later.

This principle still works with the author's example. Most of the refactoring he did boiled down to modeling the data more accurately.

Re: My favorite principle for code quality

#7
post #5

> The Embedded Design principle, which I briefly introduced in a previous post, states that you should always code in a way that makes the design apparent. It’s like pixie dust in its ability to make code more readable, loosely coupled, and impervious to bugs. I'm all for good software design, but claiming a design process can eliminate bugs is more fantasy than reality. Bugs typically come from unforeseen requiremen…

I agree with you.

Issues with communication were directly attributable to ~1/3 of the bugs in software I've worked on. These bugs are unfixable with any process as they are caused by not stating a requirement/feature/bug in a way that is understood perfectly by the developer writing the code.

Re: My favorite principle for code quality

#8
post #5

> The Embedded Design principle, which I briefly introduced in a previous post, states that you should always code in a way that makes the design apparent. It’s like pixie dust in its ability to make code more readable, loosely coupled, and impervious to bugs. I'm all for good software design, but claiming a design process can eliminate bugs is more fantasy than reality. Bugs typically come from unforeseen requiremen…

Yes, you can't prove a negative. I'm pretty sure it was a joke.

Re: My favorite principle for code quality

#9
I feel like this is a long-winded way of saying what Linus already has famously said:

"Bad programmers worry about the code. Good programmers worry about data structures and their relationships."

The author refactors some code to revolve around a "DashboardStat" and explains it came from "thinking about how the code is derived from the design." Personally, I think it came from putting the data & its structure first.

Re: My favorite principle for code quality

#10
post #4

seems the article ends up with what was first done decades ago in PHP - separation of presentation and business logic. Btw i don't understand all this animosity toward PHP, especially given that pretty much all the modern web development is basically PHP-like, in spirit if not in actual implementation.

Most PHP is actually the opposite... Many PHP scripts, especially those from decades ago, are a mix of HTML, database calls, and business logic all in the same file.
Post reply on HN