Live data from Hacker News

PHP 7 deployment at Dailymotion

engineering.dailymotion.com

91–100 of 166 posts

Re: PHP 7 deployment at Dailymotion

#91

> During few months, this project wasn’t the priority, so we decided to wait the release of PHP 7 to compare performances. I have no idea why the author is choosing to write in such a strange grammatical style.

Not everyone is a native English speaker. I am not and probably sound as weird. If it makes sense though who cares?

Exactly, the author is French. While I am sure this was reviewed by someone else in the Dailymotion (a French company), the reviewer was also French.

Re: PHP 7 deployment at Dailymotion

#92
post #14

Hack and HHVM solves what is, IMO, the worst feature of the default PHP runtime environment[0] - and that is the superglobals. It wasn't mentioned in the post from Slack, but default superglobals and the earlier register_globals design decisions are the worst and most impactful wart in PHP. Because it was designed as a templating language, the default web server interface, which is CGI - will auto-expose all variable…

I'm not a huge fan of the superglobals - but the correct fix here is to use a parameterized query!

I'm not sure which languages you are used to, that will somehow magically 'escape' an input string so that it's safe to inject directly into your query in all circumstances. I know I don't want strings from the frontend pre-quoted in any way. I want the string the way the user typed it in!

Re: PHP 7 deployment at Dailymotion

#93

Earlier quoted context omitted.

>PHPs reputation seems to surround the fact that it tends to be (or was) the first language amateur coders dabbled with. That's certainly part of it. JavaScript suffers the same hate today -- amateur and junior developers produce thousands of lines of crap per year, and people blame it on the language. But PHP itself is just a mess. I'm an experience developer (about 30 years at this point), and about 12 years ago I…

> I'm an experience developer (about 30 years at this point), and about 12 years ago I decided to do a volunteer project for a nonprofit in PHP > mysql_xxxx functions So, you used PHP 12 years ago and comment based on that. You have a point though. I used this internet thing about 17 years ago, it was terrible. Only dial-up. SLOW! And don't talk to me about browsers. Netscape? Internet Explorer? Ugh. Forget it. I don…

>You have a point though. I used this internet thing about 17 years ago, it was terrible. Only dial-up. SLOW! And don't talk to me about browsers. Netscape? Internet Explorer? Ugh. Forget it. I don't care what they might have changed, or replaced or completely removed, its always terrible.

We have only one Internet. But we have a lot of alternatives for Php to choose from.

If you have an Internet provider that gave you horrible service, will you give them another try even when your current provider is great in every way, just because the only good thing with your past provider was they gave you a connection in a day, instead of 3 days as with your current provider....

Re: PHP 7 deployment at Dailymotion

#94
post #14

Hack and HHVM solves what is, IMO, the worst feature of the default PHP runtime environment[0] - and that is the superglobals. It wasn't mentioned in the post from Slack, but default superglobals and the earlier register_globals design decisions are the worst and most impactful wart in PHP. Because it was designed as a templating language, the default web server interface, which is CGI - will auto-expose all variable…

Re: the SO answer, is it possible to report that code for being inherently unsafe? I think SO should take responsibility and edit or at the very least flag unsafe code.

Re: PHP 7 deployment at Dailymotion

#95
post #14

Hack and HHVM solves what is, IMO, the worst feature of the default PHP runtime environment[0] - and that is the superglobals. It wasn't mentioned in the post from Slack, but default superglobals and the earlier register_globals design decisions are the worst and most impactful wart in PHP. Because it was designed as a templating language, the default web server interface, which is CGI - will auto-expose all variable…

No-one should be reading from $GET/$POST these days - use filter_input

php.net/manual/en/function.filter-input.php

Re: PHP 7 deployment at Dailymotion

#96
post #85

Earlier quoted context omitted.

> ctype_digit is broken. Try passing integer values. Well, ctype_digit takes strings, not integers. So don't be surprised if you pass the wrong type to a function and it doesn't work as you expected. Some of your criticism is valid, but you can't go around talking about how PHP isn't rigorous enough, and then complain tha some functions don't work as you'd like when you give them a wrong argument type. Your other arg…

>Well, ctype_digit takes strings, not integers... The problem is that the behavior is not consistant. Php is some parts c, some parts java and some part perl. That is the problem. It takes a encyclopedic knowledge of the documentation to know what part you are dealing with. And even that might not help you sometimes, because the documentation can be plain wrong at places... >anyone who actually cares about what he do…

If you know C, you can identify pretty well what are the (thin) PHP wrappers around the C routines. Java influenced the OO design, so you know where to find it, and Perl is mostly, well, PCRE. It's not consistent, but it's not _that_ hard to navigate.

Re: PHP 7 deployment at Dailymotion

#97

Earlier quoted context omitted.

If you have no idea, why bring it up?

Often times other people here do have a different perspective. I also found it very distracting from reading the post.

> I also found it very distracting from reading the post.

'from' should be 'while'

Annoying is it not? Never assume a posters first language is English and as long as the meaning is clear I don't think it matters.

Re: PHP 7 deployment at Dailymotion

#98
post #83

Earlier quoted context omitted.

Often times other people here do have a different perspective. I also found it very distracting from reading the post.

This view is pretty common for people reading their first language written by someone using their second or third language. This comes people that just isn't as good at writing and expressing themselves. This does by no means make their thoughts less valuable. Sometimes you just have to open your mind to other people even though the words come out in the wrong order. English is not my first language either but I don'…

I just think I'm fortunate that my first language became the de-facto language for technology and that anyone who speaks/writes it well enough to be comprehensible about technical matters in a 2nd language deserves my respect!.

My GF finds that I know multiple programming languages impressive while not realising that her ability to speak English, Hungarian and German fluently leaves me in awe.

Re: PHP 7 deployment at Dailymotion

#99
post #96

Earlier quoted context omitted.

>Well, ctype_digit takes strings, not integers... The problem is that the behavior is not consistant. Php is some parts c, some parts java and some part perl. That is the problem. It takes a encyclopedic knowledge of the documentation to know what part you are dealing with. And even that might not help you sometimes, because the documentation can be plain wrong at places... >anyone who actually cares about what he do…

If you know C, you can identify pretty well what are the (thin) PHP wrappers around the C routines. Java influenced the OO design, so you know where to find it, and Perl is mostly, well, PCRE. It's not consistent, but it's not _that_ hard to navigate.

Well, It is not that easy. For example, take the function strlen(). You can see that it is a wrapper for the C function.

So can you expect that it will behave like the c function, accepting strings only? No! It now accept both strings and integers. So you have part perl there.

Now take another function. ctype_digit(). I don't know where the name come from. You expect it to behave like strlen() accepting both strings and numbers. But no!

If you pass it a number, it won't even bat an eye (throw an exception or error), but it will just return gibberish...

Hope my point, that these influences are mixed together in a haphazard fashion, is a bit more clear now...

Re: PHP 7 deployment at Dailymotion

#100
“how to scale without investing too much in people/servers”

This exactly is the antisocial and greedy attitude that we have to actively fight if we want peace, freedom and prosperity for all people.

Please cancel all your dailymotion accounts and let these disgusting people disappear forever.

Post reply on HN