News for hackers. Stuff that matters.
Re:The new PHP by maratd on Tuesday March 04, 2014 @08:44AM (#7340077)
The web server is explicitly for development purposes. It is not meant for production.

> It strikes me that adding more tools that incompetent web developers can abuse is what got them there in the first place.

This is profoundly ridiculous. It's the equivalent of saying Home Depot shouldn't sell power tools because some do-it-yourselfer might saw his foot off.

Just because a tool can be misused is not an argument against it nor its inclusion.

Re:The new PHP by acdha on Tuesday March 04, 2014 @09:35AM (#7340364)
> This is profoundly ridiculous. It's the equivalent of saying Home Depot shouldn't sell power tools because some do-it-yourselfer might saw his foot off.

You're incorrectly characterizing the argument: it's actually like saying Home Depot shouldn't sell power tools without safety guards, fuses, emergency shutoffs, SawStop, etc. PHP has a number of misfeatures which make it extremely easy for all but the most vigilant of developers to make mistakes with security consequences (https://eval.in/108854 was making the rounds just this morning) or simply increasing the likelihood of creating bugs (i.e. the inconsistent parameter ordering across the similar array_* functions). Most of these complaints date back to the late 90s but now are much harder to make both because the core developers don't take them seriously and because there's now a huge backwards compatibility problem.

The most interesting development in PHP is the HHVM hack mode or similar concepts where an actively-maintained codebase can opt-in to safer behaviour. For the sake of anyone who has to secure code on the internet, I hope this catches on.

EDIT: See slide 15 onward in http://www.slideshare.net/skamerman/ipc-2013-high-performanc...

Re:The new PHP by fleitz on Tuesday March 04, 2014 @02:03PM (#7342306)
Here's all you really need to know with PHP, ask a PHP developer how to test for equality.

Maybe how you test for equality shouldn't depend on an ini file... just sayin...

Perhaps testing for equality doesn't need a 3 page answer... in most languages it's a pretty straightforward answer... primitive types use == and objects use either isEquals or operator overloading.

Re:The new PHP by codygman on Tuesday March 04, 2014 @04:35PM (#7343351)
I'm as critical of PHP as anyone, but I couldn't find any settings to change how equality works in the language here:

http://www.php.net/manual/en/ini.list.php

Re:The new PHP by xd on Tuesday March 04, 2014 @02:23PM (#7342425)
What do you mean by depend on an ini file? I wasn't aware there was any settings for equality testing there..
Re:The new PHP by mehwoot on Tuesday March 04, 2014 @08:54AM (#7340123)
Just because a tool can be misused is not an argument against it nor its inclusion.

I used to believe this, but now I couldn't disagree more. People can and do misuse things all the bloody time, and the more you enable them to do that, the worse your tool is. How people use what you make is every bit as important, possibly even more important than the technical merits of what you make.

I'd rather a builder use a second hand hammer to nail something than try doing it with a jackhammer.

Re:The new PHP by Karunamon on Tuesday March 04, 2014 @09:01AM (#7340166)
>People can and do misuse things all the bloody time, and the more you enable them to do that

This is an excuse for educating people, not an excuse for kneecapping the majority due to an ignorant minority. This is the kind of thinking that plagues the GNOME3 devs and gets ridiculed so often around here. The user is an idiot so let's remove features.

I don't see many people harshing on Rails for the inclusion of WEBrick.

Re:The new PHP by Freaky on Tuesday March 04, 2014 @02:53PM (#7342604)
Ruby, you mean - it's part of the standard library.
Re:The new PHP by TeMPOraL on Tuesday March 04, 2014 @09:09AM (#7340211)
> People can and do misuse things all the bloody time and the more you enable them to do that, the worse your tool is.

In terms of avoiding accidents I agree, but in general, I don't like this kind of thinking.

One man's misuse is another man's hack. The flipside here is that the more you limit and subdivide a tool, the worse your tool becomes.

I'd also rather see builder using something else than a jackhammer to nail stuff, but then I also want him to have access to one if he needs it, and I strongly want people to stop shouting "omg you can't use X to do Y, because X was not meant to do Y". First principle of hacking: tools do not have inherent purpose, they can be used to do whatever we want; they only can be better or worse at a particular task. The world didn't collapse into logical contradiction the last time I cut pizza with a sound card, because of lack of any other sharp tool nearby.

Re:The new PHP by einhverfr on Tuesday March 04, 2014 @10:01AM (#7340540)
> People can and do misuse things all the bloody time, and the more you enable them to do that, the worse your tool is.

By that measure, PostgreSQL is a horrible database. After all look what happens when I do this:

    CREATE TABLE foo (
       id serial not null unique,
       bar text primary key
    );

    CREATE TABLE foobar (
       chunk_id serial not null unique,
       foos foo[]
    );

    INSERT INTO foobar (foos) values (array[row(1, null)::foo, row(2, '1323')::foo, row(3, '2222')::foo]);

    select * from foobar;
I mean my gods. Such horrible misuse of a relational db!
Re:The new PHP by g8oz on Tuesday March 04, 2014 @09:42AM (#7340402)
I don't hear people complaining about Python's builtin webserver. Maybe thats because Python only attracts people who do things correctly right?
Re:The new PHP by samastur on Tuesday March 04, 2014 @09:48AM (#7340444)
Python doesn't have a builtin webserver, but there is one in standard library of CPython.

I've yet to see an article that would argue that its existence is a proof that you should be using Python now.

Re:The new PHP by girvo on Tuesday March 04, 2014 @10:07AM (#7340583)
Then you missed the point of the article, and also obviously don't use PHP regularly. It's a super handy feature.
Re:The new PHP by pekk on Tuesday March 04, 2014 @10:17AM (#7340653)
Python's stdlib webserver is terrible and not to be used. You WILL hear Python people say this

I don't see why you decided to pick a fight about Python, though - Python seems to be a sore point for PHP defenders and I really don't know why

Re:The new PHP by collyw on Tuesday March 04, 2014 @10:54AM (#7340931)
Nope, Python attracts plenty of idiots as well. It is especially popular among self taught bioinformaticians, who write really bad code.
Re:The new PHP by orf on Tuesday March 04, 2014 @08:59AM (#7340158)
No its like saying Home Depot shouldn't sell power tools to children who don't know how to safely use them.

Unless the web server displays a huge red message every time it is run saying "Don't even think about using this in production" you can bet that it will be.

Re:The new PHP by maratd on Tuesday March 04, 2014 @09:58AM (#7340531)
> Unless the web server displays a huge red message every time it is run

Uhh... this is the first line the web server spits out:

PHP 5.4.0 Development Server started at Thu Jul 21 10:43:28 2011

The manual isn't exactly vague on this point either:

http://us3.php.net/manual/en/features.commandline.webserver....

So we got the warning already in there, what else would you like?

Re:The new PHP by orf on Tuesday March 04, 2014 @10:27AM (#7340735)
20 words of that manual were dedicated to letting people know its not for use in production. Un-highlighted and buried at the end of a paragraph that I initially skimmed over and didn't even read. No attention is directed at it in any way.

So the server outputs a message. Great. Is it huge, red and says "do not use me in production"? No. Its a standard version banner.

Re:The new PHP by Gigablah on Tuesday March 04, 2014 @10:57AM (#7340953)
There's no pleasing you, is there?

Maybe we should add some <blink> and <marquee>?

Re:The new PHP by orf on Tuesday March 04, 2014 @11:40AM (#7341293)
Really? Look at the documentation page. The first thing you see is a huge chunk of text with absolutely no highlighting to guide you. Most people would just skim their eyes over that, and my attention gets drawn to the list of MIME types because it looks different.

Compare these two screenshots: http://i.imgur.com/Kzdphar.png http://i.imgur.com/CQnU8aG.png

A simple bold tag immediately draws focus and ensures that the huge majority of people who view the page get the important message. That's not being hard to please, it's just common sense.

Re:The new PHP by bmoresbest55 on Tuesday March 04, 2014 @11:14AM (#7341085)
I don't the person is being a pain. People will not heed a warning that is not clear and apparent. It's like the warning on the side a hot cup of McDonald's coffee. It's not paid any attention if it's not really, really, ####-->REALLY CLEAR<--#####.
Re:The new PHP by LawnGnome on Tuesday March 04, 2014 @01:44PM (#7342166)
Fair point. This is how that page will look after the weekly manual rebuild occurs on Friday: http://i.imgur.com/YXhafB5.png
Re:The new PHP by unfunco on Tuesday March 04, 2014 @01:56PM (#7342255)
I am of the opinion that it's simpler to write a basic PHP file than it is to configure Apache, Nginx, Lighttpd. I'd think that the majority of people running WordPress (likely the most distributed PHP project) are doing so on shared hosting, and not likely to want to or know how to configure their own server. The type of person interested in the built-in web server (a decent feature in my opinion, and comparable to `rails s`) is knowledgeable enough to know that the built-in web-server will not cut it for production traffic.
Re:The new PHP by userbinator on Tuesday March 04, 2014 @09:18AM (#7340258)
> The web server is explicitly for development purposes. It is not meant for production.

Doing that would mean the dev/prod environment is different, which is not that great of an idea. Keeping them as similar as possible leads to less chance of "but it worked on the dev server" sort of problems.

Re:The new PHP by Windwaker on Tuesday March 04, 2014 @09:28AM (#7340318)
It seems to me that PHP is pushing the built-in webserver to allow for accessibility, or "plug-and-play" if you will. Instead of having to go through having a LAMP setup everywhere you go, you can test code on the fly.
Re:The new PHP by dscrd on Tuesday March 04, 2014 @10:49AM (#7340897)
Is it really built-in to the language or just a library? Or is that boundary fuzzy with PHP?
Re:The new PHP by dd3141 on Tuesday March 04, 2014 @08:45AM (#7340087)
This. Can't agree more.