Live data from Hacker News

In many ways PHP is just now starting to come into its own

gist.github.com

51–60 of 133 posts

Re: In many ways PHP is just now starting to come into its own

#51

Earlier quoted context omitted.

Look at how slow Python 3 adoption has been. I don't think completely breaking backwards compatibility is a quick thing. The Python folks expected 5 years for Python 3 to become the default version because of the dramatic changes. http://programmers.stackexchange.com/questions/63859/why-do-...

Not every Python user uses Django, you know. I've worked on a number of software systems at several different organizations that have very effectively used Python 3 for years now. I think that Python 3 has been adopted perfectly fine by many other people and organizations, too. We're just not overly vocal about using it, because it has worked for us with so little pain and so little effort in many cases. It really wa…

>> We're just not overly vocal about using it

That doesn't sound like the Python users of my experience... :-)

Re: In many ways PHP is just now starting to come into its own

#52

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

What is the nature of functional programming? HoF.

Re: In many ways PHP is just now starting to come into its own

#53
post #25
post #3

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

> PHP is still the only language that assumes HTML output by default. For me, that's not a feature, it's an oddity that I have to work around. I guess it's a feature if you're using PHP as the HTML template language it was designed to be, but I suspect that's a minority use case these days.

How is the default header of `Content-Type: text/html` Any different form a default header of `Content-Type: text/plain`?

It takes you about 3-4 seconds to change it for your entire project.

Re: In many ways PHP is just now starting to come into its own

#54
post #30

I'm as cutting edge in the PHP community as any is going to be (having used the latest betas & community-best-practices since 2004). I still have serious doubts about PHP, and always insist to new developers should learn a (ruby/python/... clojure/...) too. The main problem with PHP is the language itself. There is no paradigm it does well. If you're into class-ical OO, then the language's type system is a joke (esp.…

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

Re: In many ways PHP is just now starting to come into its own

#55
post #49
post #41

Earlier quoted context omitted.

> For me, that's not a feature, it's an oddity that I have to work around. Well, I would venture a guess that you should have looked up the language's name and its meaning, then the entire focus of PHP might not come as much of a surprise.

"Personal Home Page"?

> Zeev Suraski and Andi Gutmans rewrote the parser in 1997 and formed the base of PHP 3, changing the language's name to the recursive acronym PHP: Hypertext Preprocessor.

http://en.wikipedia.org/wiki/Php#History

Re: In many ways PHP is just now starting to come into its own

#56
post #50

Earlier quoted context omitted.

Exactly. I am still using PHP for pretty much all of my projects despite all of its shortcomings. The reason for this is just how easy it is to write simple scripts and deploy them. For most small hobby projects it is just not worth spending hours setting up the development environment required to create a Ruby/Flask/... project when you can achieve the same thing with a single PHP file. And when it comes to deploy i…

After you do it once you realize its not that hard to deploy. Nginx -> Gunicorn -> your app

It is even easier if you use Phusion Passenger, either in combination with Nginx or with Apache. It is almost as easy as PHP. Put your Ruby app somewhere, set your document root to it, done. Nowadays, Phusion Passenger even supports Django and Node.js.

Re: In many ways PHP is just now starting to come into its own

#57
The code example he gave in ruby and PHP demonstrate perfectly that the PHP version is verbose (not to mention that the ruby code isn't the most concise one). It could be just me, who, as a develop, is sensitive to every single unnecessary characters in the code, which happens a lot in that couple lines of php code.

Re: In many ways PHP is just now starting to come into its own

#58
post #50

Earlier quoted context omitted.

Exactly. I am still using PHP for pretty much all of my projects despite all of its shortcomings. The reason for this is just how easy it is to write simple scripts and deploy them. For most small hobby projects it is just not worth spending hours setting up the development environment required to create a Ruby/Flask/... project when you can achieve the same thing with a single PHP file. And when it comes to deploy i…

After you do it once you realize its not that hard to deploy. Nginx -> Gunicorn -> your app

What faint praise this is. "Not that hard". :)

Re: In many ways PHP is just now starting to come into its own

#59
post #3

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

Exactly. I am still using PHP for pretty much all of my projects despite all of its shortcomings. The reason for this is just how easy it is to write simple scripts and deploy them. For most small hobby projects it is just not worth spending hours setting up the development environment required to create a Ruby/Flask/... project when you can achieve the same thing with a single PHP file. And when it comes to deploy i…

I've deployed a number of small PHP-based websites in a similar way for similar reasons over the years. However, I think the next "simple" project like that that I need to do will be statically rendered from frozen-flask and hosted on S3, with any small interactivity provided on the client, with JavaScript.

Re: In many ways PHP is just now starting to come into its own

#60
Prepare 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 programming. It was enjoyable to work with, and it took off.

Circa 2004, the hardest part of web programming was managing the DB from the app code (migrations,ORM), quickly accessing the prolific output of the OSS community (RubyGems), and having some sane organizing principles around building apps (opinionated MVC).

In 2004 I had the same problems in my PHP apps. I had just come off of 2 years of Cocoa development and couldn't stand doing PHP the "old" way. It was too painful. I ended up porting the Cocoa framework to PHP so that I'd have a sane way of building apps. I later discovered ruby/rails, but frankly at that time it was less mature than my framework so I didn't jump.

As someone stuck in PHP land, I was frustrated by the relative lack of progress in the PHP community vs Ruby, but I was never really enamored with Ruby the language. It's powerful, and easy to read, but frankly I felt that power would eventually work against it. As the less-savvy developers moved to it, the quality of the code would greatly diminish. I feel that this has happened.

I do use a lot of Ruby projects as well, and it's rare that I don't run into critical bugs almost immediately. For as many nice things as there are about ruby, I find it very difficult to debug, and the broad application of metaprogramming, mixins, and other language tricks ends up delivering apps that have highly coupled state that fail in unpredictable, hard to debug ways. Javascript has the same problem. Frankly I don't think the ruby community is producing code of better quality than the php community at this point. There is great stuff that we can finally easily share thanks to composer.

Metaprogramming & dynamism are neat ideas but I just don't think it scales well with the constructs that those languages have. PHP 5.4 has traits which are really nice for this type of thing, and Scala's traits are even nicer. The point being that other languages can deliver that flexibility without becoming unmanageable, and I don't think there's a path to that with Ruby or Javascript.

IMO, I think languages like Ruby and Javascript will actually WANE in the far future as new languages come along with better constructs for empowering developers with dynamism that can be better managed and have faster runtime performance. I think Ruby will end up as a frowned-upon language with crap libraries and Javascript will more and more just be used as a build target.

Post reply on HN