←back to thread

176 points markx2 | 8 comments | | HN request time: 1.099s | source | bottom
1. minimaxir ◴[] No.41839979[source]
> Rails, finally some open source! Looks like ~943k lines of code, 143k from Basecamp org. Automattic publishes 6.58M lines of open source code, 6.9x more than you. Yet, we’re “doing open source dirty”?

Wait, did he just use lines of code as a success metric unironically?

replies(3): >>41840106 #>>41840480 #>>41840493 #
2. jsnell ◴[] No.41840106[source]
I'm pretty sure it's not being used as a success metric there, but as a contribution metric.
replies(1): >>41840273 #
3. everforward ◴[] No.41840273[source]
It's not really meaningful either way. I could write a script to append "print('Hello, world!')" to the main function 6 million times, and I would have contributed 6 million lines but nothing of value. Actually, it's probably negative value now that someone else has to go clean that up.

It may also have to do with the brevity of the respective languages; I'm not a Ruby or PHP expert, but I do Go and Python and I would not be surprised if the Go version required an order of magnitude more lines because of how verbose it is and how terse Python can be.

Comparing lines of code in different languages, doing different things, with differing levels of complexity, is an exercise in futility.

4. nikolay ◴[] No.41840480[source]
Keep in mind that PHP is way more verbose and LOC-hungry than Ruby! So, to compare apples to apples, you need to device the PHP LOCs by at least 2!
replies(1): >>41844541 #
5. znpy ◴[] No.41840493[source]
> Wait, did he just use lines of code as a success metric unironically?

Not only that, he also compared php code to ruby code. Totally different languages.

I'm not even arguing which one is better or worse (i dislike them both) but for example ruby is way more expressive than php... You (usually) need less lines of ruby code than php code to do most things.

Clownish, clownish.

6. Ayesh ◴[] No.41844541[source]
WordPress coding standards is also full of padding. Spaces `like_this( foo, bar )`, curly braces on new lines, etc.

Plus, WordPress bundles all JS and PHP dependencies, including a whole userland PHP polyfill for libsodium.

replies(1): >>41845983 #
7. nikolay ◴[] No.41845983{3}[source]
WordPress is the biggest bowl of spaghetti code in existence! I can't believe it powers 40% of the web! PHP could do tons better - Laravel is a proof that PHP projects could be beautifully coded, readable, and extensible!

I've dealt with WordPress for so many years! It's sickening! Even the overglorified WooCommerce - I won't trust a business with it. I've done only a few sails and I had data loss, and so many issues.

Also, WooCommerce and other popular plugins such as GiveWP abuse the posts system. I've had so many issues causes by patch upgrades, because migrations went bonkers!

Honestly, WP had to be rewritten from scratch 10 years ago. There were some attempts, but they were not supported by Matt. With a rewrite, most plugins and "themes" would have stopped working, but if they are not maintained, they shouldn't be used anyway. I put "themes" in quotes as executable code is not a theme - it's a plugin installed in a different directory!

In general, WordPress is a patch over patches of patches! From mu-plugins (i.e., "must-use") to filters that could hijack the data read from the database - it's nearly impossible to trace which plugins screw up which plugins - even with the help of the overly glorified debugging plugins!

I've participated in a project where the management has decided to migrate a commercial online newspaper from a commercial Python CMS to WordPress - they hired me as I had PHP on my resume and it was hard to find PHP developers in SoCal. Anyway, for over a year, I had to completely remove WordPress from serving customers! Yes, everything was proxied, cached with nginx and optimized ngx_pagespeed (now abandoned). At the time, no commercial WP plugin could keep our website up! For example, an earthquake would take our website down, too, because people would go on our website to check for information and guess what happens if tens of thousands of people want to see the same page when according to the cache it's expired - there was no queue and it would generate 10,000 requests trying to regenerate the same homepage, which was making well over 500 DB calls to render!!!

WordPress hasn't changed much since! Yeah, PHP 7+ is much better, but it is still multi-process. The number of processors is determined by your available memory, and WordPress sometimes uses a lot of memory. That's why the only solution is heavy caching on all tiers!

replies(1): >>41892131 #
8. meiraleal ◴[] No.41892131{4}[source]
> WordPress is the biggest bowl of spaghetti code in existence! I can't believe it powers 40% of the web!

That's not a real statistic. It powers 40% of the long tail of web but not 40% of the access. With Google + Meta included I would guess wordpress doesn't serve even 10% of web.