24 ms·
I like this kind of post, but its not a topic I care too much about anymore. Like the author php pays my bills too, and most of my work is done alone. He doesn'
by wizard_2 16y ago
I like this kind of post, but its not a topic I care too much about anymore. Like the author php pays my bills too, and most of my work is done alone. He doesn't like frameworks for reasons I don't like frameworks, abstractions are leaky. I still use frameworks because I'd rather have a team of people work on some of core features I use (orm, url routing, view engines) then just myself. I've also found that some php frameworks's abstractions are leakier then they should be (cakephp, and symphony come to mind).
The reason I don't care is that I'm moving on, and now php seems like such a mess. I used to not mind the arrays, the lack of proper objects. The oddly named functions. The years of backwards compatibility. I've been learning python over the past few weeks and using it for a few projects and I'm in love. Next up is probably Ruby but it looks like perl to me so I'm in no rush.
I feel like python is a better language because I'm better. Exposing yourself to different ways of thinking lets you pick up methods that work better then you knew before. I didn't even know what I was missing.
- jacquesm 16y agoDo you use a framework for python or do you code it all from scratch ?
- wizard_2 16y agoI've mostly been using django which is wonderful (even more so if you do things their way). The thing I love most about django is their orm, it makes cakephp's orm feel like a toy. I haven't yet used pylons, but I'm thinking that it would be good for me to learn another orm and it offers full support for a few. The reason I picked Django was the "apps". App's are python modules that tie into your project and provide functionality of some sort. The two ones off the top of my head are the "admin" app, which is frankly amazing, and the comments app which is a good example of what most apps are. An app that handles posting of comments and attaching them to any other kind of model. Django's history is in publishing and it shows. One app I'm making is for a real estate firm, I'm using Sorl Thumbnail, django-googleappsauth, and the admin app to take care of posting photos, having a single login with their mail (google apps) and a nice featured interface for the agents. Django's a great fit. The other app is an internal order tracking system that has to check against edi files and all sorts of other gotchas. It's got to do operations on millions of rows and lookups from multiple databases. Python has no trouble with most of this, but django's apps and orm doesn't exactly fit with the bulk of the operations. I do however use the django user system and fairly easily tied it into an active directory auth backend. The Admin app isn't useful at all for most of the interfaces, but the form classes and view layer (usually called the controler in most mvc's) let me do what I need to.
- jacquesm 16y agoI've tried (hard, three fair sized projects) to get in to django but I keep running in to limitations in the ORM that I could easily solve if I was writing sql direct. I'm impressed with your ability to get the app boundaries so clean, re-use has been another problem.
- wizard_2 16y agoDjango's orm seems to aware of some of it's weaknesses, you can actually write your own queries and return the data as a queryset (with your models) instead of just a dictionary or list of data. I use that to filter some records on a many to many join that was based on a shared field instead of a 3rd table and was happy with the results. Before trying that out I actually built the 3rd table which while it only has 3 columns (id, fk1, fk2) is probably the largest tables I've ever had to use with around 10 million rows. The django orm spent many hours building those relations, my custom sql spent about 5 minutes. Sometimes when you have hammer.... I can't take credit for the clean app boundaries, it's either python or django that lends itself to it. The apps I've written have to have clean boundaries if I want to use the community apps. But thank you anyway, it's been a lot of fun learning all of this and the community has been very helpful.
- dagw 16y agoAs a python programmer who will probably have to use php on an upcoming project, I'm wondering if there are any php frameworks you can recommend.
- phatbyte 16y agoAs ex-PHP programmer converted to Python I will say it will drive you insane lol. But I've managed to live some of my last PHP projects with with Kohana, Codeigniter or Zend.
- steveklabnik 16y agoWhatever you do, Zend is a GIANT pile of over-engineered junk.
- arnorhs 16y agoPersonally, I would recommend code igniter, even though the author of the article seems to disagree. It's a very lightweight, basic, MVC framework. Clear cut documentation and if you look at their code, it's clean and easy to understand.
- wizard_2 16y agoI've had a torrid love affair with cakephp for many years, it works but it hurts you. I started learning symphony which is far from simple but seems to be worth it before I jumped over to django/pyhon. Kohana was my second choice after symphony as it seemed to have a good grasp on what it does and it did a lot less.
- grigory 16y agoDefinitely take a look at CodeIgniter. After going through several frameworks myself when faced with a necessity to switch from Python to PHP for several projects, this is the one I ended up staying with. It's really great actually. I might have ended up using it in a very Djangoesque way, but definitely did enjoy my time with it.
- pstevensza 16y ago"Next up is probably Ruby but it looks like perl to me so I'm in no rush." Oh dear. Expect a early morning visit from the Ruby Re-education Police, who will no doubt politely beat you witless with a cricket bat they've called Clean Syntax. No worries however, they'll $/ you up off of the floor afterwards and send you on your merry with a Pragmatic Programmer's Guide To Ruby ;-)