

Ask HN: Moving Beyond PHP for the Problem Solving Programmer - ChikkaChiChi

I am a single programmer in a small business that currently uses PHP (w&#x2F; PDO) to (mostly) read from MySQL and MSSQL databases and output HTML&#x2F;JS.<p>PHP is easy for me and I can write good, fast code. I start to hate the language when I use external code or frameworks. If there was a &#x27;one right&#x27; way to do PHP, I&#x27;d be fine.<p>Over the past year, I&#x27;ve been toying with the idea of moving to Python, Go, or NodeJS. Each has their plusses and minuses, and I am paralyzed in making my decision.<p>I am just one guy, trying to solve problems. I understand the &#x27;right tool for the job&#x27; philosophy, but each of us has that one particular screwdriver we REALLY like to use.  Imagine yourself as that rep in Lowe&#x27;s and please share with me what you would choose if you were in my shoes and why.
======
gesman
I been in exact same position recently.

PHP is the language allowing to craft something quick and crappy and making
"it" to work on any platform it is easy to get lazy with this.

I found myself I stopped growing with PHP.

Quickie, interpreted languages for "hit and run" projects are not my stuff.
Spiritually it is not mine.

I used to do lots of high performance, multithreaded, backend apps coding in
C++ before. So I decided to switch to .NET / C# platform. Love it. It's
secure, it's fast, it's enterprise supported, it's has the best development
and deployment tools on the market, it's fully cloud ready. It's strongly
typed (no RoR junk like: "cat ran on my keyword and I successfully deployed it
to production" any more).

It's convoluted, it's overly complicated and it more and more poorly
documented but I having fun with it. It gets the job done.

------
Jemaclus
I'm in the same position. I actually decided to learn Rust ([http://rust-
lang.org](http://rust-lang.org)), which is a compiled language not unlike C.
It's relatively new (version 0.9).

The main reason I enjoy it is that it forces me to think about problems in a
different way than I'm used to. Rust is a typed language (with some type
inference going on), and it doesn't really have arrays like PHP does, so it's
a real challenge to solve problems in it.

For instance, I've been going through Rosetta Code
([http://www.rosettacode.org](http://www.rosettacode.org)) and trying to
implement anything that sounds interesting in Rust. So far, I've done
levenshtein (built into PHP), lzw compression, fibonacci sequence, MD5 hashing
(built into PHP), quick sort, bubble sort, binary search, binary trees, etc.
It's a lot of reinventing the wheel, but it's made me think about programming
differently.

An example of a real-world result is that in my day job, I have an app that
processes 10,000 items in 5 minutes. It takes that long for various reasons,
but I decided to re-implement it in Rust. Using the exact same algorithm, Rust
completed the task in 60 seconds -- that's 5x faster! But while I was working
on it in Rust, I realized that I was doing some things inefficiently, so I
reworked the algorithm in Rust. Once I completed that, the entire task took
250ms (!!!). I decided to port that algorithm to PHP, and my new version
completed 10,000 items in 1.4 seconds.

Going from 312s down to 1.4s is a huge deal, and while the new algorithm
doesn't solve all the edge cases that the old one does, it's good enough that
I can use it and compensate for the differences later. I can process those
10,000 items in 1.4s, and then spend 30 seconds handling the 300 that the
algorithm didn't catch.

Anyway, I digressed a bit, but I picked Rust, and I don't regret it. I suspect
I would have had similar successes had I used C or C++ or Java, too.

------
workhere-io
Flask ([http://flask.pocoo.org/](http://flask.pocoo.org/)) plus SQLAlchemy
([http://www.sqlalchemy.org/](http://www.sqlalchemy.org/)) is a really good
combination. I find that former PHP users often like Python's syntax.

------
ChikkaChiChi
My current objections:

Python - GIL seems like a big deal for future concerns and Python 3 doesn't
seem that much 'cleaner' to write than Golang.

Go - Really new, virtually everything available on Github is still alpha (e.g.
Revel). Plus, is it really meant to be a CRUD-like web language?

NodeJS - Javascript everywhere would be nice if I never had to go back and
modify my code, ever. Just really tough to grok after I've been away from
something I wrote in the past.

