Live data from Hacker News

What exactly do you dislike about PHP? and Why is your web language of choice better?

news.ycombinator.com

11–20 of 21 posts

Re: What exactly do you dislike about PHP? and Why is your web language of choice better?

#11
PHP is ugly.

Really, I could go on a rant about speed and security, but it's just ugly. I do most of my coding in Python now days which spoils me. I look at php and it's a nasty mashup of code, data, and structure all rubbed into one nasty little steaming pile. Python is pretty and that's why I like it. It's easy to read, easy to understand, and does not explode into a visual cacophony like I've seen most php projects do.

I'd use php for a small simple one off thing because it is stupidly simple to get a page working with no fuss. I also have no issue using php products like Wordpress or PHPBB. My first web startup I wrote in php and it was a pain to maintain after a while. Anything large I'll stay away.

Just because it's ugly and I have to stare at it.

Re: What exactly do you dislike about PHP? and Why is your web language of choice better?

#12
post #9
post #4

Have you seen the function list? http://www.php.net/quickref.php It's a nightmare. How about some organization? How about a hierarchy? How about some terseness?

If you think that's bad, you should try C sometime.

C's libraries aren't terribly well-organized, but, for me at least, the standard ones all fit in one brainful so it's not really a problem.

Re: What exactly do you dislike about PHP? and Why is your web language of choice better?

#13
post #9
post #4

Have you seen the function list? http://www.php.net/quickref.php It's a nightmare. How about some organization? How about a hierarchy? How about some terseness?

If you think that's bad, you should try C sometime.

Yeah, I don't really understand this. My first language was C, and all these C-like languages look quite similar in syntax. I never thought these were "pretty," but they don't really stroke an emotional component in me.

Re: What exactly do you dislike about PHP? and Why is your web language of choice better?

#14
post #11

PHP is ugly. Really, I could go on a rant about speed and security, but it's just ugly. I do most of my coding in Python now days which spoils me. I look at php and it's a nasty mashup of code, data, and structure all rubbed into one nasty little steaming pile. Python is pretty and that's why I like it. It's easy to read, easy to understand, and does not explode into a visual cacophony like I've seen most php project…

Have you checked out Code Igniter? It is a php framework that implements the MVC design pattern. Forcing the seperation of the different layers makes things much "prettier" in my opinion.

http://www.codeigniter.com/

Re: What exactly do you dislike about PHP? and Why is your web language of choice better?

#15
post #9

Earlier quoted context omitted.

If you think that's bad, you should try C sometime.

Yeah, I don't really understand this. My first language was C, and all these C-like languages look quite similar in syntax. I never thought these were "pretty," but they don't really stroke an emotional component in me.

My point is that PHP's lack of namespace hierarchy is just like C. In fact, most of PHP's libraries are very close to the underlying C libraries. The lack of apparent organization is mainly due to the fact that PHP pulls all these different, independently-written libraries together. If you were writing C, it would look about the same, except that you'd have to go out and find all these libraries and put them together yourself.

Re: What exactly do you dislike about PHP? and Why is your web language of choice better?

#16
post #9
post #4

Have you seen the function list? http://www.php.net/quickref.php It's a nightmare. How about some organization? How about a hierarchy? How about some terseness?

If you think that's bad, you should try C sometime.

I have used both for different purposes and I can honestly say conceptually C is a very clean, fast assembly language substitute. If some dumb programmer pulls together 20 C libraries with different semantics and does not properly abstract over them and unify things it's the programmer that's the problem. PHP is fundamentally messy because of just that reason PLUS other significant problems at the language, not library level.

Re: What exactly do you dislike about PHP? and Why is your web language of choice better?

#17
"You can nest function declarations, but with limited effect. Nested declarations do not limit the visibility of the inner-defined function, which may be called from anywhere in your program. The inner function does not automatically get the outer function's arguments. And, finally, the inner function cannot be called until the outer function has been called."

That's from "Programming PHP" by Rasmus Lerdorf et al.

This sort of messiness, repeated dozens of times in various ways is why I try my best to avoid PHP.

Post reply on HN