I'm just wondering, why should it take 15 years to get operators [] and -> to work with any subexpression (and to my knowledge it's still not 100% there)? Shouldn't it be implied and kind of automatic in a programming language? Or why should it take 15 years to adopt [...] as an array constructor in a language where arrays are one of the central data structures? Here is opinion No. 823,664,783 about PHP from a long t…
In many ways PHP is just now starting to come into its own
91–100 of 133 posts
Re: In many ways PHP is just now starting to come into its own
#92Prepare yourself for gross generalizations, but I have a point :) In 1997, people moved from perl to PHP in the same way that in 2004+ people moved from PHP to Ruby. At the time, the hard part of web programming was deployment, easy access to libraries of functions relevant for web programming, digesting forms, and emitting HTML. PHP suddenly made that trivial. PHP was basically a new language with a stdlib for web p…
Correction: if it compiles everywhere ... it's not waning. C, C++, and JavaScript are with us for a long time. But, you're right about Ruby. :-)
Re: In many ways PHP is just now starting to come into its own
#93While it's certainly true that PHP is better than it was 7 years ago, that is primarily in the ecosystem and not the language. The language remains as bad as it was 7 years ago, and they seem to be woefully unwilling to actually fix it.
Not so fast. PHP evolved a lot as a language, maybe it will never be enough to fix its ancestry, but namespaces, closures, generators, ~~typed~~ expressions (you can finally slice a function call returning an array without unnecessary variables) and some literals. It's still not 1958-worthy to me, but they do evolve.
Re: In many ways PHP is just now starting to come into its own
#94I started with php and never used a framework quite some time ago. Every web site/app I've built had different file structures and my own little twists on how to abstract away certain things. I rarely used any third party php code too but my code slowly improved on its own. Now a days I use rails and prior to that I used node/express for a year or so. I think working with php made me a better developer because you ne…
It's quite possible to write PHP applications which aren't that terrible, tightly coupled or unmaintainable. Perhaps you can blame PHP's low bar for entry for making those kind of bad practices possible, but it's not as if the language requires you to work that way.
Although I do see that kind of thing a lot in Wordpress, still.
Re: In many ways PHP is just now starting to come into its own
#95"Jeff Atwood has stated publicly that one of his ulterior motives with the Discourse project is get people to stop using PHP and start using Ruby." This just won't ever happen. The people that wanted to drop PHP for something else (Ruby, etc) largely did so years ago. The hosting/running situation for PHP is just too basic and easy for people to get in to vs having to 'run a server' (Rails, etc). PHP is still the onl…
Re: In many ways PHP is just now starting to come into its own
#96"Jeff Atwood has stated publicly that one of his ulterior motives with the Discourse project is get people to stop using PHP and start using Ruby." This just won't ever happen. The people that wanted to drop PHP for something else (Ruby, etc) largely did so years ago. The hosting/running situation for PHP is just too basic and easy for people to get in to vs having to 'run a server' (Rails, etc). PHP is still the onl…
Their is money in syntax now.
Re: In many ways PHP is just now starting to come into its own
#97I started with php and never used a framework quite some time ago. Every web site/app I've built had different file structures and my own little twists on how to abstract away certain things. I rarely used any third party php code too but my code slowly improved on its own. Now a days I use rails and prior to that I used node/express for a year or so. I think working with php made me a better developer because you ne…
You don't really understand why things are done a certain way until you've experienced first hand at how horrible it is to maintain a 6,500 line php file that's mixed with sql, php, html and a ton of inline css in a project that has about 500kb of mixed php/html/css files and like 30 different dynamic pages. It's quite possible to write PHP applications which aren't that terrible, tightly coupled or unmaintainable. P…
At least that's how it was back in 2006ish when I started. Its low barrier of entry is exactly why it's easy to make mistakes. You are given 5000 functions and no guidelines other than the ones you make yourself.
Re: In many ways PHP is just now starting to come into its own
#98Earlier quoted context omitted.
Well that's why I said "even" Javascript. Brendan Eich actually pulled off a small miracle by embedding incredibly powerful functional and prototypal paradigms in JS. It's not perfect, and there are plenty of warts, but JS came out of the gate with a powerful core that PHP took decades to add in a Frankenstein manner.
Enough with the "JavaScript is a functional language" myth, please. Merely having first-class functions does not make a language a functional programming language. JavaScript does not promote the use of pure functions, referential transparency, and the minimization of state. JavaScript does not encourage the use of recursion. JavaScript has an atrociously broken type system, rather than a robust and theoretically sou…
Re: In many ways PHP is just now starting to come into its own
#99Re: In many ways PHP is just now starting to come into its own
#100Earlier quoted context omitted.
Plus there is PHP's aesthetics. I can't help but see all PHP code visually unpleasing. Programming isn't just a technical task. It's also an art like writing novels. I'm not satisfied when the code I produce doesn't look pretty, independently from the algorithm. In the article here, the Ruby code looks much cleaner to me than the PHP version, even though it's technically the same. Aesthetics is the main reason why I…
That really depends on what you're writing and how you are doing it. How is this php[1] code uglier than this python[2] code? [1]: https://github.com/laravel/framework/blob/master/src/Illumin... [2]: https://github.com/reddit/reddit/blob/master/r2/r2/controlle...
The Python code, while a little heavy on decorators for my personal taste, spends the same number of lines of code implementing a whole swathe of useful application functionality.
I'm not saying your particular example proves anything about PHP vs Python, I just think you chose an apples-to-oranges comparison to illustrate your point. It would be much more interesting to see some PHP code that implements business logic similar to that Python.