Live data from Hacker News

The MicroPHP Manifesto

funkatron.com

61–70 of 78 posts

Re: The MicroPHP Manifesto

#61
post #5

I am glad this is being discussed. Due at least in part to the to the fact PHP is constantly trashed (rightly or wrongly) in the "hip programmer" community, there is a lot of defensiveness in the PHP community. I understand why: one can only take so much trash talking especially when much of it is overblown or inaccurate, but it's caused many people to become so touchy that even valid, constructive criticism from com…

>As a PHP dev, I look over the fence at python & ruby examples and wonder why my application/framework is so complex and ugly

Why wonder? Have a look at the source of the different frameworks and try to understand how they work. Maybe there's some inherent characteristic of the languages that makes it this way. Maybe it's just that one is better thought-out than what you're using and you could propose or contribute a change.

Unless you're a contributor to a language or framework, it's probably not a great use of your energy to hope that it competes well with others. A better use of your energy might be to learn a few so you can pick the most appropriate tool for a given job.

Re: The MicroPHP Manifesto

#63

in all, as a fan of both php and small tools (the rarest of a rare breed), i agree with the author. but if i may play with the analogy... i'd actually say the Rush vs Black Flag analogy does not do Neil Peart or micro concepts justice. ideally, small tools can be used together, much like a drum kit. each of Neil's drums performs a very specific function, and he uses them as he sees fit. if he only played one song a n…

That's an interesting look at things. I look at it from something Stephen King wrote in On Writing. Basically, the story was about his father/uncle/grand father who, when he needed to fix something, would bring out his entire tool box, with all his tools, despite only needing a hammer. Stephen would ask him why he didn't just bring the hammer, and his reply was: "Because, I didn't know what else I might need one I got out here." Basically, the story tells us to bring our toolbox with us.

When you look at a large framework like Zend, it's a lot to swallow. There are a lot of parts, and just like the tools in a tool box, each plays a different part. You might just need a hammer today, but tomorrow, you might need a screw driver, and then a saw, and then a sander.

So, I appreciate larger frameworks. Sure, SOAP or XML-RPC might not be fun, but when that's the way you connect to the bank, it being apart of the framework makes it so much easier.

Anyways, the point was I saw your post, and it reminded me of Stephen's story.

Re: The MicroPHP Manifesto

#64
I don't agree with the OP about frameworks at all. The code example shows about 10 lines of code that are "just to get the app started" but what it doesn't show is all of the places where there will be much, much less code.

Frameworks do require a bit of initialization code, but the whole point is that once initialized they save you tons of writing. They take care of boring stuff like authentication, basic code organization, certain security issues, etc.

There's nothing wrong with deciding not to use any frameworks, but to do so because it seems "cleaner" or "simpler" I think it misguided.

Re: The MicroPHP Manifesto

#66
post #52
post #9

Amen! I've been railing against this as well for some time (with a minimalist project of my own - elefantcms.com), and wow is there ever resistance in certain parts of the PHP community to ideas like this. Reading "quick" start tutorials like this ( http://packages.zendframework.com/docs/latest/manual/en/zend... ) is just depressing, and it's a big reason why droves of developer continue the exodus to other languages…

PHP itself tries to emulate Java. Should have stopped at PHP4.

Yes indeed, I worked with JSF like 2 years, a PITA, now I'm back in the PHP world and looks the same crap :S, sad.

Re: The MicroPHP Manifesto

#67
post #58

Earlier quoted context omitted.

Real-world applications are complicated. Often, it's because people make them so. Often, it's because people recycle broken solutions instead of really thinking about what they're trying to do. Most code out there solves trivial problems, but is insanely complex. Web frameworks are especially bad at that.

Often, it's because the real world is complex. "Deliveries are not made on Tuesdays, unless it falls on the 9th day of the month, but not in June for tax purposes in 2013, 2014 and 1998. Our Nowheresville office is excluded from the above rule." You get rules like this. And there's reasons for most of them. Sometimes very good reasons. Often, what simplifies a business process on the surface actually doubles (or wors…

Sure, there are complexities like that in the world. However, where programmer A writes an if-else statement or, maybe, a 5-line dynamic dispatch, programmer B installs some "enterprise" framework or a rules engine, instantly making the entire system an order of magnitude more complex.

What programmers like B often doesn't realize is that they push core logic of the application from their source code (Turing complete, expressive, versioned, benefiting from static and dynamic analysis and all the testing/refactoring tools available for the language) into an obscure XML notation or even some proprietary rules database, worked upon by a complicated blob of 3d party code that has nothing to do with the original business problem.

Re: The MicroPHP Manifesto

#68
Micro-frameworks are awesome when you're doing that one quick pet-project you always wanted to try. Else you'll just fall into the loop of "okay, now I need to find and install/write from scratch this part that is present as core in x framework"

Re: The MicroPHP Manifesto

#69
post #67

Earlier quoted context omitted.

Often, it's because the real world is complex. "Deliveries are not made on Tuesdays, unless it falls on the 9th day of the month, but not in June for tax purposes in 2013, 2014 and 1998. Our Nowheresville office is excluded from the above rule." You get rules like this. And there's reasons for most of them. Sometimes very good reasons. Often, what simplifies a business process on the surface actually doubles (or wors…

Sure, there are complexities like that in the world. However, where programmer A writes an if-else statement or, maybe, a 5-line dynamic dispatch, programmer B installs some "enterprise" framework or a rules engine, instantly making the entire system an order of magnitude more complex. What programmers like B often doesn't realize is that they push core logic of the application from their source code (Turing complete…

Well we're talking about different things, now. Per Brooks, I was talking about essential complexity, you're talking about accidental complexity.

The point is that in web frameworks, the two are often confused or at least blurry. So we need to extend the essential/accidental dichotomy to deal with global versus local views.

Take for example parsing emails. In a universal sense the complexity is accidental, it arose from the technology decisions of the authors of RFC822 (which partly arose from previous decisions).

But locally, for a web programmer, the email address format is an immutable, irreducible fact of reality. I can no more wish away that complexity than I can wish myself a million dollars. To me it is an essential complexity.

Where web frameworks of the entirely-made-out-of-code variety really shine is in facing up to these locally essential complexities. It may seem superfluous now. It may not seem so in six months.

Re: The MicroPHP Manifesto

#70
Overcomplicated code is simply poor programming. Not something that requires a clever name or manifesto. I would go as far to say you overcomplicated things by posting such a long drawn-out post about something that could be said in far less words... or maybe even a little satirical code:

Poor_programmer = 'Overcomplicated code'; If (You == programmer) { stop(); }

EDIT: I change die() to stop() because die felt a little too dramatic, even if thats the correct function in php. =)

Post reply on HN