Hacker News new | ask | show | jobs
by simion314 2591 days ago
That would break too much things and the benefits will not be enough. They could add some new things, deprecated the old things and keep them all but then you get a manual twice as big. All the changes in PHP feel pragmatic, like better SQL support, better cryptography support, better defaults, better performance and less on cool looking syntax or latest cool features.

IMO pragmatic is good, especially when you have to use an existing code base and you have to upgrade it to the latest supported version you don't want a Python 3 migration story(I migrated a medium project to latest version and the only problem was a cryptographic function that was used to generate some random looking strings that was deprecated, I replaced with the new safer function and done , my project is now compatible with the older and the new version).

1 comments

I don't disagree with your points -- but then it turns out that PHP is still the same old crappy language it was ten years ago.
Is that and more, I mean everyone uses classes and namespaces now and structures code better so there is this improvement. Projects use autoloaders now and things again are better.

Have a look for example http://image.intervention.io/getting_started/installation how you would resize an image if you used a framework, it is much different then you would see in a code that was written 20 years ago.

My point was, people can still shoot themselves in the foot if they read an old tutorial. This should not be possible in newer versions. That would be a true improvement in my eyes.
But then that means breaking backwards compatibility, stranding huge parts of the internet on older versions, splitting the community into "pre-massive-change" and "post-massive-change", and a LOT of work by both PHP maintainers and "users" for what will end up being a marginal increase in dev happiness and practically zero material benefit for anyone.

And that still doesn't solve the problem of bad blog posts... You can't control what others write about the language, and if someone writes some posts or has a website with bad information, the maintainers of the language can't "fix" that. The best they can do is what they already do, make sure the PHP documentation is among the best and most approachable of the languages that I've used.

It is a good point but it is a big disadvantage for the people that need the backward compatibility, is the same issue with C++ or other similar old languages that keep the backward compatibility so old code continues to work.

Though if you work on a new project or existing project that uses a framework you will not even need to do the bad search queries like "how to insert an user in a mysql table", the framework is forcing you to use the correct/safe patterns.

Most beginning level tutorials are super simplified and are not following the correct patterns, like they don't check for errors, don't clean user input etc.

You mean to say that namespaces and classes are an improvement?
Yes, you mean you want everything in a global space, you have then issues where 2 dependencies define the same type named "Task" and on dev machine a different Task is initialized then on production (it happened to me when working on an old code base that was not using namespaces).

If you are an anti OOP person then I would prefer not to debate here religions.