

Ask HN: PHP coders, what's preventing you from changing language? - babarock

The flavor <i>du jour</i> today on HN come from a couple of articles describing the difficulties programmers have moving away from PHP, despite admitting that the language is somewhat broken.<p>I want to ask PHP devs on HN:<p>- have you considered moving away from PHP?
 - do you know any other language?
 - did you ever attempt writing a non-trivial app in something else than PHP?
 - what should be done to help you move more easily, if only by curiosity to see something else?
======
lhorie
From my experience, some things that tend to trip people up in transition
attempts:

\- choice paralysis - With Python, you must first decide whether you want to
invest in Django or Flask (or whatever). Then you get to decide whether to
invest in Mako or Jinja (or whatever). etc, etc. W/ Ruby, you have Rails vs
Sinatra. ERB, Haml, etc etc. In that sense, PHP is realistically more
"convention-over-configuration" than the competition (whether MySQL for data
persistence and raw HTML in templates are good defaults is a whole separate
discussion)

\- poor interop w/ real world - good luck convincing a client to sign up for
Node.js hosting. Or explaining that it doesn't come w/ wordpress (or phpbb or
squirrelmail or pretty much anything not-so-sexy-to-develop-these-days-but-
widely-used-by-non-techies.)

\- no measurable benefit - most levels of abstraction have comparable
complexity in all languages, i.e. using ERB or raw PHP (or Jinja, or mustache,
or whatever) generally take the same time and the same effort to
write/maintain - code debts come from other factors (e.g. team member
inexperience). In addition, most levels of abstraction quickly get cross-
ported between projects.

------
will_work4tears
I'd move away in a heartbeat. I don't HATE PHP, but I do resent being forced
into it. I also hate the CMS's my job makes me use - WordPress and Drupal
mostly, but often some custom stuff pops up.

Reasons I haven't:

1\. I can't relocate again. I did for a job that didn't pan out, and now we
have a home, a newborn son, and his grandparents moving out here (~2000 miles
away). Just not feasible.

2\. I'm up near Seattle and it seems all the Listed jobs are Microsoft
languages, Java or require a lot of experience. I rarely even see a Jr. Level
job and it is 3+ years experience when they show up. I have about 3 years
experience at the moment, with PHP though...

3\. I actually have a CIS degree, which is a B.S but isn't "true CS" as I
didn't go above Calc I in maths. My C exposure was one class in college, and
I'm kinda scared of C++...

4\. Maybe it's impostors syndrome but I don't feel qualified yet to be a
"real" programmer. I'm actually quite happy doing web development. There are
challenges, and my lack of education in algorithms and maths aren't really an
issue at this point.

5\. New son, wife, own a house, all of these really restrict my personal
project time. That and I'm really into weightlifting at this point, and I have
other hobbies, which doesn't help either.

Excuses? Probably, but it isn't that I'm unwilling to move away from PHP, its
that it is just not that convenient.

------
AjJi
"Moving" from a language is a laughable concept for me.

As professionals, we tend to work with many constraints in play, and one of
them, most of the time, is the language. It's not that the client requires me
to use PHP, but not using it will be a hassle for the client afterwards,
mainly, because of hosting and maintenance. Python and Ruby devs are quite
rare where I live, thus, using PHP enables the client to find maintainers
easily down the road.

Technically, I have no problem moving from one language to another (though,
never tried a functional language), and I've done professional work using ruby
in the past.

Frankly, reading HN discussions about PHP, I feel like they're missing the
point, or maybe, it's because I live in a country where PHP is prevalent -
there's a whole market here for PHP devs, I've been doing contract work for
almost 3years now using XHTML/CSS/JS/PHP stack exclusively, most of the time
with a framework, or even a CMS.

------
asher_
I think this question assumes a premise that many of the people that use PHP
would not agree with. For that reason, the responses you get may be biased.

I am a part time developer that uses PHP, and there are a number of reasons I
haven't moved off it for back end work. The first is that although it seems to
be the target of dislike from those working on the bleeding edge, it is as
popular as it is for good reasons. It has flaws, sure, but it is loads better
than it was a few years ago, and it will continue to improve.

There are usually two ways that people change something. The first is being
'pushed' - something being so bad you seek out a replacement, the second being
'pulled' - seeing something so compelling in another product you have to
switch. PHP isn't something that will push you away from it, I believe those
switching are being pulled to other languages because of whatever nifty
features they provide. In cases where you are working in established
development environments on established projects, the switching costs are
rarely justified for the marginal improvements.

I use PHP because it does everything I want it to, and its what I know.
Familiarity has a huge advantage and to sacrifice short term productivity for
possible long term gain is something that is easy to put off. Another thing
that I love about PHP is its ubiquity and how easy it is to get in to start
writing with it.

Fairly recently, I did seriously consider making the switch and giving two
other languages a month each to see how they worked for me. What actually
stopped me from doing this is that around the same time a lot of my work
changed from server-side to client-side programming. My back end programming
in my recent projects acts more like a simple interface between my client
software and database than anything else, so I have been doing very little of
it.

I have a few questions in response, and I ask these as someone genuinely
curious.

How big do you think the gain is between working in PHP and working in <other
language>? What do you think that other languages may be lacking that PHP
doesn't that may make people not want to move?

------
MattBearman
I'll move away from PHP when it can't do what I need it to do. Simple as that.

~~~
briandear
That's how I felt about my horse and buggy. I rode it everywhere until I took
an arrow to the knee.

~~~
hyuuu
a car and horse analogy, applies to PHP vs what language specifically?

Because PHP is pretty performant, especially if you have op code caching or
maybe even HipHop from Facebook that makes it even more faster.

~~~
fyolnish
It's not about runtime performance as much as programmer performance.

------
csaba
For me the biggest challenge is that at the company that I work for is too
strict in trying out "unknown" technologies. So I can only learn in my free
time. I don't really have any real project ideas in which I can try out my
knowledge, so I forget the most of what I learned a few weeks ago. I think
it's hard to change, when your job ties you to php. And in my country
(Hungary) anything other than php, or java for web development is pretty
unknown.

------
hyuuu
it's cheap, it's fast enough, it's everywhere, tons of
docs/examples/plugins/support. It just works. If PHP can't do what I want it
to do, then I will use something else.

------
Navarr
The thing preventing me from changing languages? The fact that there isn't a
fork of PHP that has fixed all the major complaints?

Someone was working on one. PHP is open source. It could exist. It could be
POPULAR!

But no.

------
timrogers
I'm a PHP dev who wants to escape. I'm trying to learn Ruby on Rails, but not
doing well. I know functional Ruby and a fair bit of JavaScript.

The main barrier to my leaving PHP is that it basically forces me to use OOP.
I want to use OOP, but I haven't got my head around it, and I'm yet to be
persuaded that it's worth it and I don't really fully get the benefits.

Materials on learning Ruby and other languages tend to miss out that jump,
which is the biggest one for me. Any ideas for getting me up to speed on OOP
fully?

~~~
csaba
Try this: <http://ruby.railstutorial.org/> (there is a free online book
version). I think this is quite good for start. At least it was for me.

------
ExpiredLink
I consider moving to PHP for small projects for which Java Servlet/JEE imposes
too much ceremonial overhead. I have never used PHP but I see that it is
widely used on the Web (
[http://w3techs.com/technologies/overview/programming_languag...](http://w3techs.com/technologies/overview/programming_language/all)
), esp. for CMS' ... and it seems to work quite well for quickly and
painlessly developing Web applications.

------
stewie2
semicolons and brackets

------
sohn5
The language may be somewhat broken, but it's very far from being broken
enough to be moving away from it.

