Page 2 of 4

Re: spaghetti to mvc

Posted: Fri Nov 14, 2008 4:43 pm
by alex.barylski
In my experience it is the best solution that is always the best ... and it is often neither fast, cheap, simple nor the most efficient ...
All of those words are subjective...by fast I didn't mean performance...by cheap I didn't mean time...by simple I didn't mean first solution that comes to mind.

I meant the best solution is the best solution which almost inherently is best because of one or more of the preceeding factors...in that it's easier to maintain, it cost the client less money and developer less time, etc, etc...

Re: spaghetti to mvc

Posted: Fri Nov 14, 2008 4:58 pm
by josh
There's no best solution, only a spectrum of relative applicability, saying you have found the best or worst solution would be analogous to saying the word is flat

Re: spaghetti to mvc

Posted: Fri Nov 14, 2008 6:23 pm
by alex.barylski
There's no best solution, only a spectrum of relative applicability
This is true...each solution will vary greatly depending on the product managers end vision.

Yet at the same time not all software is created equally...look at WordPress that codebase could use some serious overhaul/repair and yet it's regarded as a leading application for blogging. :? :roll: :drunk: :banghead: :lol:

Re: spaghetti to mvc

Posted: Fri Nov 14, 2008 6:26 pm
by Eran
look at WordPress that codebase could use some serious overhaul/repair and yet it's regarded as a leading application for blogging
Actually that is not surprising. Most wordpress users are not developers and would rather not even look at the code. Their UI design and simplicity wins big time over other competing CMS systems.

Re: spaghetti to mvc

Posted: Fri Nov 14, 2008 6:54 pm
by Christopher
PCSpectra wrote:Yet at the same time not all software is created equally...look at WordPress that codebase could use some serious overhaul/repair and yet it's regarded as a leading application for blogging.
There are useful and popular applications, and then there are applications that some group of programmers like the source code. The second type is an absolute load of nonsense.

I have looked at the WordPress codebase and I think it is excellent. Whose opinion is correct -- yours or mine? More importantly, do either of our opinions matter?

This was my point above. "Good", it ends up, is much more objective that people think.

Re: spaghetti to mvc

Posted: Fri Nov 14, 2008 7:04 pm
by josh
Yep, I would bet most users would think its better for keeping things "simpler" with it's procedural code, which is fine if they don't have to incorporate rocket science into the business rules ( or change the code at all for that matter ), therefore it is more applicable in certain contexts then a full blown enterprise CMS. Best is always going to be subjective, all we mere mortals can do is compare 1 solution to the next, unfortunately we can't compare a solution to the unkown

( therefore we can never say with a certainty we have the "best" anything, what if there was other "better" universes outside of ours and our universe everything is the "worst" so all we're seeing is the "best" of the "worst" )

(( or would you sail off the edge of the universe?? )) :D

Re: spaghetti to mvc

Posted: Fri Nov 14, 2008 8:37 pm
by Christopher
jshpro2 wrote:...what if there was other "better" universes outside of ours ...
There is a better universe outside of ours, but its written in Python, and then is an even better one outside of that one written in Haskell, and then is an even better one outside of that one written in Erlang, and there is a better one ...

Re: spaghetti to mvc

Posted: Fri Nov 14, 2008 9:58 pm
by josh
I think we should all program in binary, via punch cards :D or what about a software version of a rude goldberg machine... er wait
Interesting though :D
you think functional languages are better then object languages? Or does functional not exclude objects, if so then aren't all object languages at least partially functional? Are you talking about a certain framework implemented in one of these languages? Where can I learn more?

Re: spaghetti to mvc

Posted: Fri Nov 14, 2008 11:44 pm
by alex.barylski
I have looked at the WordPress codebase and I think it is excellent.


You said the same thing about SurgarCRM. Excellent relative to what? You are aware that WordPress is horribly buggy and insecure right?

http://secunia.com/advisories/search/?a ... re%5B%5D=0

I find it odd that someone who always preeches good design, etc would even consider WordPress as an example of excellent codebase. They dependencies are outrageous...HTML SQL application logic all in one file. About the only separation they achieve is a primitive functions API.
Whose opinion is correct -- yours or mine? More importantly, do either of our opinions matter?
WordPress is not an excellent codebase...I'm sorry you feel that way...
This was my point above. "Good", it ends up, is much more objective that people think.
Good is subjective...until you have quantifiable evidence of bad...which wordpress has plenty...security, performance, code fragility, etc...

Lets make a friendly challenge: :D

I propose that you and me both download WordPress (the latest version) and we re-write it using our own best practices...

He who:

1. Finishes first
2. Application runs the fastest overall
3. Has the least reported bugs in 3 months
4. Has the least reported security holes in 3 months

Would stand to settle this discussion as the victor and the other agree's to but the winner a beer if they shall ever meet.

Who would be interested in entering such a challenge? If anything WordPress codebase is improved and the open source community benefits. It shouldn't take more than a few weeks to complete with 1 or 2 others helping each us. It's something I've considered doing lately anyways to add as a "project" under the belt.

Opinions don't matter but results do...and I'm confident I could re-implement wordpress into something leaner, meaner, and overall better.

Code: Select all

SLOC    Directory       SLOC-by-Language (Sorted)
25504   wp-includes     php=25504
21862   wp-admin        php=21862
3609    top_dir         php=3609
1334    wp-content      php=1334
 
 
Totals grouped by language (dominant language first):
php:          52309 (100.00%)
 
Total Physical Source Lines of Code (SLOC)                = 52,309
Development Effort Estimate, Person-Years (Person-Months) = 12.75 (153.01)
 (Basic COCOMO model, Person-Months = 2.4 * (KSLOC**1.05))
Schedule Estimate, Years (Months)                         = 1.41 (16.91)
 (Basic COCOMO model, Months = 2.5 * (person-months**0.38))
Estimated Average Number of Developers (Effort/Schedule)  = 9.05
Total Estimated Cost to Develop                           = $ 1,722,451
 (average salary = $56,286/year, overhead = 2.40).
SLOCCount, Copyright (C) 2001-2004 David A. Wheeler
SLOCCount is Open Source Software/Free Software, licensed under the GNU GPL.
SLOCCount comes with ABSOLUTELY NO WARRANTY, and you are welcome to
redistribute it under certain conditions as specified by the GNU GPL license;
see the documentation for details.
Please credit this data as "generated using David A. Wheeler's 'SLOCCount'."
I've refactored 50K lines in 3 months before...part time in the evening...and WordPress was sadly better than that codebase...if we can find 4 others to agree we could really raise some eye brows if we succeeded... :D

I would be interested in finding one or two people wanting to refactor wordpress into something better and more secure. Any takers?

I'm looking at the source as we speak 2.6.3...I have some ideas as to how and where I'd like to start...I'll set some milestones, goals, etc, we can collaborate and get started within a weeks time as I should have a basic TODO list done by then.

Cheers,
Alex

Re: spaghetti to mvc

Posted: Sat Nov 15, 2008 1:08 am
by josh
@PC, I'm responding to your PM here. No I would not be interested in rewriting wordpress with you, thanks for the offer though :D

I was merely reinforcing my point that "a good codebase" is just as subjective as "best solution". good in terms of what? For a simple blog site an enterprise CMS would be "bad", likewise wordpress wouldn't be very good for an enterprise application. If we're talking design, both wordpress and sugarCRM suck. Like we were discussing in this thread though most end users ( whos opinions are the ones that matter ) don't consider the design. Let the design be a means to an end, not the end. Good doesn't have to mean implementation, it could mean overall public opinion, how many people it's helped, etc... with these considerations wordpress is great, refactoring it would be a nightmare unfortunately, I could probably rewrite it in a week with active Record if I was so inclined, but I regress, because I am not. I have bigger targets in sight.

Re: spaghetti to mvc

Posted: Sat Nov 15, 2008 1:43 am
by alex.barylski
For a simple blog site an enterprise CMS would be "bad", likewise wordpress wouldn't be very good for an enterprise application
Agreed...but but solving a problem with a hammer as opposed to a screw driver wasn't what I was talking about...what I was focusing on was solving the problem with a hammer that had a rotten handle and dented head...as opposed to a long neck stainless steel Mastercraft hammer...

Which would you use under any situation that required a hammer? ;)
Let the design be a means to an end, not the end. Good doesn't have to mean implementation, it could mean overall public opinion, how many people it's helped, etc...
Fare enough...can't argue that...WordPress does work for most people as does SugarCRM but that wasn't my argument...read again and you will see I argued that the codebase wasn't excellent. Not the product itself...I'm an avid user of both. :P
Good doesn't have to mean implementation, it could mean overall public opinion, how many people it's helped, etc... with these considerations wordpress is great, refactoring it would be a nightmare unfortunately, I could probably rewrite it in a week with active Record if I was so inclined, but I regress, because I am not. I have bigger targets in sight.
Ummm...what forum are we in? General End Users of America or Theory and Design where everything is almost exclusively about the design of software architecture, etc? :D

Cheers,
Alex

Re: spaghetti to mvc

Posted: Sat Nov 15, 2008 4:34 pm
by Christopher
PCSpectra wrote:Good is subjective...until you have quantifiable evidence of bad...which wordpress has plenty...security, performance, code fragility, etc...
Your alleged challenge is silly. The essence of the disagreement is that you say "good" is subjective and I say "good" is objective. That is an irreconcilable argument, so silly as well. And it's not even a real argument. The only reason to take a position is for our own internal design decisions and software selections.

Re: spaghetti to mvc

Posted: Sat Nov 15, 2008 4:48 pm
by alex.barylski
Your alleged challenge is silly. The essence of the disagreement is that you say "good" is subjective and I say "good" is objective.
Silly? Why is it silly? I'm confident I could make WordPress better...technically speaking...following better design principles.
If the application did *exactly* the same thing as WordPress (complete backwards compatibility) but ran faster, used less memory and had less bugs and security problems, would you not conclude the software to be superior to previous versions of WordPress?

I'm confident if you re-wrote it it would be "better" as well...which is why I made a friendly challenge...I think it would be interesting to see how our solutions differed...and what I was thinking...is that we could eventually merge best practices, designs, etc into an even better version of WordPress...

I may have misunderstood you but when you said WordPress code is excellent...I'm not sure how I am supposed to interpret that in a Theory and Design forum. Seeing as every discussion on this forum is about design, for anyone to say WordPress code is excellent is somewhat misleading...as it's full of bugs, bad dependencies, security holes and otherwise horrible development practices.

Re: spaghetti to mvc

Posted: Sat Nov 15, 2008 6:55 pm
by Christopher
PCSpectra wrote:Silly? Why is it silly? I'm confident I could make WordPress better...technically speaking...following better design principles.
You judge software subjectively, so of course you could make it better in your opinion ...

Re: spaghetti to mvc

Posted: Sat Nov 15, 2008 7:21 pm
by Eran
Dude, stop being so cryptic :P
How come he's subjective and you're objective? we are all subjective since we apply our own reasoning when making design decisions. Those reasoning are influenced by our experience, knowledge and personal opinions.

A procedural developer might be overjoyed with what wordpress has achieved using limited means. It certainly is impressive to have created such a large and extendable code-base without resorting to easier ways to scope and extend constructs (ie, OOP). Their design is not modern by today's standards, but that is mostly unavoidable due to the large number of plug-ins developed for wordpress over the years which have to be supported (mostly) with each release.

There are certainly worse examples of high-profile procedural packages out there (phpBB anyone..?). What wordpress have achieved is to be commended - easy installation, easy extendability, great UI. Sure, there are design decisions that many of us will not like and probably would do otherwise, but it's not all bad.

I have a challenge for you PC, if you will - rewrite wordpress using procedural code only, and see if you could do better ;)