9 Replies - 10188 Views - Last Post: 12 July 2012 - 09:25 AM

#1 modi123_1  Icon User is offline

  • Suitor #2
  • member icon



Reputation: 8937
  • View blog
  • Posts: 33,462
  • Joined: 12-June 08

[link] The PHP Singularity

Posted 29 June 2012 - 02:30 PM

http://www.codinghor...ingularity.html

An interesting write up that tries to shift the constant "php blows" arguments to something that is more productive - that being to get past PHP and find a better more coherent alternative.

Quote

Remember the immediate visceral reaction you had to the double-clawed hammer? That's exactly the reaction most sane programmers have to their first encounter with the web programming language PHP.

This has been going on for years. I published my contribution to the genre in 2008 with PHP Sucks, But It Doesn't Matter.

Except now it's 2012, and fellow programmers are still writing long screeds bemoaning the awfulness of PHP!

What's depressing is not that PHP is horribly designed. Does anyone even dispute that PHP is the worst designed mainstream "language" to blight our craft in decades? What's truly depressing is that so little has changed

Is PHP so broken as to be unworkable? No. Clearly not. The great crime of PHP is its utter banality.


Therefore, I'd like to submit a humble suggestion to my fellow programmers. The next time you feel the urge to write Yet Another Epic Critique of PHP, consider that:

1. We get it already. PHP is horrible, but it's used everywhere. Guess what? It was just as horrible in 2008. And 2005. And 2002. There's a pattern here, but it's subtle. You have to look very closely to see it. On second thought, never mind. You're probably not smart enough to figure it out.

2. The best way to combat something as pervasively and institutionally awful as PHP is not to point out all its (many, many, many) faults, but to build compelling alternatives and make sure these alternatives are equally pervasive, as easy to set up and use as possible.


Is This A Good Question/Topic? 1
  • +

Replies To: [link] The PHP Singularity

#2 Dormilich  Icon User is offline

  • 痛覚残留
  • member icon

Reputation: 3481
  • View blog
  • Posts: 10,033
  • Joined: 08-June 10

Re: [link] The PHP Singularity

Posted 29 June 2012 - 11:49 PM

echo str_replace("PHP", "Windows", $article);

good template, Id say. ;)
Was This Post Helpful? 2
  • +
  • -

#3 JackOfAllTrades  Icon User is offline

  • Saucy!
  • member icon

Reputation: 6036
  • View blog
  • Posts: 23,421
  • Joined: 23-August 08

Re: [link] The PHP Singularity

Posted 30 June 2012 - 02:11 AM

This link within the comments is a decent rebuttal of the article to which the blog is respoding..
Was This Post Helpful? 0
  • +
  • -

#4 e_i_pi  Icon User is offline

  • = -1
  • member icon

Reputation: 789
  • View blog
  • Posts: 1,676
  • Joined: 30-January 09

Re: [link] The PHP Singularity

Posted 30 June 2012 - 06:31 AM

I read that post, and the links in that post - some as far back as 2005. The guy must have been hard pressed to rely on blogs entries from 7 years ago to back up his arguments. I do always like the link to "PHP: A Fractal of Bad Design" as well. It reminds me that no matter how down abd bitter I feel, there's always someone in the world who is more bitter than myself.

I won't defend PHP, it's not my brainchild - hell, I don't even defend the code I write, within months of writing something I figure out a better way to do it. But I do take offence to people preaching the "see the light" message, as it more often than not comes across as "holier than thou".

If I want a peanut butter sandwich, I go to the cupboard, I get peanut butter, I get bread, I spread the peanut butter, and I eat. I don't go out, buy peanuts, dry roast them, grind them to a paste, harvest wheat, grind the wheat to a fine meal, grow yeast in a petri dish, prepare dough, let the dough rise in a humidifier at a precise temperature, bake it in a baking tray, let it cool in the right conditions, slice the bread with a slicing machine, and apply the damned peanut butter with a surgeon's scalpel. Why don't I do this? Because it's a peanut butter sandwich, for crying out loud.

I remember a few months back I had to look into some C# code, as I'll be moving into that area at my work within the next 2 years. I asked a co-worker how you do a certain function, which I know in PHP is a piece of cake. He proceeded to show me... "You do this"...
Foo.Bar.Baz.SomethingElse.This.Library.Is.Infinite.By.The.Looks.


...and that's as far as he got, because then he said "I know it's around here somewhere". Wow. Wonderful. It's not an alphabetical list of functions - it's now a library of compartmentalised mess. That helps heaps...

I like the fact that I can get code in my application quickly, and see results straight away. Is the language perfect? No. Do you need to know rocket science to wield the thing? No. If that is perceived as a problem, I suggest these naysayers start writing letters to McDonalds, Sony and Vodafone to tell them "You're doing it wrong, your product is far too accessible!"
Was This Post Helpful? 4
  • +
  • -

#5 CTphpnwb  Icon User is online

  • D.I.C Lover
  • member icon

Reputation: 2889
  • View blog
  • Posts: 10,010
  • Joined: 08-August 08

Re: [link] The PHP Singularity

Posted 01 July 2012 - 05:58 PM

View Poste_i_pi, on 30 June 2012 - 09:31 AM, said:

I like the fact that I can get code in my application quickly, and see results straight away. Is the language perfect? No. Do you need to know rocket science to wield the thing? No. If that is perceived as a problem, I suggest these naysayers start writing letters to McDonalds, Sony and Vodafone to tell them "You're doing it wrong, your product is far too accessible!"

Those people are too busy bemoaning the success of the iPhone and iPad for not meeting some 'open source' ideal that no other OS meets either. The fact is that you can make many of the same (or similar) arguments against many languages. None are perfect, and in the end it's the skill and persistence of the programmer that matter most.

Here's my half-hearted defense of PHP over C/C++:
I don't need to declare functions in PHP, but do in C/C++. Why should I need to declare a function if I define it and I use it in my code? Shouldn't the compiler be smart enough to know about the function if the PHP interpreter is smart enough to do it? Same with variables! Why should I need to declare type? The interpreter handles that for me. Why can't the compiler do it too?

Obviously, C and C++ can gain speed advantages from an explicit declaration and in some cases it might be asking to much of the compiler to guess, but I'm not suggesting that we shouldn't be able to declare functions and variables. I'm only suggesting that it shouldn't always be required.
Was This Post Helpful? 0
  • +
  • -

#6 husseycoding  Icon User is offline

  • D.I.C Head
  • member icon

Reputation: 52
  • View blog
  • Posts: 174
  • Joined: 23-June 10

Re: [link] The PHP Singularity

Posted 12 July 2012 - 07:39 AM

I have never understood the point of discussions like this, if you don't like PHP and have your reasons for it, don't use it. Seems pretty straightforward to me...
Was This Post Helpful? 0
  • +
  • -

#7 RudiVisser  Icon User is offline

  • .. does not guess solutions
  • member icon

Reputation: 1002
  • View blog
  • Posts: 3,562
  • Joined: 05-June 09

Re: [link] The PHP Singularity

Posted 12 July 2012 - 07:47 AM

View Posthusseycoding, on 12 July 2012 - 03:39 PM, said:

I have never understood the point of discussions like this, if you don't like PHP and have your reasons for it, don't use it. Seems pretty straightforward to me...

Well, there are some people who are exceptionally good at PHP and thus are forced to use it in a professional aspect. The thing is, these types of people know exactly why PHP is "crap" and yet will still use it of course because they know it.

The people that piss me off is the ones that claim to be good at PHP and think that it is actually an all-purpose "good" language. With it's tacked on OOP, seemingly random naming of it's internals and thorough inconsistencies throughout, along with it's funny bugs - nobody in the right mind can defend PHP to the death. On the flip side, not a single language is perfect and somebody can come up with a list of why any language is "bad", it's just that PHP feels (and any good PHP developer would agree with this) quirky at the best of times.

Being able to understand and fundamentally work with these quirks is something that would make a "good" PHP developer.

This post has been edited by RudiVisser: 12 July 2012 - 07:54 AM

Was This Post Helpful? 3
  • +
  • -

#8 husseycoding  Icon User is offline

  • D.I.C Head
  • member icon

Reputation: 52
  • View blog
  • Posts: 174
  • Joined: 23-June 10

Re: [link] The PHP Singularity

Posted 12 July 2012 - 08:10 AM

Well working with PHP, and in particular Zend and Magento is in fact my profession so I am not unversed in this respect. Simply ranting about something achieves nothing, you either have to just live with it and get on with it, or stop doing it altogether, unless of course you are in a genuine position to be able to change it, which I suspect no-one here is.

Besides if PHP was changed so that it was exactly how the 'ranters' wanted it to be there would only be other people then ranting about the changes.

For the record, I have no particular love, nor dislike for PHP, I just accept it the way it is and use it as such. It pays the bills.
Was This Post Helpful? 0
  • +
  • -

#9 jon.kiparsky  Icon User is online

  • Pancakes!
  • member icon


Reputation: 7564
  • View blog
  • Posts: 12,688
  • Joined: 19-March 11

Re: [link] The PHP Singularity

Posted 12 July 2012 - 08:40 AM

View Poste_i_pi, on 30 June 2012 - 08:31 AM, said:

If I want a peanut butter sandwich, I go to the cupboard, I get peanut butter, I get bread, I spread the peanut butter, and I eat. I don't go out, buy peanuts, dry roast them, grind them to a paste, harvest wheat, grind the wheat to a fine meal, grow yeast in a petri dish, prepare dough, let the dough rise in a humidifier at a precise temperature, bake it in a baking tray, let it cool in the right conditions, slice the bread with a slicing machine, and apply the damned peanut butter with a surgeon's scalpel. Why don't I do this? Because it's a peanut butter sandwich, for crying out loud.


If pride in your work isn't important, bear in mind that anything you build will either be used or it won't. If it's used, it'll be maintained and modified over time, and eventually it's going to be a lot more than what you started with. If you expect it to be used, build it properly from the beginning. If you don't expect it to be used, why are you building it in the first place?

Most of the quoted text is straw man. It's possible to do good design and write clean code without reinventing every wheel. It's possible to cook your own food without maintaining your own farm or smelting the ore to cast your own iron to forge your own skillet. If writing in PHP has convinced you that writing good code is not worth the effort, you've just made the best argument for killing PHP that anyone could possibly make.

This post has been edited by jon.kiparsky: 12 July 2012 - 08:43 AM

Was This Post Helpful? 0
  • +
  • -

#10 codeprada  Icon User is offline

  • Changed Man With Different Priorities
  • member icon

Reputation: 944
  • View blog
  • Posts: 2,353
  • Joined: 15-February 11

Re: [link] The PHP Singularity

Posted 12 July 2012 - 09:25 AM

All languages have their issues but PHP gets the job done. There might be other languages that do it better but PHP let's the developer get away with a lot of things. One of the things that's missing in PHP is multiple inheritance but you should know that and develop your code so it compensates this. In my opinion the best thing to do is learn how to deal with these "flaws" because that's one of the traits of a professional.
Was This Post Helpful? 1
  • +
  • -

Page 1 of 1