|
|
|
|
Thread title: Is it just me, or does wordpress suck form a coding standpoint? |
|
|
|
|
|
Thread tools
Search this thread
Display Modes
|
|
12-06-2010, 09:03 PM
|
#1
|
Status: Geek
Join date: Apr 2006
Location: Denver, CO
Expertise: Software
Software: Chrome, Notepad++
Posts: 6,894
|
Is it just me, or does wordpress suck form a coding standpoint?
I've been working with wordpress lately and I must say that I absolutely despise it. I am very surprised it is the largest blogging software with all its faults. So far they have included the following: - Inconsistent naming scheme
- No real templating system
- Poor back-end documentation
- Inherent undocumented external dependencies*
*It is a generally accepted standard in programming that included files should not have to rely on any external dependencies. This means that if you have a file that requires database interaction, it must include the DB file opposed to requiring that the file which calls it have done that. This leads to cleaner, easier to use code and is considered in a sin to violate in most programming languages (especially C).
Could someone shed some light on to why Wordpress is the most widely used system out there?
|
|
12-06-2010, 10:54 PM
|
#2
|
Status: Very much the flyest.
Join date: Mar 2006
Location: Belgium
Expertise:
Software:
Posts: 1,171
|
Originally Posted by Village Genius
[*]Inconsistent naming scheme
|
That makes it consistent with PHP
I think wordpress simply got lucky. It was never praised for it's high quality code. Maybe there weren't many decent alternatives at the time. And I know it was easier to use than Joomla (or Mambo).
Not sure what you mean with the template system though. I'd say it's one of the few good things about it, quite easy to use.
|
|
12-06-2010, 11:21 PM
|
#3
|
Status: #pugs {display: block;}
Join date: Jan 2007
Location: Chicago
Expertise: CSS, HTML, PHP
Software: Sublime Text 2
Posts: 1,187
|
I definitely don't agree with you on the "templating system." In fact I'm glad it isn't built on something ridiculously retarded (see: SMARTY.) You can either create your own functions to use or you can use those from WordPress..
Maybe I'm just used to it from over the years but WordPress' theming is the easiest thing I've jumped into.
|
|
12-06-2010, 11:43 PM
|
#4
|
Status: Geek
Join date: Apr 2006
Location: Denver, CO
Expertise: Software
Software: Chrome, Notepad++
Posts: 6,894
|
Originally Posted by Hero
That makes it consistent with PHP
|
Aint that the truth.
Originally Posted by Hero
I think wordpress simply got lucky. It was never praised for it's high quality code. Maybe there weren't many decent alternatives at the time. And I know it was easier to use than Joomla (or Mambo).
Not sure what you mean with the template system though. I'd say it's one of the few good things about it, quite easy to use.
|
The point of a templating system is to separate the PHP code from the style code. Wordpress mashes PHP and style together to where the template can make actual database calls, which is a big no-no.
Originally Posted by Jordan
I definitely don't agree with you on the "templating system." In fact I'm glad it isn't built on something ridiculously retarded (see: SMARTY.) You can either create your own functions to use or you can use those from WordPress..
Maybe I'm just used to it from over the years but WordPress' theming is the easiest thing I've jumped into.
|
You seem to be mistaking simplicity for quality. It is definitely more simple to go against the code/logic separation, but it is bad practice. Smarty is an awful implementation of this as it uses its own language and sometimes defeats its own purpose. I personally use Savant in all my projects that require a templating system.
Or perhaps I am going too far off of theory and mistaking unfamiliarity for poorness.
|
|
12-07-2010, 01:04 AM
|
#5
|
Status: #pugs {display: block;}
Join date: Jan 2007
Location: Chicago
Expertise: CSS, HTML, PHP
Software: Sublime Text 2
Posts: 1,187
|
I would say that you are mistaking unfamiliarity for poorness. If the "templating" system was so bad then the progress of premium themes (see: Woothemes, Themeforest, Elegantthemes, etc) wouldn't be as popular as they are.
So yeah, I don't see how the WordPress theme options are difficult to grasp. It's very basic.
|
|
12-07-2010, 01:07 AM
|
#6
|
Status: Geek
Join date: Apr 2006
Location: Denver, CO
Expertise: Software
Software: Chrome, Notepad++
Posts: 6,894
|
It's not hard, its the principle I am taking about. What I am having trouble with is actually coding the back-end of wordpress. For instance, there is a function I need outside of wordpress that is in wp-includes/post.php, I need to include five other files (one that has really odd behavior) to use that function because post.php did not include them itself. Any good practice would dictate that post.php include every dependency it had, common sense would dictate that it at least say what it requires.
|
|
12-07-2010, 09:50 AM
|
#7
|
Status: #pugs {display: block;}
Join date: Jan 2007
Location: Chicago
Expertise: CSS, HTML, PHP
Software: Sublime Text 2
Posts: 1,187
|
Originally Posted by Village Genius
It's not hard, its the principle I am taking about. What I am having trouble with is actually coding the back-end of wordpress. For instance, there is a function I need outside of wordpress that is in wp-includes/post.php, I need to include five other files (one that has really odd behavior) to use that function because post.php did not include them itself. Any good practice would dictate that post.php include every dependency it had, common sense would dictate that it at least say what it requires.
|
What function do you need?
|
|
12-07-2010, 10:17 AM
|
#8
|
Status: Very much the flyest.
Join date: Mar 2006
Location: Belgium
Expertise:
Software:
Posts: 1,171
|
Originally Posted by Village Genius
The point of a templating system is to separate the PHP code from the style code. Wordpress mashes PHP and style together to where the template can make actual database calls, which is a big no-no.
|
I've never tried Savant, I should have a look at it.
Though, even the MVC design pattern, used specifically for seperating buisness logic from the front-end allows some PHP within the html. Obviously no direct database acces etc, but still.
It's true that wordpress could have separated the layers a bit more, but then again, PHP was written to be used together with(in) HTML
Originally Posted by Village Genius
It's not hard, its the principle I am taking about. What I am having trouble with is actually coding the back-end of wordpress. For instance, there is a function I need outside of wordpress that is in wp-includes/post.php, I need to include five other files (one that has really odd behavior) to use that function because post.php did not include them itself. Any good practice would dictate that post.php include every dependency it had, common sense would dictate that it at least say what it requires.
|
You should have a look at their plugin api. When you make a plugin you don't need to include anything and you can make use of all the functions. (You'll still need to create objects instances though)
|
|
12-07-2010, 02:17 AM
|
#9
|
Status: Junior Member
Join date: Mar 2009
Location:
Expertise: Investment
Software: Photoshop & phpDesigner
Posts: 59
|
Village Genius, funny you created this thread. I was having a similar conversation this morning over coffee with a friend who's been helping me learn WordPress theme creation. I've read a myriad of books and watched dozens of in-depth videos only to come at the same conclusions. My theory (a bad one) is that WordPress just got lucky and people have gotten used to doing the extra work.
|
|
12-07-2010, 05:05 PM
|
#10
|
Status: Geek
Join date: Apr 2006
Location: Denver, CO
Expertise: Software
Software: Chrome, Notepad++
Posts: 6,894
|
Originally Posted by Jordan
What function do you need?
|
wp_get_recent_posts()
Originally Posted by Hero
I've never tried Savant, I should have a look at it.
Though, even the MVC design pattern, used specifically for seperating buisness logic from the front-end allows some PHP within the html. Obviously no direct database acces etc, but still.
It's true that wordpress could have separated the layers a bit more, but then again, PHP was written to be used together with(in) HTML
|
Pretty much all server side languages let you do that (asp.net is the only exception I know of), but that does not mean that it is a good idea in big apps.
Originally Posted by Hero
You should have a look at their plugin api. When you make a plugin you don't need to include anything and you can make use of all the functions. (You'll still need to create objects instances though)
|
Will do, thanks.
|
|
|
|
|
|
|
|
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
|
|
|
|