Page 1 of 7

What is the essence of good software design

Posted: Sun Nov 16, 2008 7:57 pm
by Eran
Since it was deemed off-topic, I'm continuing the discussion on software design here. The question of the day is whether anyone has the qualification to deem what good design is.
But I'm not the one who called anyone's code crap or claimed I could rewrite it better. I think saying that WordPress or phpBB are "way down the quality scale" is not understanding the difficulty of building applications with that level of functionality and polish. Plus, comparing frameworks and applications is not really fair -- they are different in many, many ways.

Ultimately there is a lot written above that says that your opinions of what is "good" is contrary to what the world says is "good." And obviously I have some of the same understanding of best practices that you guys do. But you seem to be saying negative things about solutions like WordPress' plugins or phpBB's mods that are in reality quite brilliant solutions. They have enabled thousands and thousands of people to do very interesting stuff. I continue to think there are some blinders on here about the domain of "good."
Again you are steering of course. We are only discussing the underlying design of the code architecture, not of the success of those software packages as a whole. I can analyze each and point out exactly what made each so successful (in my opinion), but that's not what we are discussing.

Do you really think the "world" care about the architectural design of those open-source package? only developers care or have the knowledge to understand. Again, I'm not talking about the qualities that made those packages successful (though you will ineviteably fall back to this), only the design of the code and how it affects us developers.
is not understanding the difficulty of building applications with that level of functionality and polish
There is definitely a lot of funtionality in both wordpress and phpBB, but I have to disagree on polish. How many times did I rue the day when I had to work to make a couple conflicting wordpress plug-ins work together since a client just updated to a newer release ... for me working on wordpress code after being used to abstraction, separation of concerns in the form of MVC and OO scoping, is like having to forget almost everything I learned in the past 5 years.

And phpBB is even worse - I had to integrate a forum into my startup a week ago, and for some reason I choose phpBB. One of the requirements was to be able to sign-on with the same user name and password (and prefereably, session) as the main application. It took me a while to face the fact that it would take me less time to rebuild the forum functionality I needed from scratch than make this heap of global infested junk work with my code, and not to mention that it's highly annoying cache mechanism was really putting a damper on my designer's ability to style it's look and feel.
So after spending some serious time dabbling with this arcane code, I do allow myself to pass some judgement.

What's even worse, is that most people who are more familiar with those popular packages and don't know better, use them as a model for good design. I searched for other open-source forum packages, but unfortunately they all seem like carbon-copies of phpBB.. though somewhat stripped down.

So my question to all of you is this - if you had to define the properties of a good software design (in PHP), what would those be?

Re: What is the essence of good software design

Posted: Sun Nov 16, 2008 10:56 pm
by alex.barylski
IMHO you will never resolve differences in this arena until web applications are held against strict standards not just design patterns, as they are to vague and easily interpreted as something else or at least different from the other guy.

So I ask, what are some metrics one might use to indicate quality source code?

1. Lines per function, class, module?
2. Memory foot print (RAM)
3. Average profiled execution time
4. W3C validation
5. Level of accessibility
6. Level of support for internationalization/localization
7. Summation of bugs per 1000 lines
8. Summation of security holes per 1000 lines
9. Summation of time required by developer to implement new features, fix bugs, etc.

These are some of the metrics I use in gauging my own application...this is just a starter list there are many other metrics we could use to gauge the overall quality of the application and consequently it's core/internal design.

Whether you use MVC strictly according to Fowler or GoF would ultimately be irrelevant...if you discovered a new pattern derivative from of of those patterns, so long as you solved the problem while staying within the boundries set forth by an ISO standard almost...one could assume you properly and effectively designed an application.

Almost like how Spam filters work...an applicaton starts at zero points at each bug is 0.5 a security hole might be 1.0 and each file over X number of lines might be 0.2 and so on...the higher your score the less likely you followed good design principles, regardless of whether you use OOP, functions or Assembler...

I gaurantee the more intelligent abstractions you can make to solve your problems elegantly the more likely your software will score really low.

Cheers,
Alex

Re: What is the essence of good software design

Posted: Sun Nov 16, 2008 11:05 pm
by Christopher
pytrin wrote:Since it was deemed off-topic, I'm continuing the discussion on software design here.
Arrrrrrrrrrrrrrr ... shivver me timbers! ;)
pytrin wrote:The question of the day is whether anyone has the qualification to deem what good design is.

Again you are steering of course. We are only discussing the underlying design of the code architecture, not of the success of those software packages as a whole. I can analyze each and point out exactly what made each so successful (in my opinion), but that's not what we are discussing.
Well then we are discussing different things. My main point was that code quality is only one measure for how "good" an application is. I would go further to say that popularity and utility are much better metrics of "good" than someone's opinion of the quality of the source code. Again, my objective vs subjective stance.
pytrin wrote:So my question to all of you is this - if you had to define the properties of a good software design (in PHP), what would those be?
I think this is a very interesting question because according to me there should be some qualities of applications like WordPress and phpBB that some people consider "bad" but actually contribute to those applications being "good." Things that would actually produce better metrics on Hockey's list, but where you would both howl about the design. My guess that there is a difference between conceptually good and actually good for humans. If we could identify some of these qualities, we might learn how to build better applications.

Re: What is the essence of good software design

Posted: Sun Nov 16, 2008 11:13 pm
by alex.barylski
If we could identify some of these qualities, we might learn how to build better applications.
I'm sorry but isn't my list a good start?

I have never heard *anyone* complain about a software product running to fast or smoothly or that it validated against W3C...however I have heard many many complaints about slow, sluggish, bloated, insecure, buggy software...all of which my list attempts to address.

Whether the software is usable or fills the gap is entirely subjective and can never be quantified. If I need feature A in wordpress but they never implement it I simply jump ship to another project.

So what metrics would you use to qualify an applications overall quality? You said:
Things that would actually produce better metrics on Hockey's list, but where you would both howl about the design
What better metrics are you speaking of???

End user satisfaction has little to do with good software design. An applicaiton as a result of being properly designed, will also be easy to use and make it's users happy.

Cheers,
Alex

Re: What is the essence of good software design

Posted: Mon Nov 17, 2008 12:08 am
by josh
As for phpBB, I'd disagree it would take longer to integrate the logon then to re-implement it. I've both rolled my own forums, integrated phpBB with various CMSs like Joomla, both w/ and w/o the help of plugins, and integrated phpBB into my various homebrew codebases as well. Granted there were some adaptations due to their differing paradigms, it was straight forward

I'd be more then happy to contribute to a discussion of quantifying / qualifying attributes of good software, but I think we have to change the word good first. Are we talking about good agility? good testability? good performance? good readability?

Good "design" in OOP has to do with the objects and their inter-relationships, and interoperability. There's already well published metrics for qualifying good from bad in terms of each spectrum ( I would envision each design principle to be a spectrum that goes from infinitely bad to infinitely "good" ). So what are we discussing? Are we discussing a certain design principle such as design by contract? Usually overall design is measured in terms of cohesiveness and coupling, there's also law of Demeter which is related to these principles, all of these affect readability, agility, etc..

PCSpectra wrote:End user satisfaction has little to do with good software design. An applicaiton as a result of being properly designed, will also be easy to use and make it's users happy.
I couldn't disagree more, this goes back to "geek business myth" #'s 2 & 4 I linked in the other thread. End user satisfaction is the engine of a good design. If the underlying model doesn't relate to the customer's domain, your project will not model your TAMs conception of their own reality, and therefore your software will be rendered useless for all purposes besides your own entertainment. Whether the model is implemented in a way to tend to developer needs is one story and is beneficial to your project (hugely!), whether the model resembles your customer's reality is crucial to your success in every facet of the project. You have to realize design encompasses more then just implementing the de facto "best practices"

Re: What is the essence of good software design

Posted: Mon Nov 17, 2008 1:01 am
by Christopher
jshpro2 wrote:I'd be more then happy to contribute to a discussion of quantifying / qualifying attributes of good software, but I think we have to change the word good first. Are we talking about good agility? good testability? good performance? good readability?
I keep harping on this, and agree with jshpro2's point. Why do none of these list include things like "meet users needs" or "users like it" or even "users could get it to work"? I think you guys have been hanging around too many programmers! ;)

Re: What is the essence of good software design

Posted: Mon Nov 17, 2008 1:51 am
by alex.barylski
Good "design" in OOP has to do with the objects and their inter-relationships, and interoperability. There's already well published metrics for qualifying good from bad in terms of each spectrum ( I would envision each design principle to be a spectrum that goes from infinitely bad to infinitely "good" ). So what are we discussing?
What I've suggested about a dozen times...what part of design am I not making clear?

The design does not have to follow design patterns, nor does it have to be done in OOP or in PHP or Assembler. Good design is what happens when:

1. Your application runs faster
2. Your application runs smoother
3. You application has less security holes

And so on and so forth.

Lets say technical metrics determined from using the product not as an end user but as a quality assurance agent.

Design patterns, again, are a bad metric, because clearly everyone has a different understanding on what and how a front controller should be implemented, or what a this is or that is.

Design patterns are what they are...they are patterns and suggested best practices *not* standards which you must comply with. Read my list above again it should give you a pretty clear picture of what I had in mind. :?
End user satisfaction is the engine of a good design
Unfortunately I am going to have to disagree. :P

Yes your users are priority number 1...absolutely...but letting them drive the development of your software design is akin to letting an air plane enthusiast pilot the next commercial aircraft you get on.

Users (if they had their way) would have an application designed specifically for them. Every user has different requirements and following that please everyone approach would lead to bloated, buggy, hard to maintain software, with features which are way out of context for that application.

SugarCRM. Is it a Customer Resource Manager or an Email client? Or a newsletter delivery manager? Or a bug tracker? Same applies to Joomla. Is it a CMS? Or an address book?

While both have many supporters, each has their fare share of past users who opted for something more simple. Mega solutions seem nice at first glance, one product that solves all your issues. Sweet. Until you realize you want some advanced reporting or feature set not found in anything but specialized software.

The point is...I don't care what that blog said...I've been using computers a lot longer than most any of my clients...and like a true professional I know whats best for them once I understand their problems and requirements. I'd rather chain several small, well built, stable packages togather to form a single tool, than rely on a monolithic monster of an application, which is what happens when you blithfully do exactly as your clients request. You always end up with a "concurrent versioning content manipulation page blogging enterprise resource planning kit" which actually...in the long will lose you clients...trust me I've been there and I've seen it happen dozens of times where the more flexible you make an application will initially attract users but as it becomes more and more flexible it begins scaring people away at the same time. Whether that functionality is implemented as modules or not...most people get confused by lack of focus or context. They want simple applications that focus on niche problems and solve them well.
If the underlying model doesn't relate to the customer's domain, your project will not model your TAMs conception of their own reality, and therefore your software will be rendered useless for all purposes besides your own entertainment
Whether the model is implemented in a way to tend to developer needs is one story and is beneficial to your project (hugely!), whether the model resembles your customer's reality is crucial to your success in every facet of the project. You have to realize design encompasses more then just implementing the de facto "best practices"
Not really. There is a saying in every sales industry which goes: "That guy can sell Ice to an Eskimo"

Implying he can sell things to people who don't even need whatever it is he is selling. A hairspray to a bald man for example. :P

I don't think I have seen a singloe product yet that couldn't be marketed...I sold a flight distance calculator when I was 13ish on CompuServe which did nothing but calculate the great circle distance between two way points. Pretty useless but people bought (about 12 times in total but still).

Your product would have to really suck before it absolutely wouldn't sell with the right salesman.
I keep harping on this, and agree with jshpro2's point. Why do none of these list include things like "meet users needs" or "users like it" or even "users could get it to work"? I think you guys have been hanging around too many programmers
Because users are not even aware of quality metrics, nor should they care, that is the point of a standards body. ;)

Do users care about W3C validation? No...not unless they are directly affected by it (hard of sight, etc) but a majority of users don't even notice. Do users care whether the application works without JavaScript enabled? Nope, but should developers care? Absolutely.

The point is this...we focus on quality assurance so our users don't have to. And again I repeat...

I have never heard anyone complain their application was to responsive or that it validated 100% however I have heard complaints of the opposite direction.

Oddly, you may not have noticed, when that much effort is put into an application it usually solves the problem domain better than it's competitors who solve the exact same problem but without all the standardized quality assurance tests.

Cheers,
Alex

Re: What is the essence of good software design

Posted: Mon Nov 17, 2008 2:15 am
by Eran
I think you guys have been hanging around too many programmers!
This really irked me. My two founding partners in my startup are graphical designers. In fact, currently I sell my services as mostly user-experience specialist. I believe every feature and requirement should be driven only by end-user needs (You are welcome to this piece I wrote sometime ago about user experience).

Having said that, there is an infinite number of backend designs that would achieve the same end result. Some would promote more testable code (or even promote tests themselves, since that's part of the design), leading to better software quality (ie, less bugs). Some would be more adaptable to change, leading to more features and redoing of features in a shorter time span. Some would be more readable, allowing a group of developers to work better together. And so and so on.

I think there is a misunderstanding here (intentional or not I do not know). Some us want to talk the design of a code base, which is irrelevant to how well thought out the features it lends it to are, and some of us want to talk about application products as a whole. Is no such distinction possible? I really don't think that's the case.

As for me, the qualities I judge code architecture are not measurable metrics, but intangibles. Those are:

1. Is the architecture consistent? (ie, does it have design at all?)
2. Does it have coding standards?
3. Is it (unit) testable?
4. Is it tested (does it have tests written)?
5. Are deep are the dependencies between parts of the system?
6. How resilient is it to change?
7. How easy is it to change and extend it?
8. How readable and commented is the code? (I know arborint disagrees with me here ;) )

None of those qualities have any direct bearing on user-experience, yet they are the components of the design of software products. They affect the development process rather than the end-user, and I don't need to tell you how many promising software products never saw the light of the day due to falling behind schedules and development stalling to a halt due to bad design.

Re: What is the essence of good software design

Posted: Mon Nov 17, 2008 2:34 am
by josh
Allowing user needs to drive the design doesn't mean implementing them a certain way, it means solving the correct problems. I would judge a design on how well it solves the design problems, design problems are side effects of user problems. Without user problems you're just entertaining yourself. I'm not excluding other developers from being the "user", it all depends on who your TAM is. The more your model drifts from reality, the harder it is going to be to add new features and get your model to re-align with your user's reality later. Therefore I would say a design is pretty much defined by how well it addresses the user's reality ( reality = domain ). Design A might be more supple ( easy to change in general ) than design B, but if design B models the user reality closer, the user is more likely to request changes that would make more sense in the context of Design B.

A good design encapsulates implementation. A stupid analogy I thought of is imagine the guy who invented the bow and arrow. I doubt any of his users' cared about the laws of potential energy, aerodynamics, etc.. He made a design that abstracted a real user need by modeling the reality of a problem with tools, the user in result is able to slaughter wolly mammoths ( or whatever bow and arrows are used for :lol: ) with less cognitive effort. Usability is design. Think about what made you originally get into web development.

Re: What is the essence of good software design

Posted: Mon Nov 17, 2008 2:45 am
by Eran
I'm close to giving up..
User needs don't drive design, they drive requirements. Decisions about features and requirements are outside the realm of code (aside from some restrictions depending on the platform). What do you mean how well the design helps solve the user problem? a design can only fulfill the requirements it is given. You can say that's another quality of good design - that it fulfills the requirements correctly, but a design doesn't affect requirements - at least where I come from. Bad design might restrict certain features from happening, but I've yet to see code design decide features on its own.
Deciding whether a design solves the correct problems is not a design quality. A design can only solve the requirements it is given.

And usability is not code design. It is graphical design and user experience design, two completely separate forms of design.

Re: What is the essence of good software design

Posted: Mon Nov 17, 2008 2:59 am
by josh
There's been books written about it...
http://www.amazon.com/Domain-Driven-Des ... 360&sr=8-1
The software development community widely acknowledges that domain modeling is central to software design. Through domain models, software developers are able to express rich functionality and translate it into a software implementation that truly serves the needs of its users.

Re: What is the essence of good software design

Posted: Mon Nov 17, 2008 3:23 am
by Eran
There are books written on scientology as well... I read all those books, on XP, scrum and every design fad out there. There are some good concepts there, but they are taken to extremes that sometimes do more harm than good. I hate to say it, but that's a very american quality - once you think you found something good you try to have as much as you can from it without recognizing good measure.

Re: What is the essence of good software design

Posted: Mon Nov 17, 2008 3:37 am
by josh
pytrin wrote:There are books written on scientology as well...
umm, did you read Mr. Evan's book? Its not a methodology its a patterns book
pytrin wrote:I'm close to giving up..
i agree.

Re: What is the essence of good software design

Posted: Mon Nov 17, 2008 4:05 am
by Eran
peace..

Re: What is the essence of good software design

Posted: Mon Nov 17, 2008 6:07 am
by Christopher
pytrin wrote:Having said that, there is an infinite number of backend designs that would achieve the same end result. Some would promote more testable code (or even promote tests themselves, since that's part of the design), leading to better software quality (ie, less bugs). Some would be more adaptable to change, leading to more features and redoing of features in a shorter time span. Some would be more readable, allowing a group of developers to work better together. And so and so on.
There are conceptually infinite designs for a piece of software. But in reality, of the hundreds of blogs, forums, CMSs, etc. -- only a few are actually very popular. Many on that list would be considered to have badly designed code by some here. My thesis is that the code is not badly designed, but actually may have some interesting things about it that might be helpful to know.
pytrin wrote:I think there is a misunderstanding here (intentional or not I do not know). Some us want to talk the design of a code base, which is irrelevant to how well thought out the features it lends it to are, and some of us want to talk about application products as a whole. Is no such distinction possible? I really don't think that's the case.
I think we were talking about a broader definition of what "good" means in the previous thread. And I think there is disagreement what is relevant and what is irrelevant. But if you would like this thread to be only about the design of the code without any discussion of features, that is your call in your thread.
pytrin wrote:As for me, the qualities I judge code architecture are not measurable metrics, but intangibles.
As I have said, most of those "metrics' are just opinion -- except the test coverage. You might as well add "in a way I like" to the end of most of those statements. It is not that opinions about those might not be interesting to hear. I just think there are some better, more objective metrics.

PS - I don't think is helpful to make generalizations about nationalities.