Live data from Hacker News

PHP 7 Released

github.com

221–230 of 317 posts

Re: PHP 7 Released

#221
post #219

I left the PHP community years ago, but...but...where is PHP 6? What was the reason to skip it?

Funnily, there is no PHP 6. While work had begun for this version, it was later abandoned due to some major issues regarding Unicode handling, as far as I know. Most of the features already implemented in PHP 6 were shipped in PHP 5.4 and they continued with PHP 7 in order to avoid confusion.

Re: PHP 7 Released

#222
post #49
post #39

Earlier quoted context omitted.

PHP is the language many people love to hate; I guess some of them like the idea of being able to point the black sheep of web development, so that they can tell "maybe we have some flaws, but at least we're not one of these PHP shops". https://en.wikipedia.org/wiki/Splitting_%28psychology%29

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

I think PHP is a great language, not just a good one, and its competitors like Python and Ruby offer little to nothing over PHP (and vice-versa). They're all in the same boat. Same programming style (OOP), same constructs, same runtime models (interpreted, JIT). I'm so fucking tired of people who have not programmed in PHP claiming anything, let alone that it's a bad language. I can make that claim about any language currently in existence with plenty of "evidence" to back it up, but my purpose here isn't to annoy. The only thing I can deduce from posts like this is that people lash out against PHP because they get off on being closed-minded and trolling others.

Re: PHP 7 Released

#223
post #101

Earlier quoted context omitted.

I could've done that but that wouldn't have taught the same things. PDO is awesome but requires deeper level of understanding (for a beginner), which may increase the frustration and may end up returning back to the mysql_query and co. It's easier point to framework that's already using PDO and and making sane defaults and solving bootstrapping problems. Once you've learned bunch of new concepts like ORM in one frame…

> PDO is awesome but requires deeper level of understanding (for a beginner), which may increase the frustration and may end up returning back to the mysql_query and co. Yeah, that's basically why I wrote EasyDB. https://github.com/paragonie/easydb $rows = $db->run('SELECT * FROM comments WHERE blogpostid = ? ORDER BY created ASC', $_GET['blogpostid']); foreach ($rows as $row) { // etc } Teach people to do things thi…

Yep. PDO still leaves room for string concatenation issues. Unfortunately, so does Doctrine.

Re: PHP 7 Released

#224
post #75

Earlier quoted context omitted.

> What is controversial about AR? How it represents rows as objects. How it makes people think about them. How it conflates modelling the domain with database structure. https://www.google.co.uk/search?q=activerecord+vs+datamapper

> How it represents rows as objects. A row is the DBMS's model of an entity in the domain. An object is an object-oriented programming language's model of an entity in the domain. Representing domain entities as objects in the PL that are backed by rows in a database relation (view or table), which is what the Active Record pattern does, is reasonable. > How it conflates modelling the domain with database structure.…

[deleted]

Re: PHP 7 Released

#225

Earlier quoted context omitted.

> PDO is awesome but requires deeper level of understanding (for a beginner), which may increase the frustration and may end up returning back to the mysql_query and co. Yeah, that's basically why I wrote EasyDB. https://github.com/paragonie/easydb $rows = $db->run('SELECT * FROM comments WHERE blogpostid = ? ORDER BY created ASC', $_GET['blogpostid']); foreach ($rows as $row) { // etc } Teach people to do things thi…

Yep. PDO still leaves room for string concatenation issues. Unfortunately, so does Doctrine.

What do you think of Propel?

Re: PHP 7 Released

#226

Earlier quoted context omitted.

> PDO is awesome but requires deeper level of understanding (for a beginner), which may increase the frustration and may end up returning back to the mysql_query and co. Yeah, that's basically why I wrote EasyDB. https://github.com/paragonie/easydb $rows = $db->run('SELECT * FROM comments WHERE blogpostid = ? ORDER BY created ASC', $_GET['blogpostid']); foreach ($rows as $row) { // etc } Teach people to do things thi…

Yep. PDO still leaves room for string concatenation issues. Unfortunately, so does Doctrine.

People who want to do string concatenation will continue to do so no matter what we tell them. At some point, we have to educate users. Giving them an easy-to-use alternative is a step in the right direction.

Re: PHP 7 Released

#227
post #207

Earlier quoted context omitted.

> How it represents rows as objects. A row is the DBMS's model of an entity in the domain. An object is an object-oriented programming language's model of an entity in the domain. Representing domain entities as objects in the PL that are backed by rows in a database relation (view or table), which is what the Active Record pattern does, is reasonable. > How it conflates modelling the domain with database structure.…

> A row is the DBMS's model of an entity in the domain. An object is an object-oriented programming language's model of an entity in the domain. There's why we disagree. I believe the DBMS's model shouldn't be conflated with the application's model. Sometimes the row is an entity in the domain; however consider a normalised data structure, where the entity as the application understands it may span a couple of tables…

> I believe the DBMS's model shouldn't be conflated with the application's model. Sometimes the row is an entity in the domain; however consider a normalised data structure, where the entity as the application understands it may span a couple of tables.

If the right DB structure spans a couple of tables, then it probably shouldn't be one monolithic object in an application model (there might be a "central" object of sorts, with other related objects of which it is composed; that doesn't mean the models are identical, or even exactly 1:1, as, e.g., aggregates are sensibly single objects in an OO design, but multiple rows with some common attribute in a relational design for the same domain model, but Active Record generally accommodates that.)

> DataMappers also shine when working against a legacy database or one that cannot be changed.

I generally prefer Data Mapper as a pattern for a variety of reasons (just not the particular ones that were raised as problems with AR upthread, or, at least, for reasons that seem different to me than how those were phrased) -- even though I find that there is a usually a close correspondence between the natural relational model for a domain and the natural OO model, with divergences in models usually indicating a violation of good design principles on one side or the other (often the SRP on the OO side), I find AR itself is a violation of the SRP principle; the description of the pattern in PofEAA should raise a big red warning flag about this: "Each Active Record is responsible for saving and loading to the database and also for any domain logic that acts on the data" --"saving and loading to the database" can credibly seen as one responsibility (more succinctly, persistence) but that "and also" introduces a completely separate responsibility.

I also don't like that the simplicity of most AR implementations -- the main benefit they seem to offer for that compromise of the SRP -- tends to rest on making additional compromises, mostly in DB design and use, but sometimes on the OO side. If you avoid those compromises, you end up with something that isn't any simpler to set up and maintain than a Data Mapper, and Data Mapper gives you more freedom to evolve the persistence implementation independently (even if the model is still usually closely parallel to the application model), and even use different types of datastores.

(On a note that does approach one of the issues raised upthread, its also a fact that real world DBs and OOPLs both often require pragmatic compromises to the natural abstract relational or OO models for a domain to optimally address real problems; while it would be ideal to choose better tools -- or improve the tools -- to avoid these problems, that's often not a practical option, and tightly coupling application and relational models means that that compromise you choose on one side gets reflected on the other side, where it may not be necessary, and may be counterproductive.)

Re: PHP 7 Released

#228

Earlier quoted context omitted.

Cobol is still in use. That doesn't make it good. PHP is a poorly written language. From comparisons to namespaces to other gotchas, it's just pigs guts. From the ground up, it's a badly designed language. Look up "Fractal of bad design" for a better understanding of why.

The numbers tell a different story. Wordpress powers 25% of the entire web. That is a quarter of the entire internet. It's pretty much your opinion vs the entire internet. You can see how your opinions come off as ludicrous ?

Not really. How many owners of those 25% of web sites are programmers who have any opinion whatsoever about programming languages?

Re: PHP 7 Released

#229
post #44

Earlier quoted context omitted.

I was waiting and waiting for this as well, but checked homebrew during RC6 and there was a PHP70-memcached, so I took that to mean it had finally caught up?

ext/memcache is not the same thing as ext/memcached. Yup, there are two, and they are entirely different. One uses the historic library, the other uses the new library. Why they decided to do it this way is beyond me.

Yeah, I know there are two. I was under the impression that the original (memcache) was abandonware. How much difference is there between the two to migrate from php-memcache to php-memcached?

edit: never mind, I'm going to figure this out by using the internet!!

Re: PHP 7 Released

#230
post #138
post #110

Earlier quoted context omitted.

Just because a lot of sites run it doesn't mean it's not crap. A lot of companies still host stuff on Windows like it's still 2002, as well. PHP has no place in modern development.

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.
Post reply on HN