Live data from Hacker News

How I Build PHP Applications

ericharrison.info

31–40 of 56 posts

Re: How I Build PHP Applications

#31
post #15

Earlier quoted context omitted.

The big secret is that programmers make more money when they stop pitching themselves as programmers and start pitching themselves as skilled professionals who make their firms millions using a variety of tools, including code (when appropriate). OK, it isn't much of a secret. I wince every time I hear someone describe himself as a "PHP coder" in mixed company (i.e. in front of folks with hiring authority rather than…

Soooo what's your job title? It sounds like you've sugar coated the hell out of it.

His job title is "Founder."

Re: How I Build PHP Applications

#32
post #7
post #3

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…

Do you use a framework for python or do you code it all from scratch ?

I'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.

Re: How I Build PHP Applications

#33
The author seems to not make a distinction between a web application of some sort and then a website.

If he's making a website for a client, I really doubt that he likes to write all the code to edit pages, blog, update images etc himself for each project. It's much easier to base your project on a preexisting solution like WP, joomla, etc.

However, if he's making a web application, using joomla/WP is a complete nonsense, so using a framework like Code Igniter is perfect.

He doesn't have to use the ORM if he doesn't want to, he doesn't have to use the forking if he doesn't have to. Code Igniter is super lightweight.

On PHP's faults: When you've been working with PHP for a long time, all those issues mostly become non-issues, documentation reference lookup using http://php.net/; is super sweet, the arrays with all the array functions make arrays incredibly powerful, you can turn off all the automatic sanitizing code if you dont' want it, etc...

We've all seen UGLY php code, but that's just because the barrier to entry into becoming a PHP developer is so small, so there's a lot of bad coders out there.

But if you do things right, PHP development is very stable, you can do incredible amounts of work in a short period of time and the amount of information and pre-built code out there is vast.

Re: How I Build PHP Applications

#34
post #8
post #3

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…

As 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.

I'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.

Re: How I Build PHP Applications

#35
post #19
post #12

I'm surprised he argues that PHP will land you well paying jobs - in my experience java and c# jobs (especially ones with the word "enterprise" in the description) pay far better than php (with c,c++ and most other popular languages like python and ruby somewhere in the middle).

It depends, PHP does have the reputation for being the language of choice for low paid outsource quality jobs. Knowing it well can land you a lot more but I think you'd be on the right track with saying enterprise type Java/ c# stuff would on average get you more.

I would say that more outsourced jobs are done in Java/C# because they are "Enterprise" languages. In much of the tech world, PHP is viewed as a toy.

Re: How I Build PHP Applications

#36
post #7

Earlier quoted context omitted.

Do you use a framework for python or do you code it all from scratch ?

I'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…

I'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.

Re: How I Build PHP Applications

#38
post #2

Summary; I don't like frameworks, so I rolled my own framework.

I think it is more accurate to say he wrote his own library.

These terms are not well defined (AFAIK) but often a framework implies that you have something “already running” which you customize by providing callbacks, delegates, and similar.

With a library you have a set of reusable functions and data types (classes).

I think an Apple engineer referred to frameworks as “the hollywood model: don’t call us, we call you”.

For PHP programmers that dislike the framework model, have a look at http://flourishlib.com/ — been mentioned on HN before but I hadn’t seen it before this week. In philosophy this is exactly how I prefer a good library of re-usable code: lots of self-contained functions and data structures which each solve a problem, and you decide when to use what.

Post reply on HN