Live data from Hacker News

PHP 8: Before and After

stitcher.io

201–210 of 346 posts

Re: PHP 8: Before and After

#201
post #178

Earlier quoted context omitted.

> 1. Its variables start with $ and that is ugly: At the very least it seems nonsensical and cargo-cultish: As a non PHP-er, what is the actual purpose of $? In Perl, it indicates variable context (for better or worse, there's more than one, so it has to be indicated somehow ). In shell, it indicates the substitution of variable name by its value. In PHP...I draw a blank. It really seems like an "I wanted my language…

$ was taken from Perl https://stackoverflow.com/a/3073818 but because early PHP was more simplistic than Perl it only has $. Powershell also uses $ for variables. Regardless of etymology of the $ sign and the usefulness of it, personally I like it because it makes it easier for me when I'm reading code, especially if you are scanning fast, to differentiate variables from symbols. Yes, you can get that with your edito…

It seemed kind of obvious to me even at that time that it was taken from Perl. I just didn't get why. PHP could have lifted IMPLEMENTATION DIVISION from COBOL, but likewise, there would have been no point either (fortunately it didn't do that!).

Re: PHP 8: Before and After

#202

I don't really understand why in 2020 there's still this kind of blind hatred against this language. It often comes from horrible bad memories from previous versions or old frameworks. Objectively, compared to other languages i've been working with it is more than OK. Despite it's lack of "style" it is easy to understand, host, tests, diagnose and it is powerfull for web applications. I've been working on a SaaS API…

More than anything, I find the language $ugly. Is that fair? No. Am I being unreasonable. Yes. Do I love PHP? Gross. I just have to live with it and go past the ugly syntax. It’s like an unhappy marriage. It’s just fine.

Maybe think of money everytime you see the $ symbol, to make it more palatable? :P

On a serious note, I find the JS ecosystem more annoying than PHP. Modern frameworks like Laravel (Laravel is nice to work with), PHP is more than enough for its intended use - web applications. PHP 7 has good performance improvements too.

Re: PHP 8: Before and After

#203

I don't really understand why in 2020 there's still this kind of blind hatred against this language. It often comes from horrible bad memories from previous versions or old frameworks. Objectively, compared to other languages i've been working with it is more than OK. Despite it's lack of "style" it is easy to understand, host, tests, diagnose and it is powerfull for web applications. I've been working on a SaaS API…

Because those of us who know and have used several languages tend to develop a preference for expressiveness, terseness, safety, and dare I say, elegance.

PHP (and JavaScript) gained and maintain their relevance, despite being inferior languages, because of their historical placement. I'm sure COBOL has improved over the years, and we know it is still used and "needed"... because of its historical placement. But you probably wouldn't use it, either, unless you had to (or you didn't know a better alternative).

Re: PHP 8: Before and After

#204

I am not a developer, but by far most of the code I had to write in the past 5-6 years was in PHP. I see it going in a direction where it is no longer PHP, but trying to be something else it will never be (Java? C#?), so I may continue using it as long as it is backward compatible and that's it: good bye PHP, I am the same but you are not. I am not resistant to change, just the reasons I picked PHP versus something e…

Nothing is stopping you of writing PHP the "old" way, all new stuff is optional.

Only if you work alone. If you're in a team, you'll eventually have to start dealing with the new stuff.

Re: PHP 8: Before and After

#205
post #76

Earlier quoted context omitted.

What would they use it for? The first 'static' means the method is a part of the class rather than the instances of that class. The second and third 'static' indicate late static binding, meaning they refer to the class being called, rather than the class defining this method.

(Disclaimer: I know absolutely no PHP whatsoever.) > The second and third 'static' indicate late static binding, meaning they refer to the class being called, rather than the class defining this method. Wait, so they're using "static" to mean the binding is happening later ? Isn't that essentially less static than binding against the class being defined?

It's still static in the sense that the method is tied to a class, not to an object instance. Does that mean it's "less" static? I wouldn't say so.

Re: PHP 8: Before and After

#206
post #202

Earlier quoted context omitted.

More than anything, I find the language $ugly. Is that fair? No. Am I being unreasonable. Yes. Do I love PHP? Gross. I just have to live with it and go past the ugly syntax. It’s like an unhappy marriage. It’s just fine.

Maybe think of money everytime you see the $ symbol, to make it more palatable? :P On a serious note, I find the JS ecosystem more annoying than PHP. Modern frameworks like Laravel (Laravel is nice to work with), PHP is more than enough for its intended use - web applications. PHP 7 has good performance improvements too.

> Maybe think of money everytime you see the $ symbol, to make it more palatable? :P

Well, if you had a dollar every time you typed one... ;)

Re: PHP 8: Before and After

#207

I don't really understand why in 2020 there's still this kind of blind hatred against this language. It often comes from horrible bad memories from previous versions or old frameworks. Objectively, compared to other languages i've been working with it is more than OK. Despite it's lack of "style" it is easy to understand, host, tests, diagnose and it is powerfull for web applications. I've been working on a SaaS API…

> It often comes from horrible bad memories from previous versions or old frameworks. Not only that. There is a huge amount of devs hating PHP w/o ever having worked with it. Same with Perl.

And I imagine most people would prefer indoor plumbing instead of an outdoor toilet, even if they haven't used an outdoor toilet before.

I also prefer beef steak to catfood, but I admit I have not actually tried cat food...

Re: PHP 8: Before and After

#208
post #84
post #68

Earlier quoted context omitted.

What language _isn't_ trying to be Java these days? What the old jargon file described as "bondage and discipline lanugage" applies to all major programming environments now, as Java proved that you can actually commodify programmers quite well and both old-school enterprises and the SV juggernaut need their harvest. C#, TypeScript, Go, PHP -- they all converge on the same methods, tools and workflows. Tech choice th…

> You can actually commodify programmers quite well and both old-school enterprises and the SV juggernaut need their harvest. At first we had guilds and craftsmen. We could only produce a few things, their quality was quite low and the products were expensive. This was one of the reasons quality of life was quite bad, actually. Then we created the assembly line, standardized parts, mass production. Life sucked for th…

That's a whole bunch of items in one place. I don't disagree, to get better cooperation and efficiency in a group, languages and tooling have to adapt. That's part of my point, if what you're doing is the same, the languages will look the same.

But I quite disagree with the "it made our lives better" point, and would say that the efficiency, even with all the standardized language outlook, tooling and methodology is closer to the "9 women getting a baby in 1 month" quip than to Ford's assembly lines.

Re: PHP 8: Before and After

#209

Earlier quoted context omitted.

I haven't found any good arguments against PHP in the comments here, just pure hate. Let's name a few of the arguments people are making: 1. Its variables start with $ and that is ugly: I mean, come on, I won't even entertain this bigotry. 2. It used to be better before: This is just pure nonesense, before OOP PHP wasn't good to create any big and well-structured application, it is ironic because most of the bad opin…

> 3. It is trying to be Java: Well, sure it is more like Java, only less verbose and easier to write. Developers can be much more productive in PHP. I suppose if you are equating extra keystrokes to productivity, then sure. However, Java has vast ecosystems and standard libraries that dwarf most languages. The real gains in productivity are in not re-inventing the wheel for everything. Verbosity has little to do with…

You are proving my point by defending Java against PHP because my argument was that being more like Java isn't a negative thing.

The productivity point was a secondary point but when it comes to building websites I think people can build faster in PHP although I guess that depends on many factors.

Re: PHP 8: Before and After

#210
post #201

Earlier quoted context omitted.

$ was taken from Perl https://stackoverflow.com/a/3073818 but because early PHP was more simplistic than Perl it only has $. Powershell also uses $ for variables. Regardless of etymology of the $ sign and the usefulness of it, personally I like it because it makes it easier for me when I'm reading code, especially if you are scanning fast, to differentiate variables from symbols. Yes, you can get that with your edito…

It seemed kind of obvious to me even at that time that it was taken from Perl. I just didn't get why . PHP could have lifted IMPLEMENTATION DIVISION from COBOL, but likewise, there would have been no point either (fortunately it didn't do that !).

Early web was written in Perl, I guess it was the classic approach of lets borrow what is already successful and in end PHP won over Perl so it worked too. Bill Gates would have been proud.
Post reply on HN