PHP is basically the latest example of "Worse is better"( http://en.wikipedia.org/wiki/Worse_is_better ). ---- Simplicity: The design must be simple, both in implementation and interface. It is more important for the implementation to be simple than the interface. Simplicity is the most important consideration in a design. Correctness: The design must be correct in all observable aspects. It is slightly better to be…
Consistency: The design must not be overly inconsistent. Consistency can be sacrificed for simplicity in some cases, but it is better to drop those parts of the design that deal with less common circumstances than to introduce either complexity or inconsistency in the implementation. . . . I don't know about you, but IMHO, this is PHP in a nutshell. If you had read some of the criticisms of PHP that had been posted t…
Coding Horror: The PHP Singularity
181–190 of 341 posts
Re: Coding Horror: The PHP Singularity
#182This rant boils down to a tweet "If you don't like PHP then use another language or build a better one". What a revolutionary concept! That has worked wonders for languages since. Except not one has come out that is as simple as PHP thus PHP will continue to exist. Everyone that invents a language now focuses on abstract concepts that do not help the everyday developer do anything useful. Is it so shocking it's still…
> If you don't like PHP then use another language or build a better one ... Everyone that invents a language ... But he said nothing about "inventing" a language. In fact said very clearly that he wanted to take an existing language and add to it - particularly the things that PHP does do well. from TFA: > "to buff up a open source language ecosystem such that it can truly compete with PHP in ease of installation and…
Re: Coding Horror: The PHP Singularity
#183Earlier quoted context omitted.
I should have expected someone with more knowledge of the system on HackerNews :) What I mean is that whilst you guys at Facebook are using PHP you're not using it in the sense of 'we write code anywhere and deploy it anywhere'. There's an additional build step in between the developers and the final product, rather than just straight up serving PHP as is which is one of the biggest PHP recommendations. Although HipH…
> ... 'we write code anywhere and deploy it anywhere'. There's an additional build step in between the developers and the final product, rather than just straight up serving PHP as is which is one of the biggest PHP recommendations. According to him there's no explicit build step the devs have to perform and they're just writing PHP and using open source packages--meaning they are in fact making use of the "write onc…
Now, as far as I understand it the Zend backend takes the PHP code, creates opcodes and executes it in a VM, whereas HipHop takes the code, compiles it down to C++, compiles it again with G++ then runs the resulting C++ binary instead. To me at that stage HipHop is no longer a backend, but an entire build system transforming the language away from PHP.
Like I said, I'm not as intimately familiar with the system, but I thought it was along the lines of they have a dynamic system for local development, and when they serve it up it's run through the HipHop compile process.
Re: Coding Horror: The PHP Singularity
#184Look at this script that uploads a photograph. Every time I see it, it makes me laugh.
Re: Coding Horror: The PHP Singularity
#185Here we go again... Maybe it does suck. You can certainly tell it was not designed by computer scientists. In many ways, it throws away years for programming language best practices. This being said, what are the practical alternatives? JSP? Servlets? ASP? Python/Django? Ruby/Rails? What? I am sorry but JSP, Servlets, ASP, Python/Django, Ruby/Rails are just shit of a different kind. But they do not deserve that holie…
Re: Coding Horror: The PHP Singularity
#186Earlier quoted context omitted.
> If you don't like PHP then use another language or build a better one ... Everyone that invents a language ... But he said nothing about "inventing" a language. In fact said very clearly that he wanted to take an existing language and add to it - particularly the things that PHP does do well. from TFA: > "to buff up a open source language ecosystem such that it can truly compete with PHP in ease of installation and…
If an existing language already has potential to replace PHP then I don't see why it wouldn't have already. What would/could you tweak that would get you there without fundamentally changing the language capabilities and syntax?
I suspect that he is being deliberately vague here; in other words there is an announcement coming at some later date and this is preliminary PR. That doesn't make it untrue though.
Re: Coding Horror: The PHP Singularity
#187Ok, so here it goes. I haven't commented on this site for over a year. Full disclosure: I am an average programmer compared to many here. I come to this site to improve my self and read about what brilliant and amazing things you all do. Now you have a reference. I use PHP on a daily basis, have been for years. I am a freelance developer who has been able to carve out a living with a lot of hard work and a lot of luc…
The setup time issue is an advantage of PHP over many languages. But, I will let you in on a little secret, once you know how to do it 'setup' time is a drop in the bucket on all platforms. And in the rare case where it might otherwise be hard, people setup a shell environment they can use as the template on any project and it just works. That said, there are popular languages worse than PHP for most web development…
Now that's horrible code, it has a dozen bugs aside from the security issues, but I would go so far as to say when I need to do something stupid like that quickly, nothing matches the simplicity of PHP. It's downright elegant.Not to say you should write a webapp in it, but I think you're wrong; there's intrinsic overhead in using a Real Language. It has nothing to do with "knowing how to do it," doing things properly takes time, a half-assed but mostly functional solution can be whipped up in minutes.
Re: Coding Horror: The PHP Singularity
#188Ok, so here it goes. I haven't commented on this site for over a year. Full disclosure: I am an average programmer compared to many here. I come to this site to improve my self and read about what brilliant and amazing things you all do. Now you have a reference. I use PHP on a daily basis, have been for years. I am a freelance developer who has been able to carve out a living with a lot of hard work and a lot of luc…
It's not ivory tower for all of us. In my case it all boils down to simple discomfort. Writing PHP code is painful. Reading PHP code is painful. Fixing bugs in PHP code is painful. I don't write rants about it but that's just because I left the language behind years ago and never looked back. But if I had to write for my job? Yeah I'd write a rant every other month probably. I would need some kind of outlet for all t…
Re: Coding Horror: The PHP Singularity
#189Earlier quoted context omitted.
> > default to HTML escaping on output > ??? Is that a joke? Don't do that! That's just as bad as magic quotes. Microsoft's Razor and Python's Django templates have both shown that HTML-escaping-by-default can be cleanly done in a way that is not magical and that is highly reliable. I'm not honestly sure what you're protesting here.
If I make a string: ' ' . $var . ' ' - does it know to encode the variable, and not the entire string? What if I assign that string in a variable, and then output it later? I'm not convinced this can be done well. Maybe if all you do is make some templates and fill them in you could do it. But I do a lot more than that, I output dynamically built html all the time. Just give people a very easy and shortly named funct…
You'd do something like @html.SalesWidget("90% off today") with the SalesWidget being responsible for escaping the string.
Also I don't really get your argument, why not give people a really short and easy way of not escaping a string instead? The opposite of what you're suggesting is just as easy and far safer. You're less liable to accidentally muck up.
Re: Coding Horror: The PHP Singularity
#190Ok, so here it goes. I haven't commented on this site for over a year. Full disclosure: I am an average programmer compared to many here. I come to this site to improve my self and read about what brilliant and amazing things you all do. Now you have a reference. I use PHP on a daily basis, have been for years. I am a freelance developer who has been able to carve out a living with a lot of hard work and a lot of luc…
"Finally, let's use his tool analogy. PHP is a double-clawed hammer. What if your job was to remove nails from wood all day?" I agree with your metaphor relating working with PHP as "pulling nails from wood all day."