r/programming • • Jan 05 '11

Drupal 7 released.

http://drupal.org/drupal-7.0
222 Upvotes

259 comments sorted by

View all comments

Show parent comments

21

u/skeww Jan 05 '11 edited Jan 05 '11

Wordpress isn't a lightweight compared to Drupal.

X:\wordpress-3.0.4>cloc *
     565 text files.
     563 unique files.
       7 files ignored.

http://cloc.sourceforge.net v 1.53  T=9.0 s (61.8 files/s, 23006.2 lines/s)
-------------------------------------------------------------------------------
Language                     files          blank        comment           code
-------------------------------------------------------------------------------
PHP                            291          20399          41225          97013
Javascript                     159           4159           2619          22097
CSS                             88           2381            479          14448
HTML                            17            258              7           1927
XML                              1              7              0             37
-------------------------------------------------------------------------------
SUM:                           556          27204          44330         135522
-------------------------------------------------------------------------------


X:\drupal-7.0>cloc --force-lang="PHP",module --force-lang="PHP",install --force-lang="PHP",inc --force-lang="PHP",engine *
     852 text files.
     847 unique files.
     221 files ignored.

http://cloc.sourceforge.net v 1.53  T=10.0 s (62.9 files/s, 22984.2 lines/s)
-------------------------------------------------------------------------------
Language                     files          blank        comment           code
-------------------------------------------------------------------------------
PHP                            404          14828          66433         127260
CSS                            116            810           1098           8909
Javascript                      84            815           2808           5085
Bourne Shell                     8            172              3           1060
XML                             12              3              0            441
HTML                             3              4              0             69
ASP.Net                          1              3              0             40
SQL                              1              0              0              1
-------------------------------------------------------------------------------
SUM:                           629          16635          70342         142865
-------------------------------------------------------------------------------

As you can see, Wordpress isn't significantly smaller. Wordpress is merely ~24% less code (with ~38% less comments).

Edit: I didn't include the "test" files, since these are unit tests and the code is never executed on a regular website.

10

u/bananahead Jan 05 '11

I agree with you that wordpress isn't as lightweight as it seems, but SLOC is not a real great metric of anything.

4

u/skeww Jan 05 '11

Feel free to provide a better metric.

It was meant as a ballpark figure. Many people seem to assume that Wordpress is something very light and compact, which it certainly isn't.

There are almost 100 files with almost 100k lines of code. It's quite a bit of stuff.

1

u/[deleted] Jan 06 '11

better metric? How about the fact that all drupal and joomla sites on shared hosting running slow as fuck, even if they are optimized to hell and back. Wordpress has no such issue whatsoever.

I dumped all joomla shit I had long ago. Not only is it bloated and slow as fuck, it is impossible to plug every god damn security hole in it, and it's only a matter of time before your site is hacked.

6

u/TylerEaves Jan 06 '11

Guess what...how useable it is on your shitty ass $5/month shared hosting is pretty much irrelevant to people doing real sites.

-4

u/[deleted] Jan 06 '11

Ah yes, because most small businesses enjoy paying 259/month for hosting. Move along drupal fag. Shit is broken.

3

u/TylerEaves Jan 06 '11

Or $20 for a basic VPS? Complaining that drupal doesn't run well on shared hosting is like complaining that an F1 car doesn't run well on pump gas.

0

u/[deleted] Jan 06 '11

[deleted]

3

u/[deleted] Jan 06 '11

not a knock on that link, but I don't really trust many webhosts that are well known or established, a ton of fly by night with a couple of guys running a few servers in their moms basement, just asking for headaches, especially when your customers keep calling asking why their website is always offline

1

u/skeww Jan 06 '11

Drupal runs fine on cheap shared hosting. Well, the 5€/m kind with at most 50 users per server.

There isn't much to do for the server if the vast majority of your users are anonymous and if caching is enabled.

If you want similar performance with Wordpress, you have to install a plugin.

-1

u/ShrimpCrackers Jan 05 '11 edited Jan 05 '11

As you wrote; 24% less code is actually very significant considering Wordpress does pretty well with very few plugins (since a big chunk of that extra code is to make things incredibly easy for the user to configure and edit while Drupal requires a lot more work to streamline since the framework itself isn't enough and is much easier to break.

As for the comments, it's dubious to compare them directly without ratio. By ratio of comments to code, Wordpress scores about 4/10 while Drupal is 5/10. That said, I think Wordpress documentation and support is leagues better than Drupal regardless of numerics.

At the end of the day, it's a lot easier to train users to use Wordpress over Drupal, Drupal breaks more easily, Wordpress is a lot faster to deploy. So Wordpress wins for many smaller sites and can be used even for large scale websites depending on what you want to do.

4

u/Shocker88 Jan 05 '11

Documentation in Drupal has improved a lot of late and thus is likely on par - the shear scale of the framework within drupal makes it hard to directly compare. For basic content management I'd say Wordpress wins out in that it's a little nicer to install plugins for an admin and content changes/additions is nice and easy. Drupal module installs is a little confusing but the content changes/additions is likely on par with Wordpress with 7.0 due to many UX changes.

Whilst I'd say Wordpress may be a better system for smaller sites, or where admin might want to add some basic plugins, Drupal definately wins out for larger development based sites. Once Drupals framework kicks in and you learn to use the contributed modules correctly Wordpress really falls behind.

5

u/CritterM72800 Jan 05 '11

is much easier to break

I disagree with pretty much your whole comment but that part in particular is incredibly subjective and shouldn't be passed off as fact. I've broken WP far more often than Drupal.

-2

u/richardjohn Jan 05 '11

If you're customising it, the unit tests should be executed on a regular website.

3

u/skeww Jan 05 '11

Why would you run the tests on your live system? This only makes sense if you also develop on your live system, which would be even more stupid.

Having tests is a big plus. Don't try to make it look like a disadvantage.

1

u/richardjohn Jan 06 '11

By no means did I mean the tests were a negative - I don't think the number of files is relevant to much at all.

What I meant was, if Drupal has test coverage, use them if you're customising it.

I didn't mention running them on a live system?

3

u/skeww Jan 06 '11

I didn't mention running them on a live system?

Well...

[...] executed on a regular website.

Your test installation isn't a regular website.

1

u/richardjohn Jan 06 '11

I took 'regular website' to mean 'regular website project', rather than the actual live deployment... I don't think we disagree on anything here.

2

u/skeww Jan 06 '11

'kay. Well, you probably also understand why I thought it wasn't a good idea to count those tests to Drupal's "weight". That code isn't executed on your live system after all.

Just like no one would count jQuery's tests towards its weight.

Tests are always a separate thing.