Live data from Hacker News

How I Build PHP Applications

ericharrison.info

21–30 of 56 posts

Re: How I Build PHP Applications

#21
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…

"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 ;-)

Re: How I Build PHP Applications

#22
post #17

Similarly to the author I don't use any frameworks, well except JQuery for front end and XTemplate for templates. Main reason being when I'm a lone developer I prefer having stuff I'm comfortable with and understand back to front. I'm sure I could get this from a good framework that doesn't have a lot of linking between parts but I'll admit I haven't put a lot of time in to try and find this. The more I learn about P…

If you do get the chance, check out Ruby and Sinatra. The whole source is only roughly 2000 lines of code, but it gives you just a very minimal level of abstraction over HTTP.

Here's "hello world" in Sinatra:

    require ‘rubygems’
    require ’sinatra’
    get ‘/hi’ do
      “Hello World!”
    end
... That's it. It's cool stuff.

Re: How I Build PHP Applications

#24
post #10

Earlier quoted context omitted.

Summary: I didn't understand how to use a framework, so I rolled my own one that doesn't really do much.

Why carry around the weight of a framework if you're happier doing things this way? Insofar as an idea on putting together a sane PHP project built from the ground up, I think it's a good article.

What 'weight'? A good framework doesn't stand in your way, it lets u focus on business logic solutions instead of repeatable tasks.

Sooner or later he'll discover that he's getting to the point where he needs to provide solutions for problems that are already solved by a variety of well-maintained toolsets, and the lack of abstraction will make his projects hard to develop further.

Re: How I Build PHP Applications

#26
post #15
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).

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.

Re: How I Build PHP Applications

#27
post #17

Similarly to the author I don't use any frameworks, well except JQuery for front end and XTemplate for templates. Main reason being when I'm a lone developer I prefer having stuff I'm comfortable with and understand back to front. I'm sure I could get this from a good framework that doesn't have a lot of linking between parts but I'll admit I haven't put a lot of time in to try and find this. The more I learn about P…

CherryPy is a good place to start as well.

Re: How I Build PHP Applications

#28
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.

Personally, 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.

Re: How I Build PHP Applications

#29
post #15
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).

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…

How would you suggest he present himself?

(Not sure about devs coming with cereal boxes just yet, btw... The want ads I see still ask for "PHP Coder" and offer six figure salaries for good ones)

Re: How I Build PHP Applications

#30
Funny. My friend was much like that guy (also with some framework past, he did some extensions to the eZ for instance) but switched to Ruby recently and says: no intention to go back.

First he just started to generate pages using erb, much like you would craft quick'n'dirty php pages getting stuff from the db, but with erb. He said the clean syntax and sane libraries were refreshing.

Then he discovered Merb and started to tinker with it. He didn't want to check Rails as it seemed "too high level, too automagic", good for him.

Then, when I mentioned Rack, he tried it and fell in love with Sinatra (no pun intended). Now he says he's several times more productive than with PHP, doesn't go insane, doesn't have to learn big monstrous framework (that was the reason he sticked to PHP in the first place), can invent and use his low-level hacks on a http conversation.

So: what he did quick'n'dirty in PHP he now does quicker'n'cleaner in Ruby, still being low-level as he likes it.

The catch is that no one has never evangelized Ruby to him. He just tried it out of his own curiosity.

Post reply on HN