Live data from Hacker News

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

gist.github.com

61–70 of 133 posts

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

#61
post #54
post #30

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

seem php shorter without comment. while see the python.. quite nasty import from.. i tough python is simple .

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

#62
post #42

Earlier quoted context omitted.

I prefer rails specifically because the "hosting/running situation" for Rails is so FAR superior to that of PHP. $ git push heroku master ...done.

I don't really want to stand up for php, but this just isn't true. "git push heroku master" comes at a steep price. PHP hosting is, in general, ubiquitous, cheap, and incredibly easy. You can get comparable pricing for ruby hosting, but you'll be doing some server setup yourself.

"git push heroku master" comes at a steep price.

Um... what? 1 dyno is free on heroku. You host it for nothing. Am I missing something?

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

#63
One of my main challenges with PHP is that it has no package manager with large community support. With npm and gem, and the community supporting them - developers get so much help in building robust products. Every developer that I've known for a few years and successfully switched from PHP to Node has said "Why didn't you tell Me about this before?!"

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

#64

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.

That example is framework specific. Change the php framework to laravel and this:

    $topic = $this->get('model.Topic')->find($topic_id);
    $this->get('guardian')->ensureVisible($topic);
becomes this:

    $topic = Topic::find($topicId);
    Guardian::ensureVisible($topic);

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

#65
post #54
post #30

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

I'm not saying it really matters, but the PHP just looks ugly to me. I think it's all the dollar signs and braces.

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

#66
post #54
post #30

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

Is that really a good comparison?

The PHP code you linked to is basically a class with a bunch of getters and setters.

The Python code, on the other hand, handles numerous real-world HTTP requests that do actual work.

So it's not unexpected that the PHP code is lighter; it doesn't really do anything useful!

Although it helps implement a wiki system, the Python code is still very readable and comprehensible with minimal effort.

I think I know the point that you're trying to make, but those examples surely don't back it up in any way.

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

#67
post #62
post #42

Earlier quoted context omitted.

I don't really want to stand up for php, but this just isn't true. "git push heroku master" comes at a steep price. PHP hosting is, in general, ubiquitous, cheap, and incredibly easy. You can get comparable pricing for ruby hosting, but you'll be doing some server setup yourself.

"git push heroku master" comes at a steep price. Um... what? 1 dyno is free on heroku. You host it for nothing. Am I missing something?

Yes, that 1 dyno is not enough, and there are tons of other limitations (db use, etc).

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

#68
post #63

One of my main challenges with PHP is that it has no package manager with large community support. With npm and gem, and the community supporting them - developers get so much help in building robust products. Every developer that I've known for a few years and successfully switched from PHP to Node has said "Why didn't you tell Me about this before?!"

Composer/Packagist[1] is exactly like npm. It's even mentioned in the article.

[1]: https://packagist.org/

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

#69
post #65
post #54

Earlier quoted context omitted.

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

I'm not saying it really matters, but the PHP just looks ugly to me. I think it's all the dollar signs and braces.

That's a mirror image of 'Lisp just looks ugly to me. I think it's all the parentheses.'.

There is a lot more to a language than its syntax.

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

#70
post #65
post #54

Earlier quoted context omitted.

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

I'm not saying it really matters, but the PHP just looks ugly to me. I think it's all the dollar signs and braces.

That's extremely shortsighted.

Special chars, like PHP $, Rust's ~, Ruby's @, help the programmer tell things apart easily.

Vastly better than having to keep the information in your mind after the declaration -- and much lighter and better than full-on hungarian notation madness.

As for the braces, they never went out of style. In fact, with the exception of Python, the languages that don't use them are not that popular, compared to the ones that do. Coffescript, for example, is insignificant compared to the plain Javascript use.

Post reply on HN