Live data from Hacker News

PHP 7 Released

github.com

271–280 of 317 posts

Re: PHP 7 Released

#271

Earlier quoted context omitted.

Agree, then again there are different types of people. Some wants to learn from bottom up(analytic approach), others want to see cool stuff then tweak, modify, replace to find the limits (holistic approach). IIRC there is a tendency that young people prefer the holistic approach while teachers either are selected for or grow into preferring the analytical approach.

Doesn't holistic approach just make sense? It's not like you learned to speak with your parents reading you the dictionary beginning with the letter A.

The approaches aren't exclusive either, you can start "holistic" and then learn more by going "analytic" afterwards, once you have the gist of things.

Re: PHP 7 Released

#272

Earlier quoted context omitted.

Not the language? PHP is the only lasting language where making code that allows SQL injection is easier than code that forbids it. PHP includes all the worst practices you'll find on any languages. Javascript has the eval problem - PHP has it too; Perl have the too fluid type system where you can't specify anything - PHP too, except that it lacks Perl's tainted mode; Asp made it easier to create code subject to XSS…

> PHP is the only lasting language where making code that allows SQL injection is easier than code that forbids it. Pretty sure this is true for any language, the key difference is education. When learning JDBC for example, you're taught to use prepared statements with params vs. string concatenation.

It's not just about education. PHP encourages bad practice. The language is implemented by people who haven't learned from the past 30 years of language design. It's made available to beginners and presented as "easy" when dealing with all the gotcha's is everything but. Etc. Sure, you can learn how it works and a competent person could probably write safe code with it (given enough time). But it's really a dangerous language, the use of which should be discouraged. Better alternatives exist.

Re: PHP 7 Released

#273
post #216
post #7

PHP 7 makes life a lot better for PHP devs in many ways but one awesome thing is it obsoletes bunch of out-of-date tutorials by finally removing the old Mysql extension \o/ http://php.net/manual/en/migration70.removed-exts-sapis.php I actually met a young aspiring web developer who still learned DB-access with mysql_* functions. I urged him to switch to a sane framework like Laravel. Oh boy he was happy in a month an…

Oh you can most certainly compile mysql right back into PHP7

Someone who's using mysql_* functions is probably not compiling their own versions of PHP.

Re: PHP 7 Released

#274
post #138

Earlier quoted context omitted.

You're not only wrong, you're extremely rude. How many professional PHP developers do you estimate are in the world currently? "no place" indeed. If you've truly taken the time to understand modern PHP and want to discuss its weaknesses, by all means proceed. Otherwise bashing the professional work of your peers is simply rude.

As I read it he's saying the language is crap not his peers who use it.

"PHP has no place in modern development" implies that peers choosing PHP for new dev are essentially incompetent.

Re: PHP 7 Released

#277
post #233

Why, ohh why, won't this freak of nature (language) just die :-(

Because it's actually not bad for anyone who has written PHP 5.4+ with a modern framework. Yes. Good.

It may solve your immediate problem. But it's dangerous - there are too many hidden gotchas and situations where you have to know the actual implementation (which can change) to know what it does. It also breaks a lot of conventions established by most other languages, so you really have to be really careful when assuming that "this probably works like I expect" - you may get nasty surprises). Ohh and it's pretty slow compared to other languages (like C++, Lua & Python - just to name a few). And that's not even mentioning the fact that the people implementing it seem to be a case of the "blind leading the blind". Just search for how they tried to fix an integer overflow by testing if "foo>intmax" etc - that's just the tip of the iceberg (who the hell thought that converting strings to integers before comparing them was a good idea?) etc etc. Those guys should not be allowed near language design. So yeah; it's pretty bad.

Re: PHP 7 Released

#278

Why do they keep adding global functions like "intdiv"? For example in JS, it being another language with a similar compatibility burden, they are moving most of the global functions (like parseInt) to "namespaces" (like Number.parseInt) while keeping global references there. When I open the docs (for example, the array functions page[1]), I get frightened by the global functions which do not seem to share a naming c…

This is ongoing in the PHP community. For those who like purity there are tons and tons of wrapper classes that hide all that stuff away. Modern IDEs autocomplete all the functions, I'm using PHPStorm and as soon as I type 'arr' it shows me a list of all the array functions with parameters listed. Not perfect, but if I was worried about that kind of thing I'd use Python (which I love) or RoR (which I also love). The…

> The ethos of PHP is to just get stuff done

I never understood this standpoint. I hear this from the Go community sometimes too. Wouldn't having some sane organization of functions make it easier to "just get stuff done"? Just like in Go, wouldn't generics make it easier to get stuff done?

Re: PHP 7 Released

#279

Earlier quoted context omitted.

I wasn't being argumentative, I just thought that would be something worthwhile to add for people following along.

Gotcha, sorry. "Pop quiz" always makes me think it's being sarcastic. So, yes, total agreement there. Parameterized queries are key. I find it crazy that anything else ever existed, let alone still gets used.

Ah, yeah, I hadn't considered the normal usage.

Most people don't realize how much these vulnerabilities have in common, in the abstract, until you frame it like that.

Re: PHP 7 Released

#280
post #62
post #27

Earlier quoted context omitted.

Have you ever worked with php? I have only slightly and it was truly horrible. The library is a complete rubbish. You couldn't create worse one if you tried. The language development is bad. Some developers are bad. Many users are bad. Does these points make the language bad? Yes. New features are incoherent and seemingly random, issues pop in and out (and back in) because tests simply fail, there are unexplainable s…

The library is C's fault. PHP is basically a scripting language around the standard C library. It's what makes it the fastest non-JIT scripting language, but also what makes it so inconsistent.

So are Lua and Python and Ruby, but they're not "inconsistent".
Post reply on HN