
Ask HN: Please tell us how you started a project in PHP and are sorry for this. - zebra
And if you have to start the same project again what would be different and why?<p>I&#x27;ve invested over 10000 hours in PHP and I want to know whether to invest another 10000 in some other language and what are the alternatives.<p>There are lot of opinions in the wild but I think that opinion supported by example is much better than just &quot;I like X and dislike Y&quot;<p>edit - some grammar
EDIT 2 - To be more precise - I am not looking for a brain teaser, but for a tool which will allow me to be 1.5x (or 2x or 3x) more productive. I am looking for a tool to feed my family and myself in the next few years. To be honest I am a little scared of all &quot;PHP sucks&quot; articles. I don&#x27;t want to be jobless in 3 years when&#x2F;if PHP becomes the new COBOL.
======
interstitial
Never fear, some the nastiest, unmaintainable code I've ever seen is written
in Rails. There is a conspiracy of silence among the Rails gurus that is
utterly dishonest. Your self-doubt plays into their hands. Just watch, 10
years or less from now, all the mature programmers will confess what utter
folly their "Rails Period" was now that they moved on to Programming Language
Awesome 4.6

~~~
subsection1h
> There is a conspiracy of silence among the Rails gurus that is utterly
> dishonest.

Please name these "Rails gurus". 100% of the experienced Rails developers
whose blogs I follow have complained about old Rails code bases they've worked
on or have encountered.

------
gexla
10,000 house seems like an awful big investment for a plan B. Granted, much of
that time will be paid for, but you would still need to spend a lot of time
learning the plan B. That then leaves one skill on the side while you are
using the other skill. Again, not the best investment.

As a solid PHP developer, if you aren't as solid on the front-end, then that's
a great direction to go. An ace HTML / JS / CSS developer will have no problem
finding work, especially as the front-end gets more complex and gets asked to
do more. This would be a great enhancement to your tool-set rather than a
replacement.

Otherwise, I would be looking at things which could bring in an alternative
income. For example, you could build an add-on for Wordpress which you could
sell while also boosting your profile in the Wordpress community. You may not
want to do Wordpress work, but that could be another source if your other
sources dried up.

There's lots of other things you could do also. The possibilities are endless.
You should try to break out of your comfort zone of doing dev work to bring in
other sources of income.

I can sense the fear, uncertainty and doubt in your post. You should embrace
the chaos, kick your creativity into gear and try some different things. Chaos
and change is good, it shakes things up and creates new opportunities.

------
Jemaclus
As a PHP dev (8 years), I can honestly say PHP is an ugly language. But it
gets the job done. And I'd say with 10K hours under your belt, you can do what
you damn well please. Feel like spending another 10K hours in PHP? Go for it.
Wanna learn C or Rust or Scala or Python or Ruby? Knock yourself out.

I personally am a fan of diversity (master one skill set, then another, then
another). Unless you're doing cutting-edge work, you're probably at that point
where your diminishing returns are close to zero, so you might as well learn
something new.

~~~
meowface
Agreed.

There's no point in rewriting any current projects in another language, but I
think it would be wise to start new projects in languages that aren't PHP.
Expand your horizons and all that.

Nowadays I only use PHP if I'm testing something briefly or just need a really
simple script; kind of like the bash of the web.

------
mik3y
I've done some dreadful things in PHP. And Java. And Python. And C. And more..

The problem has never been the language, but rather the software's
organization and architecture (or the lack thereof). You can make mistakes in
any language, some just make it a little easier for you. Such as PHP's
notorious ability to mix code and HTML in the same file... the horror!

Before contemplating a language change, you might want to think about ways you
could improve your architecture, development practices, and code hygiene.

~~~
collyw
Looking for jobs, hardly any ever mention architecture skills, and I have
never been asked about them in an interview. Shame, because thats where I see
my main improvements after 10 years in the industry.

------
rowanseymour
I deeply regret choosing PHP for a dictionary website that I wrote 5 years
ago. The trouble is that I've moved on as a developer. Mostly everything else
I write now is Java or Groovy. I used to be ok with PHP's quirks but now I
find my old PHP code so painful to look at that I generally don't and have
pretty much given up development on that project with the vague hope of one
day having a free month to rewrite it from scratch in something else.

Don't see your hours with PHP as a waste though. It's important as a developer
to try different platforms and languages so you understand the pros and cons
of different approaches.

------
samcasas
I'd like to say something, stick to PHP. PHP is a very neat programming
language; I recommend you to read about Composer and PSR standards, but if you
want to learn something different, try with Python or Ruby, both languages are
kind of similar, hope it helps.

------
ryan-allen
You wont be jobless in a few years even if you continue writing PHP. So don't
worry. The scare tactics are nothing but marketing usually. When Rails was
initially marketed DHH used Java as a scapegoat. Ironically the Java stack
traces he posted as proof in the early days of Rails have nothing on the
monstrosities that exist in modern Rails apps.

I would recommend playing around with some other technology though, not so you
can move to greener pastures but to just get a taste of what else is out
there. Front-end stuff like Angular and Ember (which require some knowledge of
HTML/CSS and JS, which as a PHP guy I bet you would have). Tools like these
may slowly make backend technology less differentiated on the small to medium
scale as time goes on, so you can't go wrong with investing time in frameworks
like these.

Coming from PHP, and probably knowing some JS, have a bit of a look at Node
(and Express, to get started), the concurrency model is different enough from
PHP. Or even have a look at (gasp) ASP.NET MVC. I don't think that tech gets
enough love these days. Try using Heroku with Rails and then go and try and
use .NET with Azure. You'll be surprised at how much more responsive Azure is
by comparison and you'll be enamored with the tight tool integration.

Either way, there's nothing to worry about. There'll still be heaps of PHP
apps to maintain in your lifetime. It might make it harder for you to jump
into some fancy new start up, but if you don't wear a cap backwards and have
skinny jeans you wont get a job with the cool kids anyway.

Set aside a couple of hours a week to explore some alternatives and see how
you feel within 3 months.

~~~
zebra
Thank you for your encouragement. Yes, you are right, I know JS and I think
that time_invested/result coefficient will be highest with Angular and Node.

------
frevd
I'm a C# veteran and have programmed for more than a decade. I started PHP
last year for a project, and I must say 5.4 is quite rich in features (it's
also very weird, agreed, but nothing beyond any control, the docs are great).
It's astounding how much more productive you can be with PHP and its library,
compared to ASP.Net for example. The libary is greatly grown (besides being
impossible to remember it is the fastest way to use global functions for
standard stuff and classes if you need custom implementation). You won't
probably find any language more productive than that. If you're aiming for
becomeing more well-paid as a specialist, web programming won't get you too
far though, unless you have great back-end qualifications for special-purpose
architecture. You could look into unity3d for a change (C# or Javascript). The
only language that you must know in 3 years is Javascript. You should be
proficient in it, since more and more moves into the client and cloud
callbacks vs. serverside processing.

------
jeffmould
IMO - if you are starting a project as a business, go with what you or your
developers are most comfortable with. If for some reason you need to change
down the road then so be it. There are plenty of sites that are highly
successful that have been built on PHP.

On the other hand, if you are building a project to learn from, or for
personal reasons, then take the time to start learning a new language.

This is not to say you can't invest time in another language to build a
project in a different language. There may be reasons where PHP will just not
cut it.

So to answer your original question. There are no projects I am sorry for
building in PHP. However, there are projects where I look back and say I wish
I had taken the time to learn a different language. Those projects tend to
fall into the second category and I was just too lazy to take the time to
learn something new/different at the time.

------
zebra
Thank you people!

My lesson: I will stick with PHP and learn more about organization,
architecture and best practices. And Composer and PSR.

~~~
ssijak
You have 10k hours of php under the belt and have not used composer much?

~~~
dangrossman
Composer's what, barely 2 years old? You can have 10 years of PHP experience
and not have used that specific tool much, yes. It's not the first PHP package
manager.

------
bsaul
I would recommend having a "back up" technology just in case. Try to go for a
quite different language/technology that is more "hype" (objective-c, nodejs ,
f# , scala, haskell , golang, python, whatever). _Nobody knows for sure what
the next trend will be_ , so just cover yourself. You don't need to switch to
that new tech full time, but just enough to be able to answer a few quizz
question with it in interviews.

------
nhmit
Sorry I have to answer this way, but if you spent that amount of time in PHP,
how come you don't know the answer already?

To answer your question: Whether it be PHP or Python or Ruby, you will need to
work hard. Advice if you stick with PHP: Get the Zend's PHP and ZF
certificates. Apply for job after that. You won't be jobless in next 5 years,
and you can expect quite a good salary.

------
bobdvb
10 years ago I was working at a European telco, they needed a way to monitor
traffic flow on customer connections but the tools that existed didn't work
for half the population. So, given that I had paid my way through college
programming the bosses gave the task of scoping the project to me (a
communications engineer).

I looked at the available tools, got a price for a very expensive commercial
tool, and got a price from an independent programmer to use rrdtool and build
a custom tool. I wrote a paper which set out the options in a paper for
management, explicitly saying it should be a fixed price contract with only
supervision from our team, no effort.

The Engineering Director came to me and said he had a contact at another
company, they already had a solution that would be suitable and they would be
paid (by the hour) to adapt it to our needs. A month later they arrived with a
Cisco PIX firewall, two HP Xeon servers and a pile of PHP and Perl code.

There was supposed to be two days of training and some integration. It didn't
work. They had done nearly nothing and we had two weeks before the system had
to be ready. So I knuckled down, rewrote the entire thing virtually from
scratch and while learning PHP and Perl (I had exposure before but you could
see my evolution of understanding in different parts of the code).

Two weeks later we had an undocumented mess that actually worked. I left
shortly afterwards because I realised I might actually have to support this
spawn of bile. I think it was two years later that I got a call asking me why
it had slowed to a crawl. Given that my mind had blanked everything to save my
sanity I couldn't help. But I suggested they look to see if the filesystem was
full and to check the database. Apparently after a database and file system
clean-up everything worked fine. I don't know how long it remained in service,
but I fear it might still be functioning.

I know you wanted to opinions on different methodologies, but this is really
just me sharing my scars and explaining why I shouldn't be let near code. ;-)

------
tiquorsj
I build products and I ship. Regardless of the language I've built beautiful
things. Under the hood, in each of the ten languages I've used, there is
always something I would improve. Knowing that is one way I get better at
building products and shipping. Don't forget the goal.

------
gcb0
I published several projects in php. And i hated that i used the language in
vogue at the time to try to not use php.

What I'd done different if i were starting the last one now? I'd not start on
ruby, and would have went directly to php.

Btw, I'm starting one now in elixir. Cross fingers.

------
amerkhalid
I am myself heavily invested in PHP. And yes all "PHP Sucks" articles scare
me, and I have seen some of the worst code written in PHP. But I think PHP
should be with us for a long time. With modern frameworks like Laravel, we can
write great and easily maintainable code.

However, I still have Java as my backup language. I use Java for my side
projects. I think there will always be demand for Java because of heavy use in
big enterprises.

------
haney
I spent a few years freelancing as a PHP developer and then transitioned into
python for the last 3. It's fairly easy to transition between PHP/Python/Ruby
and I'd suggest getting a little bit familiar with similar languages. I know
that knowing a bit of all three has led me to be able to develop more quickly
and cleanly. Also, more diversity in your understanding would help with your
job security concerns.

------
troels
Good COBOL programmers are in high demand.

------
EGreg
I started [http://github.com/EGreg/Q](http://github.com/EGreg/Q) three years
ago in PHO, and it grew out of [http://phponpie.com](http://phponpie.com)

If I had to do it again I'd use node, but only for ONE REASON: concurrent I/O

------
gesman
PHP is great if you want to quickly craft and sell your own product (such as
wordpress plugin and theme) or service and sell it.

PHP is not great if you want to get hired by someone else.

Pay rates for PHP skills are the worst.

------
mesozoic
First of all you'll be fine as everyone leaves PHP because it "sucks" and all
of that legacy code needs to be maintained.

------
rickboyce
I started with PHP as a teenager, and ended up coding PHP professionally for
about 6 years. I'm certainly not sorry for it (:

I haven't touched PHP in a few years (C# and Python for work now) and since
really groking a other few languages I've come to the conclusion that, IMO,
PHP manages to combine some of the worst aspects of dynamic and static typing
to produce an ugly, confused language with gotchas that still haunt me.

But none of that matters - management, directors, clients, whoever care about
results and productivity. They don't exist inside of the tech-hype bubble.
People want a certain feature set, at a certain cost and within a certain time
frame. They certainly won't rewrite their massive code base from PHP to start
again in new-shingy-x, when they could be adding more value to an existing
solution.

As much as I dislike PHP, I was amazingly productive in it. The systems I
developed where way ahead of their competition just because I could iterate so
rapidly. (It turns out I am even more productive in Python than I ever was in
PHP, hindsight 'eh!)

You mentioned COBOL - there are a world of COBOL jobs out there (this is the
first page that came up in Google [http://www.jobsite.co.uk/cgi-
bin/advsearch?search_type=quick...](http://www.jobsite.co.uk/cgi-
bin/advsearch?search_type=quick&location_within=20&fp_skill_include=COBOL&location_include=)
) The fact that COBOL hasn't been cool for a few decades doesn't change the
fact that there are masses of applications still running it across the world.

In your post you didn't say anything about disliking PHP, you said your scared
of yours skills becoming redundant. Don't be - there will be vast amounts of
PHP development going on in the world for decades to come, it isn't going
anywhere just because the next big thing arrived. It just won't be cool and
discussed at length on the internet anymore.

If you focus on being a skilled programmer instead of a coder who only works
in PHP then you won't have trouble adapting your skillset. Make a point to
really understand how what your developing works and why. When I picked up
Java and C# after PHP I was productive in those languages within a few days -
they are not that different at all. After a few months you will have learnt
the idioms of those ecosystems and be well on your way to being fluent. A
great programmer can produce great code in any language, a poor programmer
will produce poor code in any language.

I do think it is really valuable to pick up a new language now and again, I
always learn something that I take back to whatever I do day-to-day. It sounds
like you work in web development at the moment, so maybe stick with something
along those lines. Expert Javascript developers are so hard to find, I always
find them the hardest to recruit for! It is a challenging language - everyone
seems to 'know' it at some superficial level, but make an effort to really
understand its idiosyncrasies.

Much more important than anything I've said above - developers have very
personal, often very strong, opinions about programming languages. Take them
all with a pinch of salt - programming languages don't matter nearly as much
as we think they do. Play with a bunch of languages and then focus on a few
the few that you really take to - quickly you will find something that you are
passionate about enough to want to put your next 10,000 hours into.

~~~
tostitos1979
I'm curious about your productivity in PHP vs. Python. Is this for web apps?
What aspects of the language do you like vs. PHP? I'm a Python person but
thinking about getting into PHP to utilize symfony2 features. Will I be going
backwards?

------
wushupork
I'd love to hear Mark Zuckerberg reply to this.

~~~
meowface
I find it interesting that Facebook preferred rewriting the entire PHP
interpreter to make code execute faster, rather than use another language.

Also, if I'm not mistaken, the very initial versions of Facebook were written
mostly in Perl, so it's not like Zuckerberg was stuck with PHP since day 1.

~~~
coralreef
AFIAK it was never written in perl. An anecdote from the facebook effect is
when Dustin Moskovitz wanted to work on FB. He went home and learned Perl, to
which Mark replied "dude, the site's not written in perl".

[http://books.google.ca/books?id=RRUkLhyGZVgC&lpg=PA34&ots=LR...](http://books.google.ca/books?id=RRUkLhyGZVgC&lpg=PA34&ots=LRY_e0qfdp&dq=the%20facebook%20effect%20perl&pg=PA34#v=onepage&q=the%20facebook%20effect%20perl&f=false)

------
elwell
Have you considered implementing HHVM?

------
dschiptsov
Ask Facebook.)

hint: hhvm

