Hacker News new | past | comments | ask | show | jobs | submit login

I was pretty anti-PHP before I worked for a multi-billion dollar company that was built on top of it. It's not a beautiful language, but it offers a lot of side benefits in terms of dev-ops, and tooling, and frameworks. As a company, the language was not something that held us back. The company moved really fast, and PHP was a large part a big part of why. In my career over the past 14 years I've done web work using ruby, python, C#, javascript, and Java. but that ugly PHP site was the one that impressed me the most. People moved fast in it, our tooling never held us back, everything just worked. It was the most utilitarian environment i've worked in. The first time I touched PHP, it was a spaghetti disaster... but today, next to python It's my go to language. It gets the job done faster, and it's maintainability is just fine. It really doesn't matter if sometimes things just look odd.





I have to echo this.

I worked on a data pipeline that was a mountain of PHP scripts bolted together with Bash and it was such a breeze to maintain. Using Symfony ensures that every command is well documented and consistent in design and use.

Something I never appreciated about PHP until recently is that character encoding is so much more robust in PHP than other languages. We were forced to replace our pipeline with Python because of a combination of "Eww, PHP" from new management and "data scientists use Python." Character encoding was a huge, unexpected annoyance.


Which version of Python? I ask because making fundamental changes to character encoding was the single most disruptive feature of the Python 2/Python 3 split.

> character encoding is so much more robust in PHP than other languages.

This is not what I expected -- my limited past experiences with anything outside of Latin-1 using PHP have been perplexing and not smooth (and I generally like PHP well enough). Can you elaborate on what features or approach can make things robust?


PHP doesn't care about your encoding. Therefore it's simpler to work with any encoding in it, because you're managing it manually.

Most of this would apply to Perl, as well. Which I can't fathom why Perl didn't easily beat out Python in the data science world. It's incredibly stable (version 5, that is), fast, and can just about rip apart and parse any raw data you have with ease. Python may "feel" newer, but there are only a few years age difference. Even Ruby isn't that much newer.

Tragically, Perl developed its "unreadable" reputation because it was the language du jour of the system admin/hacking world. The first time most people experienced Perl was by finding some crufty old script that glued a bunch of shell tools together haphazardly. Few developers today have actually seen what good, production Perl can look like.

No disrespect to the wonderful system admins of years past, but those guys were a different breed. They weren't programmers. But Perl still let them get their job done. Their unmaintainable messes caused a great deal of harm to Perl.


I maintain others Perl code and am no expert. Its our most use web tool and has been running for 10 years. I think Perl is different enough to confuse people who look at it (@,%,$) and it can make it hard to follow. I still have a little problems switching to it from other languages sometimes (do x unless y seems backward to me). I've also been told I write perl like a c programmer. Perl does have some beautiful parts though..

CPAN is great, but its hard sometimes when I just want to install something easy. It was the first great shared library and it shows its age a bit. Last time I ran it, it was compiling C code for some strange reason. We have trouble setting up shared perl environments, something we don'e have with python.

Biology has a lot of Perl code still, but it seems to moving to python.

Terrible code exists in many languages.


I appreciate you sharing this. The goal of my post was not to convince people to "switch to PHP right now", but rather to tell them you can do pretty cool things with it, and that it's actually fun to work in.



Guidelines | FAQ | Support | API | Security | Lists | Bookmarklet | Legal | Apply to YC | Contact

Search: