Live data from Hacker News

PHP 7 Released

github.com

61–70 of 317 posts

Re: PHP 7 Released

#61
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…

That's how it's taught at the college I go to. About half the class already had experience with PHP/MySQL, and were a bit horrified.

Re: PHP 7 Released

#62
post #27
post #11

Earlier quoted context omitted.

Please explain why.

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.

Re: PHP 7 Released

#63
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…

> I urged him to switch to a sane framework like Laravel

...why didn't you taught him about PDO, so he can start with something more universal, not tied to one particular framework that happens to be popular nowadays?!

Then he can learn whichever OR/DM or DAL he might like need (Eloquent, Doctrine, Redbean, IdiORM/Paris etc.), and also be able to pop the hood and debug it when needed.

I never get it why so many otherwise-good PHP devs have their heads full of framework-specific knowledge and have a propensity to fall in love with heavy frameworks like Laravel, or worse, with leviathans like Symphony or Zend ...instead of playing to the language's advantages and using light-weight tools and libraries that would allow them to move faster.

Re: PHP 7 Released

#64
post #36
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…

> 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 and learned bunch of best practices quickly. There is some middle ground good practice which is using PDO, or even better Doctrine/DBAL . I don't think Laravel's ORM is that good, and the Active Record Pattern is somehow controversia…

> Active Record Pattern is somehow controversial.

What is controversial about AR?

Re: PHP 7 Released

#65
The one thing I'd love to see is a native concurrency story with PHP. I'd put my vote in specifically to have Communicating Sequential Processes. I think that feature alone would take the language to another level. I know they've got stream_select, et al. and I've really enjoyed pecl event, reactphp, and of course there's HackLang's Async / Await if you want to convert, but having some modern / native constructs would be nice to have. Does anyone know if that's on the horizon?

Re: PHP 7 Released

#66
post #48
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…

Most of your complaints also apply to JavaScript

Such as? Maybe the part about users, but I don't see anything else (some I don't know to be fair).

Re: PHP 7 Released

#67
post #25

Earlier quoted context omitted.

PHP is very likely to be the language used by Mort: http://blog.codinghorror.com/mort-elvis-einstein-and-you/ I doubt any of those developers are ever going to switch what they're already using unless they are forced by some external factor. The more serious factor is: if you're on Hackernews, you're at least Elvis or even Einstein. Mort is out of reach for most internet media for programmers.

This is an arrogant and immature type of thing to write. This is programming, not high school cool-kids club. PHP is a wonderful tool that was mostly responsible for the dynamic web. Before it became popular, the web was mostly static HTML with an occasional CGI form, probably written in something like Perl, mostly just for emailing the webmaster. Maybe some small amount of JavaScript for something like rollover effe…

I agree with rejecting the elitist framing but … the web was decidedly not mostly static before PHP came along. Perl had many frameworks (e.g. PHP started as one), as did conventional languages like Java, Python, with deep server integration possible using things like mod_perl. There were also a bunch of web-specific dynamic platforms like Cold Fusion and classic ASP / me-too JSP. Finally, there was server-side JavaScript as one of Netscape's offerings in the mid-90s.

What PHP added was primarily ease of use with the ability to deploy code simply by creating a single file, suitable for mass deployment at ISPs in the era where everyone used shared servers, and the combination of comparative ease of use with enough performance to do serious projects. Cold Fusion was also easy but didn't support things like persistent connections (read: order of magnitude slower) and the core language was very, very slow and also quite limited and buggy. You could find much faster options if you wanted to build, debug and deploy a conventional language like C++ or Java but the cost and risk was so much higher that this was unfavorable unless you really needed performance.

EDIT: if you want a snapshot of what the 90s web was like, http://philip.greenspun.com/panda/ was quite popular in the day. I know at least one well-known business which still has a revenue-generating website built in TCL, too…

Re: PHP 7 Released

#69
post #58
post #49

Earlier quoted context omitted.

> PHP is the language many people love to hate Do you think there's a reason for that? Maybe a direct one? That it's a bad language for example? Why would it need to be anything more complicated than that. So I don't think your guess is accurate. It's simply a bad language on its own. No need to compare it to anything. And I don't think anyone can deny that, no one will honestly say that "php is a good language". You…

To me, it's a so-so language, with some bad parts, some ok. On the plus side, it's easy to pick up, and it gets the job done for many projects. Perhaps it's a bit like the Ikea of programming languages, if you will--no the best of furniture for sure, but when you need a table and some chairs with little efforts, it's nice to have, and they're not horrendous unless you couldn't build them correctly.

I like the IKEA parallel as IKEA is cheap. So was php (to host), hence the popularity I guess. And as a result of that, there are lots of developers.. and many equals cheap. And the vicious circle continues. Doesn't make it a good language :)

(To be honest, I like IKEA, and I don't think it suck)

Re: PHP 7 Released

#70
post #52

Earlier quoted context omitted.

> Number.parseInt is not that bad but I'll take to_json() global function instead of (new System.Web.Script.Serialization.JavaScriptSerializer()).Serialize() any day. It doesn't have to be one or the other. In fact, array functions could just be under the same static class, like Array::TheFunction() . It would be acceptable and limit chances of namespace collision .

> It doesn't have to be one or the other. Sure there's a spectrum. But even with one level I'm still guessing whether it was String.toInteger or Integer.toString, or String.parseInt or Integer.parseInt or Number.parseInt or whatever ... and since I need to check I don't mind finding out it's a global function named str2int or even int() that takes whatever.

If you have to look it up anyway, what difference does it make if it's a global or namespaces? If you don't know, you don't know. As such, your point as stated doesn't counteract why polluting global namespaces is a bad thing. There are arguments that could be made (PHP VM specific), but "I didn't ever RTFM and/or retain it" doesn't fly to me personally.
Post reply on HN