• Benjamin (unregistered)


  • bvs23bkv33 (unregistered)

    131073 = pow(2, 17) + 1

  • LCrawford (unregistered)

    Where did the rogue PHP code reside, and how did it happen?

  • Object delete. (unregistered)

    Sorry, won't type more. Please imagine the other 131060 tags yourself.

  • (nodebb) in reply to LCrawford

    That, my friend, will be a mystery forever.

  • (nodebb)

    So, Pretty Horrible Processes strike again?

  • Oliver Jones (google)

    View Source ... is still your friend after all these years.

  • (nodebb)

    nary a

    in sight.

    Slight nitpick: paragraphs don't technically need to be closed. In some specific HTML specification.

  • tbo (unregistered) in reply to KattMan

    I'm pretty sure all languages support loops.

  • Raj (unregistered) in reply to tbo

    PHP has a bad reputation but there's much worse out there. For instance most languages support loops, but as far as I know only Python has a while-else loop construct which is a true marvel of software engineering (or should I say a True marvel since true doesn't work in Python).

  • medievalist (unregistered)

    I am always amused when someone disses PHP and Wordpress. Success breeds contempt, they say.

    I will wager the problem came from a plugin module. Wordpress users, just like perl programmers, generally pile on the modules until the system breaks, then they complain about the quality of Wordpress or PHP itself instead of asking themselves if they really needed to run all that dodgy code they downloaded from random Internet sites to get round corners on their menus or whatever. God forbid they should write their own code!

    I've heard Java programmers do the same thing only with "frameworks" instead of modules... :D

  • (nodebb) in reply to medievalist

    This. PHP is fine if you know what you're doing and program defensively.

  • Kleyguerth (github) in reply to Zenith

    The problem with PHP is that it is too easy set up and make something. This spawned a lot of people (I refuse to call them programmers) who use PHP and does not "know what you're doing and program defensively", they just read a quick tutorial on the internet and call themselves "programmers". Those are also way more common than programmers.

    I got nothing against devs who specialized in PHP, but every time I see PHP in the wild I think "garbage code made by people who have no idea what they are doing", and most of the time I'm right.

  • (nodebb) in reply to Raj

    Hey I said nothing about the language, just the process. I personally can write horrible code in many different languages, PHP being one of them, but horrible processes will hit you no matter what language you write in.

  • robby the robot (unregistered)

    This reads like part 1 of a story. We don't know what the contractor was there to do,what had been done, or what was the cause of the problem.

  • Perri Nelson (unregistered) in reply to medievalist

    Frameworks aren't always a "blessing". Why drag along several hundred megabytes of code to do something that you can do with much less code?

    I once wrote an application using .NET. The application weighed in at all of 127 KB, but it relied on the .NET Framework's GUI code. You couldn't install the thing unless you had the .NET framework installed. In those days, most Windows computers didn't have it.

    I later ported the whole thing over to C++, using the Win32 API instead of .NET. The new application was also 127 KB in size, but didn't drag around megabytes of dependencies. It was also twice as fast, and its only dependency was the C++ runtime, which has a much smaller footprint.

    Frameworks are nice when you need to knock something out fast, but they are also a quick and easy way to write bloatware.

  • (nodebb) in reply to medievalist

    PHP is probably the same big "backwards compatibility mess" as Wordpress is, since features like strict types (for argument types and function return types) got added. PHP would've been a better language if this feature was included at the start.

    Can you imagine, you had to write 2 or 3 lines to typecheck or typecast each variable in each function, in a language like java (or whichever you guys likely use)? And besides that, what about the (immense) performance-reduction in your applications?

    So medievalist and Zenith, PHP is not that good of a language, specially when you program defensively (which we have to, to make software robust and as secure as possible).

  • (nodebb) in reply to Flips

    I have my problems with PHP, including the lack of strict typing. However, in both PHP and JavaScript (and C#/VB in an ASP context), the environment forces you to interact with text so often that you're already doing alot of type checks anyway. If you keep codebase small, mostly by limiting dependencies, it's not a big deal. These days, the real performance hit seems to come from loading 25 MB of JavaScript libraries to register hundreds of events for filling in a UI template client-side and forcing a post back on every keypress or mouseclick...

  • Loren Pechtel (google)

    You could say the rogue PHP Peed all over the web page.

  • xtal256 (unregistered)

    "...there will always be work for web devs."

    Yeah, the web devs who work at WordPress. I assume the PHP loop bug is theirs, so they should fix it.

  • xtal256 (unregistered) in reply to Perri Nelson

    So you swapped the .NET framework for the Win32 framework. The only difference is that the Win32 API is built into Windows, whereas .NET (at the time) was not. If it were, then you would not be complaining.

  • Massimo Artizzu (google)

    The problem isn't PHP per se, folks. It's that Wordpress allows PHP to do unimaginable things to the output. So, basically, every Turing-complete language like PHP could have caused the problem. If the output was generated by a simple template engine a-la Mustache that could have been avoided.

  • aaa (unregistered)

    I'm sure those

    have looked better made by WP than they would in other frameworks.

  • (nodebb)

    PHP is no different to any other language - the quality of programmer determines the quality of the code.

    Ironically, a criticism of PHP versus Javascript/Node I hear a lot is how much more 'expressive' Javascript is as a language. Talk about a double-edged sword. Expressiveness fine in the right hands, but the last thing you want to do is give bad programmers more ways to express themselves.

    Similarly for PHP, its big strength is also its weakness - as someone said above, it's easy to get started with PHP development which means lots of non-programmers have over the years and called themselves "programmers".

    I think those two things, more than the actual quality of the language, are responsible for why PHP is so unfashionable and gets such bad press among influential web devs. PHP is just boring! It's often used for projects that have a longer lifespan, and legacy is definitely boring

    Javascript by contrast is constantly evolving. Every year or two you get a new bunch of tricks to use and just transpile it back to some older verison. The taste-makers in the web development industry often write a project in React or Angular, build is as a static project, put it out there, and move onto the next client without looking back. Every now and again they'll completely rewrite their agencyo site using whatever new framework is out and write a blog about it. This transience is part of why there's still no Node.js CMS to rival PHP's Drupal, for example. I can see how that's a whole lot more exciting than writing legacy PHP code, but not all programming work is, or should be, at the bleeding edge...

  • (nodebb)

    ...131,074 empty paragraph tags.

    That is a lot of nothing.

    Addendum 2019-01-09 08:55: In fact, I haven't seen that much nothing since I printed eighty thousand NUL characters on a video terminal.

  • I loathe WordPress (unregistered)

    WordPress reminds me of MS Access;

    Access is used by people who don't know what a database is, and end up creating an abomination which the client calls a "database", but its really an over glorified spreadsheet. WordPress is used by people who don't know the first thing about the web - or how to write a single line of code, but taught themselves how to drop-and-drag, and now claim to be a "web developer" (and these same people are now beginning to make heavy use of platforms like wix, as its even easier).

    Its because of crap like Access & WordPress, that the IT Sector gets a bad name (for all the dodgy actors claiming to be say a db admin or web developer).

    But i can't bitch to much, I'm starting to get quite a bit of work from small businesses which have essentially static sites - which were built with wordpress by some nob & installed every addon they could find - which results in the site taking several minutes to load. So i then custom build a new responsive front-end driven site with html/css/jquery & a slight sprinkling of node or PHP on the backend (for things like contact pages) - and the business then gets a new responsive site, which literally loads 100x quicker.

    And Heck - if a (small) business really needs a CMS and/or something more complex, then use a headless CMS with say an SPA framework frontend.

  • Decius (unregistered)

    TRWTF is the :important flag on served code existing. It should be entirely superfluous, with the client being able to specify a default, the served code being able to override that default, and then the user being able to override the served code. There's no benefit gained from arguing with the user about whether your formatting is better than what they have specifically said they wish to display, and every good browser should be noncompliant with the standard and ignore it.

  • (nodebb) in reply to Perri Nelson

    In the days of 16-bit Windows, I occasionally took that principle one step further and eliminated all use of the CRT from my simple C programs.

  • Ashley Sheridan (unregistered)

    I think the problem definitely lies with WordPress here. Sure, PHP as a language makes it easier to dumb stuff than some other languages (C# for example), but I'd say it's probably not as bad as JavaScript for letting idiots be idiots.

    However, WordPress has and always will be a steaming pile of dino turd. I've seen WordPress "devs" who just piled on plugins to build a pretty basic website, which then promptly fell over on day 1 when 10 people visited it at once.

  • Saare (unregistered)

    Not a true dev here, just maintaining small fansite made by someone else.

    It's even worse. Once there was a problem with rogue paragraph tags in WordPress. Not sure, if it was patched or not, but there was a PHP filter posted here and there to be added to your theme. When in occured in my site, these paragraphs started messing with my css gimmick, making elements flicker. Filter was not working, at all. I tried to trace the origin of these tags, but, being a noob, I failed. Then I absent-mindedly opened html-code of a page and saw something very interesting: WordPress was adding rogue closing paragraph tags, which browser then autocompleted. I tried to pierce the logic of such a behaviour, but it was beyond my imagination. But at least with this I made my filter work.

Leave a comment on “CSS (Under)Performance”

Log In or post as a guest

Replying to comment #:

« Return to Article