
PHP: the quiet powerhouse - lucperkins
http://blog.appfog.com/php-the-quiet-powerhouse/
======
techiferous
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 the perfect language for beginning web development for two
reasons: Direct HTML embedding."

Server-side view rendering is on its way out. So this is not a real advantage.

"I find it more than a little strange that PHP is simultaneously (a) out of
fashion, and yet (b) absolutely everywhere."

This is simply how technologies rise and fall. By the time a technology is
ubiquitous, the original problems it solved have changed and new solutions are
being created. Just because you have a bunch of legacy code running lots of
web apps doesn't mean it's the future--it means it's the past.

Also, why pick a language that pays poorly? Ruby is by no means inferior to
PHP, and you will get paid more per hour to program in Ruby.

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

~~~
snorkel
The seductive advantage of server side rendering is centralized control of
what all clients see. Whenever you push too much business logic down to the
clients you have to contend with how to ensure all of those clients are using
the same logic at all times.

~~~
ericingram
This is just a result of loose architecture. If your models are cleanly
abstracted using REST principles on the server-side, then server templating
becomes much more appealing.

I say this because I am doing it -- building apps with REST interfaces on the
server side. It's not a common pattern yet but I think this is where things
will actually go (as opposed to the client), because it's actually easier to
use, understand and iterate on.

If you can write Javascript templates that interface with your back-end using
REST calls like "GET /accounts", you can do the exact same thing in a server
side template with better performance and dramatically simpler security.

------
shuzchen
I don't think MediaWiki or Wordpress are good examples of how PHP scales.
Those are the two examples of extremely bloated pieces of software that
require a lot of hackage to get to scale. I've done deployments of those on
mid sized VPS'es and it's always a pain getting it responsive while still able
to hold a good number of concurrent connections.

The only way anyone gets Wordpress to scale is to put caching in front of it.
But now the heavy lifting is being done by memcache or varnish, not by
anything engineered into Wordpress or PHP.

~~~
jmathai
Any sort of scaling is a hack (not always bad). Good luck if you expect to
scale to Wikipedia or Wordpress(.com) levels without using external tools such
as Memcache and Varnish.

------
Killswitch
Here's an idea.. If PHP is so bad.. Don't use it. Simple as that. Let the
people who want to use it... There's absolutely very minimal things wrong with
the language. Everyone's quick to compare it with Python or Rails or something
else saying "PHP does this wrong that Python does right" well, if PHP did
everything the same way as Python, Rails, or something else, when what makes
it different? Who wants to use a language that doesn't have some severe
difference?

It's annoying seeing people waste their breath on arguing why PHP is so bad...
Especially when many people/companies have proven PHP is good and can be
scaled and used on high trafficked sites, yet 90% of the arguments are how it
doesn't scale.

Just because you have used Wordpress or built a quit todo app in PHP that took
you 5 minutes and that's the extent of your usage with the language, doesn't
make OR break the language.

Quit complaining and let PHP users use PHP, and you continue using whatever
the language you use is.

Signed, A Python, PHP, and Node.js developer.

~~~
andolanra
Some of the problems with PHP are things that are problematic or irritating to
development (e.g. its inconsistent standard library) but other things are
_actively dangerous_ to security and correctness. For example, in PHP,
'9223372036854775807' == '9223372036854775808' returns true.[1] Now imagine
those two strings are hashed passwords.

The overall problem is not with specific flaws of PHP; the problem is that
flaws in a language lead to errors in programs written with that language, and
when that languages is used to write some kind of web infrastructure, then use
of that language by people less than experts (i.e. almost everyone) is harmful
to the whole internet. PHP can be used to write useful, scalable, secure web
apps in the hands of someone who knows what they're doing, but in the hands of
someone who doesn't _quite_ know what they're doing, or who does but is tired
enough to miss individual details of their code, it is much more dangerous
than other comparable languages.

That is why I discourage the use of PHP if possible.

[1]: <https://bugs.php.net/bug.php?id=54547> (Both strings appear numeric, so
they are casted to numbers before the comparison, but because they are larger
than maxint, they are rounded down. The solution, if you really must use PHP,
is to use === instead. The fact that a solution exists does not mitigate my
concern.)

~~~
phibit
php > var_dump('9223372036854775807' == '9223372036854775808'); bool(true)

This made me cry.

~~~
Killswitch
Because in a real application people are checking to see if those lazily match
every 3 to 4 lines... Half of this stuff that makes the haters "cry" is
unrealistically used things.

------
warmwaffles
I enjoyed PHP. I enjoyed Ruby. If I was to do a complex project that would
require a lot of integration with external services, I would want a good OOP
language like python or ruby.

There are something PHP does nicely than Ruby does. Visa versa. However in all
the PHP apps I have made / used, their structures started out with good
intentions and then descended into pure chaos. There isn't a unified package
manager for Python and PHP that is widely accepted. Ruby has rubygems and
bundler.

Maybe next time when I start building another PHP app with namespacing, I'll
behave better and make my designs more decoupled so that components can be
removed and added, provided their interfaces match.

~~~
nickpresta
I would say that pip is regarded as the standard, unified package manager for
Python.

<http://www.pip-installer.org/en/latest/index.html>

------
testing12341234
[http://me.veekun.com/blog/2012/04/09/php-a-fractal-of-bad-
de...](http://me.veekun.com/blog/2012/04/09/php-a-fractal-of-bad-design/)

9600+ generally concise words on many, but not all, of the issues with PHP. As
a summary, PHP isn't "out of fashion" as much as people are tired of
continuously being misled and abused by their language of choice.

~~~
duskwuff
On that note, a physical metaphor for PHP which that post inspired:

[http://www.flickr.com/photos/raindrift/7095238893/in/set-721...](http://www.flickr.com/photos/raindrift/7095238893/in/set-72157629492908038/)

------
mgkimsal
"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 me and said, “PHP? What is this, 1920?”
This really, actually happened. I doubt it would’ve have happened if I had had
a Python or Ruby book in my hand."

Which... is even odder because some evangelists like to point out that python
and ruby are _older_ than PHP, as if that means much.

While I generally agree with the points, many PHP strengths are also
weaknesses. For example - "Direct HTML embedding." It's nice and easy, but
because it's so easy, it leads to unescaped output, and xss exploits and such.

PHP does let you as productive as you want to be _on the web_ , either with
raw PHP or with one of the myriad frameworks. The author's point that no other
language gives you that is, I think, another one of PHP's strengths (but yes,
is essentially a weakness in the wrong hands as well).

EDIT - have been using PHP since early 1996 - almost since its inception, and
have watched the criticism (and occasional _hate_ ) ebb and flow over the
years. That seems to be the only constant to PHP. :)

~~~
EternalFury
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 know how or want to program"), but
learning PHP conditional statements or loops is as difficult or simple as any
"templating" library that asks you to learn its exotic syntax.

Now, MVC is good and one should avoid blending presentation code with models
and controllers, but most MVC frameworks fail when they require you to
instantiate a gazillion extra objects, just to render a Web page.

~~~
mgkimsal
agreed on templating systems...

------
LnxPrgr3
There's no denying PHP's popular, but that doesn't mean it's the best tool for
the job.

Most of the arguments I see against it though are really problems with the
programmers using it. "Look at this horrible code I have to put up with! The
comments are inane and useless, there's no structure at all, and I'm stuck in
a chain of nested if statements 10 layers deep and I have no idea what's going
on. PHP sucks!"

As Jeff Atwood said, "sufficiently incompetent coders can write FORTRAN in any
language."

"But the converse is also true: sufficiently talented coders can write great
applications in terrible languages, too."

PHP wasn't exactly designed… it was formed, like a ball of mud picking up
various debris as it grew. It shows, too, especially if you've had the
pleasure of working with PHP 4. (I can only imagine what earlier versions were
like.) I can't for the life of me think of a language with more brain-dead
"reference" semantics. It's just bizarre. Their date functions miraculously
manage to be _worse_ than their C counterparts. I could go on and on.

But in the end, using PHP doesn't doom your project to failure any more than
using the current flavor of the week guarantees your success. Jeff Atwood,
again: "The only conclusion I can draw is that building a compelling
application is far more important than choice of language."

So why are we still comparing programming languages instead of writing code?

------
hoopscity
I think people are comparing apples to oranges. Ruby on Rails is as some have
stated, a framework, much like Zend or cake or CodeIgniter.

I think the author is spot on in this post. PHP is not without its warts, but
as a programming language for web development, it is scalabe, reliable and
robust.

Can you perhaps do things faster or more elegantly in other languages? Sure,
but writing good clean code is really in the hands of the developer. I can do
everything in python because its written in python doesn't mean that that code
is going to be designed well or scale well.

~~~
djur
"Scalable" and "reliable", perhaps. "Robust" actually means something, though,
and PHP is not it. Its wretched approach to error handling prevents that.

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

------
chaostheory
Back when all you had for choices were Perl, Java, and C++ it was easy to see
why PHP got big. However there are issues with starting out on PHP now:

1) It's really only meant for web development.

2) There are other languages now that are simple to learn, flexible (more than
just for web apps), and powerful (Python, Ruby, and now even Javascript)

Unless PHP has another major evolution, like its move to OO; (or unless I just
missed something else big) I just don't see the point of using it unless you
or your company been using it for years already. This article doesn't have any
real compelling arguments.

Maybe all of this will change once Facebook releases Hiphop VM AND people
actually start using it. To this day, I'm not sure why no one started using
Hiphop enmass and why people love using the inefficient eval method. O yeah
there's also an issue with PHP and logic dealing with concurrency, in that
there isn't a good way to distribute work within an app. Then again I could be
completely wrong.

~~~
mgkimsal
I've been working with PHP since 1996 and _rarely_ see eval being used. I've
worked with hundreds of companies training PHP developers, seen inside (and
written) some very large codebases handling millions of dollars of
transactions, and don't recall seeing eval in any of them.

"it was easy to see why PHP got big"

It's easy to see why it's staying big:

1\. cheap shared hosting to get started 2\. most hosts offer one-click
installation of any sort of application people need on the web (blogs,
shopping carts, calendars, social networking, file hosting, etc) 3\. 15+ years
of knowledge about what works and what doesn't when attempting to scale PHP to
large needs. 4\. ubiquity which keeps a large pool of reasonably priced talent
available, which perpetuates the cycle.

When there's a competitive language that can be placed in a directory as
FOO.abc, I can hit it as /FOO.abc and have it execute, with html content type
sent by default, it'll have a running jump at dethroning PHP.

The barrier to entry is the lowest out there, but the heights it can scale to
are facebook-level and beyond.

~~~
chaostheory
> I've been working with PHP since 1996 and rarely see eval being used.

For some reason most of the major frameworks use it, hence their
incompatibility with hiphop; then again I could be wrong.

> 1\. cheap shared hosting to get started

One can argue that all of the major languages have access to this. PHP doesn't
have an edge in this area.

> 2\. most hosts offer one-click installation of any sort of application
> people need on the web (blogs, shopping carts, calendars, social networking,
> file hosting, etc)

With the rise of the cloud hosts and automated config, as well as more
automated tools available (e.g. Chef, Puppet), this is a temporary advantage.
Deploying on Linode and Heroku and (insert cloud host company) are getting
easier and easier.

> 3\. 15+ years of knowledge about what works and what doesn't when attempting
> to scale PHP to large needs.

No argument here. My points only apply for people starting now, and not for
PHP vets.

> 4\. ubiquity which keeps a large pool of reasonably priced talent available,
> which perpetuates the cycle.

No argument here either. My points were being made for individual programmers
who are just starting out, and not for companies.

Even from the point of a company though, PHP's current lack of flexibility
lowers the chance of innovation imo. The other dynamic languages are just as
easy to learn and they just offer more than PHP does.

~~~
mgkimsal
>No argument here. My points only apply for people starting now, and not for
PHP vets.

I wasn't meaning for people - I meant 'the industry' as a whole (or a large
segment) - standing on the shoulders of giants and all that.

>> 1\. cheap shared hosting to get started

>One can argue that all of the major languages have access to this. PHP
doesn't have an edge in this area.

Really? I think there's far more options for people with 'PHP' in the hosting
arena. It's not that you can't use other languages/platforms, but ...
competition for hosting basic PHP stuff is massive - not so much for
Ruby/Rails, Python, etc. along with all the extra stuff you'd need (community
libraries and such) - much more is baked in to PHP hosting than you get with
the majority of other platforms. Java in particular is expensive to host
anything useful because it's RAM hungry.

re: eval - do you have pointers to examples? I just grepped Zend Framework
1.10, and there was _1_ eval, in Serializer/Adapter/PhpCode.php, with a
warning that it shouldn't be used.

~~~
chaostheory
> I wasn't meaning for people - I meant 'the industry' as a whole (or a large
> segment) - standing on the shoulders of giants and all that.

Ruby and Python aren't very new. There are giants there as well. If you're
going to make that argument, then Java has a bigger advantage.

> I think there's far more options for people with 'PHP' in the hosting arena.

As I've already said, I don't disagree. I just said that this advantage is
going away. Personally I'd also rather go for host that's mid-ranged as
opposed to hosts that are in the race to the bottom. I don't think paying $10
more a month is exorbitant especially if it buys you a lot of language power
and it takes over more sysadmin duties from you.

> re: eval - do you have pointers to examples?

Every major PHP framework uses it. How do I know? To my knowledge you can't
use any of them with Facebook's hiphop out of the box. I suspect this is one
of the main reason's no one uses hiphop even though it gives you a good deal
of performance gains for PHP.

~~~
mgkimsal
"Every major PHP framework uses it. How do I know? To my knowledge you can't
use any of them with Facebook's hiphop out of the box. I suspect this is one
of the main reason's no one uses hiphop even though it gives you a good deal
of performance gains for PHP."

Zend Framework 1.10 - a fairly high-profile framework - has _1_ instance of
eval in a component I've never known anyone to use. I suspect hiphop has a few
other issues with it, but... even more to the point, I don't think most people
_think_ they need hiphop. It's an unknown - it's a compilation step, and adds
a couple extra steps of complexity. People can get a lot of performance gains
by using Zend Server caching or APC with far less unknowns vs digging in to
hiphop.

Additionally, hiphop has had some issues with postgres/pdo, closures, imap and
more PHP stuff over the last year or so. It's a nice thing from facebook, but
it was written for their own problems, not as a general use tool for everyone.
If it can evolve in that direction, the adoption may go up. Until then there's
far more well-tested ways to improve your performance of PHP.

------
fleitz
The issue with PHP isn't that you can't make it do a whole bunch of things
that are wonderful...

It's why PHP would be the best tool for the job once you have a specific
objective in mind.

When you have a specific problem to solve other than 'supported by millions of
cheap webhosts' PHP is rarely the best choice.

It's like a swiss army knife, it's highly useful in many situations and a good
tool to have in your pocket, but if you know you're going to need to unscrew
something you should probably bring a screw driver.

~~~
malachismith
Well... of course you should always determine Use Case first and then choose
technology based on that.

------
raquo
_[off-topic]_ If PHP and Javascript are the only programming languages you
know, you _really_ should experiment with at least one or two others. It comes
easier than expected. For example, check out
<http://www.diveintopython.net/toc/index.html>. You can't know what you're
missing out on until you try something new.

~~~
jonathansizz
But if you already know PHP and Javascript, why not try branching out a bit
instead of learning Python, which is very similar overall? How about a lispy
language like Racket, or a statically typed functional language like OCaml, or
a 'big' mainstream applications language like Java?

~~~
raquo
That's the point. Python _is_ similar to php/js (which is why it's easy to
pick up), but in contrast to them it is extremely well designed (imho). You
suddenly understand how many of the quirks you have to go through every day
coding in php/js are in fact artifacts of these two inconsistent poorly
designed (imho) languages rather than programming as a whole.

------
spahl
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
used to be everywhere too.

~~~
lucperkins
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!

~~~
spahl
You can always build things with at scale, even with flawed languages (look at
javascript).

The thing is, why choose a flawded language when there are others less flawed
(nothing is perfect) for new code?

------
mschalle
I agree that PHP is good for starting learning web development and for small
sample apps, but from experience I really think that large-scale PHP
applications are not easy to manage. The codebase becomes disorganized very
quickly, and tracking down a piece of code's "hierarchy" (what it inherits
from, what methods it has available, etc.) can be a whole new kind of hell.
IMO, of course.

~~~
gouranga
All large apps are a pain regardless of the framework. It's called coupling.

Building your application as a series of small applications that work with
each other is a solution that has worked for me.

------
dansingerman
I have a few nits with this post, but am mostly irked by the comparisons
between PHP (a language) and Rails (a framework)

~~~
lucperkins
You're quite right that the analogy isn't perfect. The point I was trying to
make, though, is precisely that PHP development can proceed without any
recourse whatsoever to a framework. Jumping straight into web dev without an
accompanying framework like Rails or Sinatra is a complete non-starter if
you're a Rubyist.

So you're quite right, but I hope you would agree that the Rails/PHP
comparison, in spite of its imperfections, is compatible with the point I was
trying to make.

~~~
dansingerman
Yes, I agree. You make the point a lot better here than in your linked post -
i.e. with PHP, you can 'just start'. With Ruby you need to choose a framework,
understand enough about how it works, and where things go before you can even
start to do "hello world"

Although that is not necessarily a bad thing.

------
davidlumley
It's interesting seeing so many people defending PHP by suggesting that
because Facebook use it, it's good enough for anyone. From what I understand,
Facebook continue to use PHP because it's heavily embedded in all of their
systems, and they continue to develop with it despite other languages being
more attractive? ( see [http://www.quora.com/Why-hasn-t-Facebook-migrated-
away-from-...](http://www.quora.com/Why-hasn-t-Facebook-migrated-away-from-
PHP) )

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

------
drostie
"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 sophisticated ways if you wish."

I believe you have overstated your case, perhaps due to inexperience with
other languages. In particular, claiming that any modern scripting language is
inflexible sounds a bit crazy.

I have attempted explaining how to get a WAMP stack running, with EasyPHP, to
an absolutely new-to-web-dev indiviual who was curious about creating a chat
room. Let me just say that the situation is ten times better now than when I
was the same age and was poring, lost, over Bruce Eckel's _Thinking In Java_
trying to do the same thing, which must have been sometime around 1999/2000.

These efforts to teach a newcomer reminded me that there's a lot I take for
granted. There _is_ a step where you are saying "okay, we've got to see where
Apache is; what port is it listening on, how can we get you to phpMyAdmin;
here's how you set up rows and columns in your tables and think about a
database; no the reason it's not working is because you saved as '.html' and
not '.php'; I know you've seen URLs that don't end in '.php' but that requires
invoking the Rewrite Engine and teaching you about .htaccess files; oh the
header modifications can't be the first thing you emit; here's the docs, you
basically have to search them because there is no organizing principle and no
way to find out what you can do..."

I agree, Python+Django will make you learn a bunch of weird "modeling" stuff
first. To me, setting up the data model at the beginning of an app is like
inputting a character name at the beginning of an RPG: as some sources testify
[1], you can easily waste several hours on purely aesthetic concerns before
you even really start to play.

Nonetheless, Python+Django comes with a lightweight dev server and an
interactive console and a routing table, as well as a template language. The
knowledge of the database is internalized to the language, so that I don't
have to teach someone how to use phpMyAdmin but rather when to use a
ForeignKey. If we talk purely about _learning to develop on the Web_ then PHP
has much, much more useless overhead.

Sure, eventually we will have to get a production-ready web server
communicating with the application, but that can be abstracted until later
with Django: it occurs as an up-front teaching cost with PHP.

I say this not even as a Python aficionado per se. If anything I like Node,
and Node is nowhere near either of them in offering pleasant functionality.

[1] <http://www.cad-comic.com/cad/20030630>

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

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

~~~
lucperkins
1\. I wouldn't want to do anything at a meaningful level of complexity without
templates. No question about it. And I think that having so many templating
frameworks is wonderful (ERB, Jade, haml, etc.). I was only arguing that PHP
lets you dive in without NECESSARILY needing to jump through a templating
hoop.

2\. Is it unthinkable that a person could start learning web dev and pick up
the command line along the way? I started out learning PHP/MySQL on my old
Windows machine, terrified of the CLI, and now I do almost everything on it
(and have converted my old PC to Linux). If the command line were a barrier at
all points in the learning trajectory, then you might have a point. But I also
don't think that command line mastery should be held up as a sine qua non of
learning web dev.

~~~
spahl
1\. Ok so when is it appropriate/useful to use the power of embedded php (in
html) instead of templates? Just for learning the first couple of hello
worlds? In my experience it becomes a mess to manage when you start having
more than one commiter and more than a couple of lines of code.

2\. You don't have to be a command line expert to start using it. All the
books at <http://learncodethehardway.org/> show that command line can be
integrated in the language learning process seamlessly. No reason to be
terrified of it, on the contrary, new coders should embrace it as soon as
possible.

~~~
cloverich
@1. When the project is only a couple of pages.

------
snorkel
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)

~~~
gouranga
+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.

~~~
spahl
"gets shit done very very quickly"

In what way does PHP help to get things up and running faster than other
languages?

~~~
dr42
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"

~~~
spahl
Yes you can get up and running quickly with php, but my comment was mostly
about the fact that it is not much slower in other languages (most of the time
not slower at all).

And yes I did a lot of PHP but that was 5-6 years ago. I know things have
changed a lot since then but the language still has a lot of the same flaws.

~~~
gouranga
It is when you consider the deployment models, the development server setup
etc.

The language has as many flaws as it's always had but it still works.

------
brendoncrawford
> _But I also think that it might be the best language to use in gaining an
> understanding of the fundamentals of web development_

OP admittedly has less than one year of web development experience. Perhaps it
would be wise for OP to gain a more thorough understanding of web programming
before coming to conclusions like this.

~~~
lucperkins
I use words like "might" very intentionally! And yes, right you are that my
conclusions about things might change radically. I'm already appalled at some
of the things that I thought even weeks ago...

------
cafard
I will simply point out that one can do a good deal with a little code using
WSGI. As for templating, Python has for some time had very handing formatting.

------
narrator
PHP is the broken english of the Internet. Easy to learn, practical,
inelligant, ad-hoc.

------
guard-of-terra
You're killing kittens by using PHP.

PHP could be a wonderful thing if not for its original sins. It is easy and
fast, but it is also bad. It is "good enough", and for many years it prevented
just "good" from arising and gaining adoption.

I would pick "good" over "good enough" even if it costs me a bit because I
think this is fundamentally right.

~~~
lucperkins
But how often does trying-to-be-better-and-failing come along and torpedo
good-enough-for-the-job?

~~~
guard-of-terra
Would you listen to "good enough" music or watch "good enough" movies? When I
ask this, I think, many do. But I don't.

Do you?

~~~
lucperkins
No. Sometimes I spend a lot of time and effort seeking out niche genres and
digging through blogs and news sites to find "good" music. But sometimes I
don't want to put in all that effort, and then putting on "Kind of Blue" or
the first Weezer album is "good enough." There is room for both approaches to
music listening.

------
surrealize
Bleh. Would you call McDonald's a culinary powerhouse?

~~~
lucperkins
Culinary powerhouse? No. But it is undeniably a powerhouse in delivering food
consistently and reliably.

