back

by rbanffy·17y ago·view on hn ↗
"It's the C of scripting"

No. C is a very elegant, if somewhat minimalistic, language. PHP is a kludge made of all sort of functions cluttering the only namespace there is. While K&R clearly understood the value of separating language from library, PHP deliberately ignores this lesson. I heard the most recent version (or the next, maybe) will support namespaces. It started as a quick-and-dirty solution for writing dynamic pages and, sadly, it shows.

I somewhat fail to see the power of a language as something derived from lack of fancy constructs or high-level abstractions. And, BTW, C has a lot of fancy constructs and high-level abstractions: you just have to point the right libraries to the compiler/linker.

I am sorry to tell you, but the main reasons PHP is so popular are the low cost of labor and the lack of interest by a large group of self-appointed programmers in learning anything, as you say, fancy.

1 comments
"PHP is a kludge made of all sort of functions cluttering the only namespace there is"

Yeah, how many namespaces does C have again? If you were to write a web application in C with all the same open source C libraries as are available for PHP, your only namespace in C would look almost identical.

"While K&R clearly understood the value of separating language from library, PHP deliberately ignores this lesson"

Ironically, this is exactly what made PHP successful. Everything is included in the box. It wouldn't have been half as successful without including every useful library they could find.

"C has a lot of fancy constructs and high-level abstractions: you just have to point the right libraries to the compiler/linker."

You're not going to get closures, classes, meta programming, etc, etc, from libraries in C. And guess what, PHP has libraries too!

"Ironically, this is exactly what made PHP successful. Everything is included in the box. It wouldn't have been half as successful without including every useful library they could find."

I am all in for including interesting stuff, but not at the expense of forcing everything in at once and thus cluttering the only namespace people have to work. While C has only one namespace, you only include the libraries you need.

"You're not going to get closures, classes, meta programming, etc, etc, from libraries in C. And guess what, PHP has libraries too!"

While C has no syntactic support for closures and classes, C programmers learn how to build them from scratch (or use some other person's library to support that - after all, C++ stated as a preprocessor that generated C code). Are you sure you are familiar with C?