Live data from Hacker News

PHP: the quiet powerhouse

blog.appfog.com

51–60 of 140 posts

Re: PHP: the quiet powerhouse

#51
post #42

"It’s been very interesting beginning my trajectory in web development in 2012... [PHP] might be the best language to use in gaining an understanding of the fundamentals of web development... No web development language outside of PHP grants you the kind of flexibility to both (a) produce genuine functionality from scratch, outside of an MVC framework, and also to (b) work within the bounds of MVC in deeply sophistic…

I certainly didn't mean to say that languages like Python and Ruby are inflexible!

What I meant to say is that you can't use either of them in direct conjunction with HTML the way that you can use PHP. This was what I meant when I said "genuine functionality from scratch." Would I prefer Python+Django/Flask for lots of use cases. Absolutely.

As for the "useless overhead," there are things like the command line (which Python and Ruby web dev absolutely demand) standing in the way of some of the other languages. Personally, I strongly prefer the command line for almost everything, but for beginners this is another barrier.

My argument was not for the superiority of PHP over other languages, but rather against its casual dismissal from consideration.

Re: PHP: the quiet powerhouse

#52
post #46

This does not justify chosing PHP for a new project. There are hundreds of examples that show how bad PHP really is. Why make the choice of using a broken language when there are so many better alternatives? I strongly believe that using a complex, non consistent and hard to debug language actually slows down development and is even dangerous. Being "absolutly everywhere" is not an argument. COBOL, PASCAL and FORTRAN…

No, "absolutely everywhere" is not an argument by itself. But sometimes ubiquity is earned.

If Facebook powered its front end using FORTRAN, I would call it a quiet powerhouse, too!

Re: PHP: the quiet powerhouse

#53
post #36

I've lived Ruby land and Python world for quite some time and I must say it's good to be back in home in PHP where getting things done doesn't involve clever semantics and tying yourself up in layers of abstraction. Oh yeah, and it's nice to read code that has comments explaining what the hell is going on too (seems Rubyists and Pythonistas don't believe in comments, you know, because that'd make the code too obvious…

As somebody who maintains and develops a commercial WordPress site as well as doing Rails work, my impression is the opposite: Rails projects tend to be moderately easy to follow while PHP projects tend to be composed of 10kloc balls of intertwined logic, state and IO with no comments aside from a healthy helping of:

    // $var = foo(bar);
    $var = baz(bar);
Perhaps we're both encountering a bit of luck rather than accurately assessing the two languages' ecosystems.

Re: PHP: the quiet powerhouse

#54
post #31

Earlier quoted context omitted.

> Server-side view rendering is on its way out. So this is not a real advantage. No it isn't, client side view rendering is just experiencing a faddish phase; it'll fade. It'll never overtake server side rendering on the web.

The realities of roundtrip time won't go away. Serverside rendering will always delivers worse responsiveness. Blame physics.

History has shown that with time these numbers shrink, there will come a time when the difference is between two very small numbers and that won't be a factor. It almost is. A couple of years. 4G LTE for example.

Re: PHP: the quiet powerhouse

#55
> I think PHP is the perfect language for beginning web development for two reasons: "Direct HTML embedding" and "Straightforward file organization"

After thinking about it a bit, it seems that your reasons for suggesting PHP for beginners are about the same as the reasons people gave three decades ago when suggesting BASIC as a language for beginners, namely the norm of having GOTO and global variables everywhere.

Just as GOTO and global variables make it easy for a beginner to easily pick up programming, embedding raw code in your pages and having only one file organization makes it a lot easier to pick up web programming. And yet at the same time, all four are eventually shown to be "considered harmful" - the only ones who advance are those who are willing to abandon the first things they learn while the rest are doomed to mediocrity.

Now don't get me wrong, I don't think PHP or even BASIC is inherently bad (well, they are, but at least they're not MUMPS or Brainfuck). I just don't think teaching bad practices to newbie developers is a good way to promote a language.

Re: PHP: the quiet powerhouse

#56
post #2

"Dozens of new language-specific communities have now entered the fray and brought along their legions of devotees with them, and many of those devotees see PHP as being passé. I even had the following happen to me, and this is absolutely a true story and can be verified by our VP of Operations, Richard Kotulski: I was in an elevator with O’Reilly’s very good “PHP Cookbook” in hand and an older gentleman scoffed at m…

With regards to "Direct HTML embedding."... PHP is a Web scripting language (which I consider to be very different from a general-purpose programming language or even a scripting language), designed and developed to generate markup. I have seen a lot of "templating" libraries (Smarty among them) and all they do is mimic the basic syntax of PHP using something else that is not PHP. I know the theory ("designers don't…

agreed on templating systems...

Re: PHP: the quiet powerhouse

#57
post #42

"It’s been very interesting beginning my trajectory in web development in 2012... [PHP] might be the best language to use in gaining an understanding of the fundamentals of web development... No web development language outside of PHP grants you the kind of flexibility to both (a) produce genuine functionality from scratch, outside of an MVC framework, and also to (b) work within the bounds of MVC in deeply sophistic…

I certainly didn't mean to say that languages like Python and Ruby are inflexible! What I meant to say is that you can't use either of them in direct conjunction with HTML the way that you can use PHP. This was what I meant when I said "genuine functionality from scratch." Would I prefer Python+Django/Flask for lots of use cases. Absolutely. As for the "useless overhead," there are things like the command line (which…

What advantages does this "direct conjunction with HTML" have over templating solutions? Why do most PHP frameworks implement templates then?

Also, if command line is a barrier for an aspiring (web) programmer, he/she should start looking for a new career path.

Re: PHP: the quiet powerhouse

#58
post #48

Earlier quoted context omitted.

+1 for pragmatism. Despite the stigma attached to PHP, it's my go to language for web stuff because it gets shit done very very quickly. You can't beat drop file, edit, refresh and entire deployments which can be done with cp/scp and no process restarts.

"gets shit done very very quickly" In what way does PHP help to get things up and running faster than other languages?

Have you used PHP? Spend 5 minutes with it and you'll understand; a very expressive language, simple to learn, massive library of functions, massive number of examples to copy, no framework to learn, no syntactical overhead like in Java, practically everything works with, or has bindings for PHP.

I prefer to work in python, but I don't much care anymore, each language has it's strengths and weakness' but PHP most definitely is good for getting things done "very very quickly"

Re: PHP: the quiet powerhouse

#59
post #49

If you are just starting out as a web developer and aren't planning on changing careers anytime soon, the #1 language you should learn is JavaScript. It, or languages that compile to it, will still be in fashion in 5 or even 10 years. That's because the web is shifting to thick clients, and JavaScript is the only choice in browsers. JavaScript is also finding its way into server-side code (Node.js). "I think PHP is t…

"JavaScript. It, or languages that compile to it, will still be in fashion in 5 or even 10 years." How in the world can you predict what will be in fashion 5 and especially 10 years from now? "That's because the web is shifting to thick clients, and JavaScript is the only choice in browsers." How do you know that won't change?

It's hard to predict 10 years out, but not too hard to see 5 years ahead. Generally speaking, what's popular now existed in some form 5 years ago.

JavaScript has a monopoly as the only language that runs in browsers. If this were to change, it will take years, not months, for browsers to start supporting another language (or go to a bytecode model). Then it will take more time for developers to start using these new languages and then an ecosystem of tools and libraries to form around this. Then it will take even more time for the "old" language JavaScript to seem obsolete.

JavaScript is currently gaining traction and is the lingua franca of the client-side Internet, which is growing. This is why I predict it will still be strong in 5 years, because it's got a lot of momentum and I only see the trends as increasing (mobile devices are increasing, browsers are becoming even more like operating systems with memory management etc., JavaScript as a language is continually being improved).

Re: PHP: the quiet powerhouse

#60
PHP's problem is it's soul. I will make an analogy about this. My analogy will be local, but i will explain it so you can understand.

PHP is my university, Gazi University. It first established in 1926 as a Teacher Training Institute. Nobody knew that there will be a medical school or faculty of fine arts or even a faculty of dentistry. 1926 was the third of our newly established Republic and we needed teachers. So, Teacher Training Institute was born.

Our main campus is very small. Law School or dentistry school is not in the campus. Because, as i said, nobody knew we need them in 1926.

Ruby, C# and many other languages are METU: Middle East Technical University. METU was designed as a university. So, they got a gigantic land in Ankara (capital city of Turkey). They build all their building in there.

Back to the PHP: PHP was born to solve one problem. Just one problem. When they got another problem, they solved it and added the function or implementation in the language. PHP is not designed at desk, it was not "feature-complete" at version 1.0. It's still getting more mature as version numbers increase. For example we get "traits" in 5.4.

PHP is also Windows too (both Microsoft and PHP in a HN comment :) The most un-loved things in this community). Remember the video which a guy installs Windows 1.0 and successfully upgrade it to every version of windows with all his data and programs up to Windows 7? even doom from 1993 works! (http://www.youtube.com/watch?v=vPnehDhGa14) PHP is like Windows. I know the "parameter order inconsistency" problem too. But you can't solve it after this point of time. You just can't. Like windows, every program should work after the upgrade. There are millions of millions PHP sites. after a "apt-get update;apt-get upgrade" they should work.

By the way, sorry for my bad english.

Post reply on HN