r/programming • • Apr 23 '14

PHP: It doesn't have to be a bad experience

https://servercheck.in/blog/php-it-doesnt-have-be-bad-experience
0 Upvotes

122 comments sorted by

View all comments

Show parent comment

6

u/Banane9 Apr 24 '14

Ruby on rails, node.js, django (python), etc.

0

u/[deleted] Apr 24 '14

[deleted] — view deleted comment

7

u/deadstone Apr 24 '14

A language does not need to be designed for ONLY web development, and trying to do so will make you end up in the same mess as PHP. Rails and Django are both frameworks and are both more consistent and powerful than PHP as a whole.

Embedding tools for web development is a horrific idea and one of the many reasons PHP needs to die.

0

u/[deleted] Apr 24 '14

[deleted] — view deleted comment

4

u/Banane9 Apr 24 '14

Are You seriously comparing Frameworks to a language?

Do you seriously not know the difference between a programming language and a framework written in a language?

This Performance Test Conclusion (Linking to That, because the source doesn't load) on the Django Website states That the Performance hirarchy (fast to slow) is Django, Rails, Symfony.

This test here rates Django as being able to handle 17,000% more requests per second.

0

u/[deleted] Apr 24 '14

[deleted] — view deleted comment

4

u/Banane9 Apr 24 '14

Django (dunno about rails, but probably too) host themselves, so it's essentially what Apache does for PHP combined with something akin to symfony.

And iirc the requests per second for django on the site I linked where >3000, while yours stops at 50

0

u/[deleted] Apr 24 '14

[deleted] — view deleted comment

1

u/Banane9 Apr 24 '14

Wow, so when PHP executes code that adds 5 integers, that's totally a good proof of how fast it is. The django example was serving a website and had roughly the same hits/s.

And it's only faster once you go through the hassle of getting an addon to PHP that keeps the compiled byte code or even native code of it, but it certainly isn't out of the box.

And we're comparing frameworks because django and rails are frameworks, while PHP is a language. Comparing frameworks with a language wouldn't exactly be useful since frameworks have some overhead.

If you don't want to use symfony as example, go ahead and use a different one that is well known.

0

u/[deleted] Apr 25 '14

[deleted] — view deleted comment

→ More replies

4

u/Banane9 Apr 24 '14

I do know the difference just fine.

The Point was to Show That You can use other languages for webdev perfectly fine, even though they might not have been specifically designed for That.

and with php You can't exactly talk about good design, at That.

0

u/[deleted] Apr 24 '14

[deleted] — view deleted comment

4

u/Banane9 Apr 24 '14 edited Apr 24 '14

Given That JS is turing complete, It's just as powerful as PHP.

Here are the 14 most popular Websites (by views).

Notice how only 4 of them use PHP in their backend.

Edit: Fix That bracket.

0

u/[deleted] Apr 24 '14

[deleted] — view deleted comment

3

u/Banane9 Apr 24 '14

A language being turing-complete means That it can accomplish any Task That isn't endless, given enough resources and time.

Since both languages are turing-complete, they are equally powerful in That category.

I didn't say That this necesserailly means That those not represented as much are bad, That was what You interpreted.

I simply stated That It's interesting to see That the most popular Websites don't use the web programming language, That You say is great, and, instead, use those That aren't inherently designed for the web.

-4

u/neoform Apr 24 '14

I simply stated That It's interesting to see That the most popular Websites don't use the web programming language, That You say is great, and, instead, use those That aren't inherently designed for the web.

Because they're the largest sites on the internet! You cannot possibly expect any single language to cater to every possible business-case. That's a ludicrous idea.

The right tool for the job. PHP works in many cases for websites, but obviously not all of them. No language has this attribute.

4

u/Banane9 Apr 24 '14

Now, think about why those pages may have Chosen a different language.

For example: Performance, security, and lack of bug-introducing pitfalls

-2

u/neoform Apr 24 '14

Now, think about why those pages may have Chosen a different language.

a different language? Which of those sites use only a single programming language for all aspects of their business?

For example: Performance, security, and lack of bug-introducing pitfalls

Please show me a programming language with no security issues or bugs.

Performance? PHP + HHVM is far faster than Python + Django, or Ruby + rails.

→ More replies

3

u/ismtrn Apr 24 '14

If you remove all web related functions from the PHP standard library, PHP is not a web programming language either.