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.
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.
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.
PHP is an awful language because it has tons upon tons of quirks... pretty much like Javascript. Sometimes, I am able to find it amusing that most of the web is built on them.
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.
Well, in CodeIgniter's defense, its documentation was pretty excellent. The problem, however, was the slow and tedious development cycle, which favored backwards-compatibility over new features with almost no exceptions.
Because of the comment thread at the bottom of each function page... people paste in a common error and how to solve it. The docs are good not because they're written better (though in some cases they are) but because of the user contributed content which the python docs lack. I wish the python docs all has a disqus thread at the bottom.
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.
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.
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.
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.
> 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.
ORMs seem to be great if you are doing prototyping, but most of my analysis tools have to be built against existing datasets or ecosystems. I'm either shoehorning in two databases from two separate architectures together or at the very least working with one that is populated by another tool.
ORMs fall flat on their face in these circumstances, and I'm left with having to fight against it in cases where it may be tightly coupled.
One of the biggest problems I have had with a lot of the cool new frameworks is that they make basic assumptions about how they will use them.
I don't completely understand the idea that ORM's are not scaleable. All they are is an abstraction layer that makes your life as a dev easier. With Active Record, Rail's ORM, I can do anything I would want to do with it. Just because you are not creating the database in SQL doesn't mean that you can't do complex things.
in my experience the general sentiment is that the ORM is a leaky abstraction because it's common to make performance decisions based on the ORM's peculiarities.
up to a certain size, most ORMs will behave just fine! the bigger problem is when your mental model of how the ORM should be behaving for a certain data access pattern is thwarted by the actual implementation. This usually only happens when you notice a performance bottleneck around a semi-exotic query that you know to be trivial in sql or whatever.
it's also possible to put up performance abstractions between you and that ORM bottleneck, but often the experience and tradeoff sours most people. i don't blame them, but i agree that for most day-to-day cases, orms are pretty handy.
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.
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.
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!?".
I think your comment is really unfair to the guy. You act like he spent 10 years writing shitty PHP apps with out ever even trying to learn anything, which simply isn't true.
In the article he says he mentions using Twitter Bootstrap before he'd even discovered CodeIgniter. Bootstrap was released about 2.5 years ago, so in 2 and a half years he's gone from insecure raw PHP apps, through CodeIgniter and ORMs, to Python with Django. Sounds like a dev who's constantly learning and improving to me. And don't forget he's 18 and in school, so web dev isn't even his full time job.
My advice to the OP would be if you're not feeling at home in Django try Rails. I went from raw PHP, through CodeIgniter, and now I use Rails. Rails instantly felt very natural for me, maybe it will for you as well.
> Talking about node.js or NoSQL or puppet or ansible or other "new technology" and be greeted by ignorance.
You'd be greeted by a great big meh from me and I make considerably more than $100/hour.
Your definition of 'basic stuff' is not inspiring. My definition would include processes and threads, I/O and networking, conversations around which also happen to often be greeted with ignorance.
yes, agreed. Those were examples. Talking about low level OS basics or POSIX or whatever is the same. What i wanted to say is that so many people never seem to get out of a very tiny skillset, for years. It's the worst people to work with, in my experience.
Have you ever deployed PHP to shared hosting? Seriously, you drag and drop the site in your FTP client. Deployed. This is how the majority of the PHP world does it. So it's completely unsurprising that someone from a PHP only background finds deploying other technologies harder.
Sure i have. As most web developers (i imagine) i started writing my first page in PHP, hardcoded passwords in a .php file which did also output HTML, it was "awesome" :P
Deploying PHP also means updating database schemas or configuring .htaccess or configuring apache or updating php modules. Deploying a django app can be as easy as upload + restart django. Everyone doing a little bit of development should have no problem automating that tiny bit.
I don't disagree that everyone doing web development should understand migrations and the server stack. And yet it's completely unsurprising to me that a guy still in high school is unaware or ignorant to it, regardless of when he started out.
Yes, ok, he is 18, that's true, so my post is probably a bit harsh. But still, if he keeps that attitude he'll be 30 or 40 and use Django in a time where everyone has moved on to new stuff(tm).
I am basing it on the influence a person's environment has on them. At the workplace or university, a person is more likely to encounter influential peers and mentors.
Telling me a developer is likely to get the same kind of experience working bit jobs as a contractor in high school as they are either doing the same while pursing a CS degree, or working in a development team is preposterous.
Edit: I just realised you're the OP. Add "gaining some maturity" to the things you'll get from the above.
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.
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!
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.
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.
those are great accomplishments, but I still wouldn't hire you to do web development at my company. Kudos for expanding your horizons though. Hope everything goes well for you.
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.
> [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.
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...
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. :)
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?
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
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.
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.