
Life After PHP - lemcoe9
http://s3.amazonaws.com/Blogger-log/index.html
======
polemic
As someone who also made the jump from _primarily_ using PHP to Python a while
back, I have to say that a lot of this is very trivial stuff.

Maybe my experience was different because I was already heavily using ORM's
(SilverStripe in particular) to build complex apps very rapidly, and moving to
Python+Django was a far more natural process.

> _"the fact that Django makes most of the decisions about how the database
> will be structured just baffled me"_

You define your structure with your model, so this is baffling to me. If
you're worried about trivialities like column or table names, you're worried
about the wrong things.

Anyway, I think that a bit of time with Django and you'll never want to go
back. I certainly don't.

~~~
dualboot
I thought I was the only one who used SilverStripe!

------
ibudiallo
So far I'm proficient enough in php to be able to do almost everything I want.
Your article is very honest. I never understood the php bashing. If you don't
know how to use a type of screw driver use a different kind, at the end of the
day the screw will be driven.

~~~
jmcdonald-ut
I became interested in computer science initially with PHP. It had a low
barrier to entry and worked rather well for solving the problems at hand. Now
that I've worked with C#, Java, C++, and Ruby I can say that PHP still very
much exists in my toolkit (and is used), but has become a tool that I rarely
reach for. The bashing that PHP gets, it often deserves. However, I've come to
accept that all languages have their pros and cons.

------
spdy
Interesting my experience was very different when i switched from PHP to
Django 5 years ago.

Everything just felt easier, many task where you had to repeat yourself got
abstracted away (forms) and the documentation was just awesome one of the main
selling points at the time and it still is.

The ORM took me a while to get used to it but after the initial hump i learned
it was very powerful and easy to use.

Overall my efficiency went up a lot i was able to prototype in days instead of
weeks for feature rich applications. It made me able to toy around with ideas
and the first time in my life i had this experience that i hadn't had to fight
the framework to get something i wanted.

And you can express yourself so much better in python than php and till today
i enjoy the community which is nice and helpful across the board.

~~~
pekk
Why is it that half of everyone says that PHP docs are so much better?

~~~
scotty79
Python docs have no clear indication what kind of parameters function takes,
what values it returns and what happens when it fails:

[http://docs.python.org/3/library/binascii.html#binascii.b2a_...](http://docs.python.org/3/library/binascii.html#binascii.b2a_hex)

<http://php.net/bin2hex>

~~~
buster
It clearly mentions that it returns a string and that data is binary data. As
everywhere in python, when it fails, it raises an Exception.

~~~
scotty79
Sure. Either it says it or it can be inferred from something. But it doesn't
have a consistent format. When I'm checking unknown function in PHP I know
exactly where to look for descriptions of behavior (also how it fails when it
fails and why) and information about type or arguments and return values. And
if I need real life use cases I can take a look at the bottom of the page.

In Python function description is often just unscannable short blob of prose.

~~~
buster
Like for example <http://www.php.net/manual/en/function.ming-keypress.php> :P

edit: I feel like the real life examples in the PHP docs are very nice, but
not really missing in Python (there are a lot examples in the Python
documentation but not for such trivial functions). In python you just start
the interactive interpreter and do "import module", "module.function(xyz)" and
you see exactly what's going on. It's then a copy&paste away from your shell
to your editor.

~~~
scotty79
I'm not saying that PHP docs couldn't be better or more complete. Some (not
only but usually less commonly used) modules are barely documented at all.

It's bit strange strange that you gave undocumented function as an example of
how PHP functions are documented. :-)

This difference between Python docs and PHP docs is just the thing I noticed
when I started having fun with Python which is btw awesome language though
finding which lib to use for given task sometimes is hard.

Good thing to do to find out what python function does is running
help(module_name.function_name) in interpreter.

~~~
buster
I'd say both documentations are very complete but take a different approach.
Very often the python standard library is very self-descriptive and it's just
doing what you would expect. If you're in doubt you can always start up
bpython and have an autocompleted shell. That python has an interactive
interpreter really is very convenient.

------
eberfreitas

      > Moreover, the fact that Django makes most of the decisions about how the database will be structured just baffled me – why does Django know better than me what the database should look like?
    

If that is really true (I don't have any Django/Python experience) the simple
answer is "It doesn't". In the long run, relying on the ORM to provide high
scalability is not a sane choice and I'm pretty sure Django must be able to
allow some flexibility on how tables and columns are defined according to your
needs.

The thing is that lately I'm finding myself unhappy with the idea of ORMs and
how they handle things. When I see that a framework has a lot of dependency to
some ORM, I get instantly unmotivated to learn more about it.

~~~
sluu99
"If your app is simple enough, you don't need an ORM. If you think your app is
complex enough to use an ORM, it probably doesn't do much good."

~~~
porker
Source please?

~~~
sluu99
Source: I'm a developer. :-|

~~~
powatom
"If you want to sound credible, wrap it in quotes."

\-- Me, a developer.

------
debaserab2
This entire article reads more like "my first Django app" then it does any
impressionable reason for discarding one particular language or framework for
another.

The lessons learned from this article don't really apply specifically to
Django or Python, but seem to represent an overall learning of how programming
languages can work in general.

------
metaphorm
If you're going to be doing serious django development it would do a whole
world of good to learn about the tool chain to make dependencies and
deployments super easy.

Use virtualenv, pip, and Python's own built in scripting tools (check out the
OS and sys modules of the Python standard library). Try to learn some of the
best practices before complaining about dealing with dependencies.

~~~
camus
yep south , fabric , the django console ,etc ...

------
buster
Strange read. That guy used PHP for years and seemed to have fully ignored
modern web development, he was baffled by using an ORM?!

To be honest, i would never contract this guy to do some web work for me (he's
is some freelancer of some sort? He mentions making tons of money with PHP).
Or any work. Really, who developed web stuff for quite some years and finds it
strange that not to write pure SQL statements? Or dependencies? He find's it
hard to deploy Django or node.js?

It reads to me like he has been living under a rock for years. And that's
probably the worst thing you can do in the fast paced IT sector. You need to
catch up and constantly learn new stuff to be up to date. I strongly believe
that to be a good developer/IT guy the most important skill is to be eager to
learn new things, to strive to improve yourself and learn, read, learn, learn,
learn.

I always hate talking to overpaid contractors/freelancers about technical
stuff and see how many people don't even know basic stuff. Talking about
node.js or NoSQL or puppet or ansible or other "new technology" and be greeted
by ignorance. And then i think "And this guy earns 100$ an hour and has a
dozen certificates!?".

~~~
lemcoe9
I make more money in one week with my full-service IT firm that you could
imagine in one week of development.

Don't even come in here saying that I have been living under a rock. I am the
owner of my company, on the board with three more technology companies and
also a director for a non-profit.

~~~
buster
Probably all true, but based solely on this blog post i still wouldn't hire
your IT service super company, blabla.. (to be clear, i have seen enough guys
calling themselves CEO of a one man limited or whatever, i don't care for
titles or how you are on "the board" of three firms, i'm a tech guy, not
someone that is impressed by titles or certificates.).

Edit: Still kudos to you, for running a business at that age, respect for
that!

~~~
xauronx
I doubt he, or I for that matter, would want to do work for you anyhow, so
there's that as well. There are those who don't gauge the quality of a product
by the number of buzz words the technology stack contains. You should re-
evaluate your techno-elitism for your own sake.

~~~
buster
It's nothing to do with techno-elitism, it's to do with the fact that, as an
engineer, the most important skill you need to have is to know the right tool
for the right job. If you only know about a very limited subset, you're doing
it wrong. There is nothing wrong with using PHP for the right job, or whatever
else. You still should make an educated decision and not just use something
because you don't know better. I give a damn about buzzwords and find many
things very questionable when it comes to the latest and greatest in the
interweb.

Edit: In the end i feel like i have to justify my post more then i want to.
It's not that i hate that guy or that i think he is a bad programmer or a bad
person or whatever. I was just surprised to read that someone who has been
coding PHP for 7 years never used an ORM. I imagine that most people that want
to learn "web programming" start with a framework that includes an ORM. He
surely has a big benefit over "competitors" who only know ORMs and never cared
about the underlying SQL. That's surely not good as well.

------
onemorepassword
Seems to me that CodeIgniter to Django is a much bigger leap than PHP to
Python.

Or even in general, unless you're dealing with a language that has a
fundamentally different approach, frameworks constitute a much bigger learning
curve.

Especially if you're coming from a simple, lightweight framework like
CodeIgniter to Django. Much of what the author describes would also apply if
you go from CodeIgnitor to Symfony, even though it's still PHP.

------
coolj
> [Cloud hosting] leaves me helpless in the case of an outage

Not if you design your application correctly. HA is really not that hard to
do, in the cloud or otherwise, so that single points of failure (e.g., vm or
dyno outages) do not result in service unavailability. Also, consider that if
you're not building HA into your apps, you are still at the mercy of things
beyond your control with local physical servers. What if your upstream network
provider accidentally publishes a BGP route that sends all your traffic into
the void? Or, in a timely example, what if your authoritative nameservers get
DoS'd? Build HA apps, aim to physically separate key redundant infrastructure
pieces (built in to most big PAAS services and configurable in most big IAAS
services), and you'll have no worries using a cloud service.

~~~
porker
Can you go into more details? This has always worried me about hosting in
general - for sites that can't justify multiple servers, or the complexity of
setting up MySQL replication, what's the best approach for HA? There's a lot
of businesses that fall into this 'important and profitable but not that
profitable' range...

------
jasonlotito
> Django from CodeIgniter

Life after CodeIgniter.

~~~
lemcoe9
Well, I started with PHP, so I felt necessary to say I was moving on from
that.

~~~
jasonlotito
The point isn't where you started, it's where you are leaving from. Leaving
from CodeIgniter says a lot.

------
daGrevis
It seemed like I was reading the story about myself. I started to code very
early too! It was PHP and MySQL. First — no frameworks and libraries. Then —
CI (later Kohana, Fuel etc.). Then I was bored and I started to learn Python.
Time went by and I were a Django developer. So here we are. :)

P.S. Python is totally ready for web development. Django was released in 2005
and it's stable. There are other frameworks too. YouTube and, of what I'm
heard, half of Google is using it (maybe they are rewriting some things to Go
now). Ton of popular sites uses Python and Django too! When it comes to
deployment, I stick to Nginx that serves static or sends request to gunicorn.
It's stable and fast. :)

------
Dachande663
By the time he started praising Tank auth I was looking for the parody button.
And praising PHPMyAdmin? Has he ever once looked at the steaming mess that
thing calls a codebase?

~~~
xauronx
I think people are giving the guy a much harder time than he deserves, but the
praise of phpMyAdmin made me scoff. I hate that program.

------
reid
PHP was my first language and it helped me stay interested enough in
programming to stick with it. I commented on this a few years ago, and it's
now an ancient thread, but there's some good stuff in the history books:
<https://news.ycombinator.com/item?id=324578>

------
lucasjans
Why does this site look like a knock-off of Svtle.com, more specifically
dcurt.is?

~~~
powatom
It's using a WP theme called 'wp-svtle', so I imagine that's probably why.

------
coderyeti
Laravel!

------
urza
In some ways, Python is the new PHP :)

------
camus
great thing about NodeJS Ruby and Python is their interactive cli , which is
just mandatory imho , for testing language features , framework features ,etc
... The PHP interactive cli is too poor and something really should be done
about it. there are a few php-shell out there but they are not up to the task.
I hope php core developpers will do something about it.

