News for hackers. Stuff that matters.
Re:OK, here's the thing: this is only the entrance of the ra... by michaelchisari on Monday October 18, 2010 @09:35PM (#1805842)
I started using PHP in the late 90's, back when it was pretty useful in the sense of being able to embed code directly in web pages, so I liked it in a very general sense. Then I started building larger apps, and I started to get the kind of attitude about it that leads very many programmers to declare that "PHP sucks" or "I hate PHP." Then, I started building even larger apps, and I cursed PHP for every line of code I had to write.

Then, something happened. Yes, the language matured, but I also started using application frameworks in PHP, which addressed many of the issues I had with PHP, and then I built an MVC framework from scratch, based on what I'd learned.

Now, I just don't care. I'm not going to defend PHP as a good language, not even it's creator will do that, but when people go on about how terrible PHP is, my first thought is "well, then use it more, and eventually you'll stop caring."

I stick with PHP, specifically for open source, because of it's install density, because it is extremely flexible, and because I know all it's weird quirks and inconsistencies so well that they no longer bother me. I wouldn't mind switching to a more structured and consistent language if it came up, but I don't see PHP as a limitation for anything I want to accomplish, and haven't for a very long time.

And anyways, terrible code is terrible code, and when I think about having to delve into projects that are spaghetti, or procedural, or have no separation of concerns, I don't blame the language for my frustration.

Re:OK, here's the thing: this is only the entrance of the ra... by treeface on Monday October 18, 2010 @10:13PM (#1805914)
I'll even go so far as to say that coding in PHP is downright pleasant when you use a framework like CodeIgniter or Kohana.

At the same time, I have to use Joomla at work and I sometimes catch myself with a partially-tied-off noose around my neck.

It really comes down to what framework you choose.

Re:OK, here's the thing: this is only the entrance of the ra... by gaius on Tuesday October 19, 2010 @12:43AM (#1806252)
Any problem in computer science can be solved by adding a layer of abstraction, apart from the problem of too many layers of abstraction.
Re:OK, here's the thing: this is only the entrance of the ra... by joshu on Tuesday October 19, 2010 @02:16AM (#1806375)
That would be solved if only we had a framework framework.
Re:OK, here's the thing: this is only the entrance of the ra... by Ygor on Tuesday October 19, 2010 @02:27AM (#1806386)
Your comment reminded me of an older comment here:

http://discuss.joelonsoftware.com/default.asp?joel.3.219431....

Re:OK, here's the thing: this is only the entrance of the ra... by InclinedPlane on Tuesday October 19, 2010 @02:59AM (#1806426)
That's just silly. You want a generic framework factory factory, that you can then use to create a framework framework factory. And then you can get your framework framework.
Re:OK, here's the thing: this is only the entrance of the ra... by mkramlich on Sunday October 24, 2010 @03:32AM (#1825563)
They do in Java. It's called FrameworkFramework.

Unfortunately you have to get them from a FactoryFactory.

Re:OK, here's the thing: this is only the entrance of the ra... by puredemo on Tuesday October 19, 2010 @12:17PM (#1807626)
See "panels" in drupal.
Re:OK, here's the thing: this is only the entrance of the ra... by caf on Tuesday October 19, 2010 @01:12AM (#1806291)
...and apart from the well-known two hard problems.
Re:OK, here's the thing: this is only the entrance of the ra... by panic on Tuesday October 19, 2010 @02:08AM (#1806363)
You mean cache invalidation, naming things, and off-by-one errors?
Re:OK, here's the thing: this is only the entrance of the ra... by eru on Tuesday October 19, 2010 @07:15AM (#1806753)
If you don't like naming variables, use Fourth. (You'll still have to name functions, though.)

Against off-by-one errors, abstain from any from of loop.

For the real hard problems, like deciding whether your program has crashed or just takes a long time, give up.

Re:OK, here's the thing: this is only the entrance of the ra... by iclelland on Tuesday October 19, 2010 @01:16PM (#1807873)
Naming things was even harder when filenames were restricted to five characters or less.

That's why they had to name it Forth.

Re:OK, here's the thing: this is only the entrance of the ra... by alanh on Tuesday October 19, 2010 @01:26AM (#1806320)
As a Kohana user, I can corroborate the claim that Kohana-land is miles above the world of complete garbage PHP, but the community, the libraries, the robustness of the framework itself, and support from hosting providers, etc., is still far behind (say) Rails in every case.
Re:OK, here's the thing: this is only the entrance of the ra... by robryan on Tuesday October 19, 2010 @05:11AM (#1806579)
Touching on community, that would probably be the biggest motivator for me to move towards rails in the future, well over anything the individual languages offer.
Re:OK, here's the thing: this is only the entrance of the ra... by tapostrophemo on Wednesday October 20, 2010 @11:56PM (#1814215)
Don't discount PHP yet; the CodeIgniter community is great (http://codeigniter.com/forums/)
Re:OK, here's the thing: this is only the entrance of the ra... by fookyong on Tuesday October 19, 2010 @04:17AM (#1806524)
I use CodeIgniter, have done for about 4 years now.

I never even think about high level stuff like "what language should I code in" anymore. It doesn't matter to the end user. CodeIgniter allows me to do anything I want, elegantly and with a small footprint.

It's a means to an end and eventually like you said, you stop caring about the "means". It's the "end" that matters - i.e. how well you execute. Using RoR (for example) as opposed to PHP has zero impact on that.

Re:OK, here's the thing: this is only the entrance of the ra... by robryan on Tuesday October 19, 2010 @05:08AM (#1806575)
Yeah, you could argue that another language might get code down quicker or more elegantly but to the same "end". (Experience largely negates the quicker bit)

You might also argue that at scale PHP may eventually come back to bite you, but your not at scale at the moment and the majority of us should be thinking about the best way for us to deliver v1, not the best way for us to deal with 1 million users.

Re:OK, here's the thing: this is only the entrance of the ra... by andrewjshults on Monday October 18, 2010 @09:52PM (#1805869)
Completely agree - looking back at some of the code I wrote in PHP3 there were huge issues with the language but it was more that I had no idea what I was doing than an inherent problem in the language (granted, PHP5 is lightyears ahead of PHP3 and I'm certain that the improvements have made writing good code easier). Today, it has all the tools that if you learn better general coding practices (like MVC or at the very least separation of presentation from logic) it doesn't get in the way and you can just do what you want. I actually think the $$ syntax can be useful, but like anything it matters how you are using it.
Re:OK, here's the thing: this is only the entrance of the ra... by phr on Tuesday October 19, 2010 @01:15AM (#1806297)
I remember when "structured programming" was the new silver bullet all the guru's were talking about. This must have been the late 70's or early 80's. I was programming in DEC Basic-Plus on the RSTS/E operating system on a PDP-11. All variables were global, as I recall. We had subroutines and user defined functions with arguments but no local variable scope. We had if-then-else, but I think only a single statement was allowed for the "then" branch, so the cleanest way was often "if condition then gosub 1000 else gosub 2000" or something like that. A lot of the legacy code I had to work with was classic spaghetti-code with goto for flow control. Oh, I think we had only single-character variable names. Those were the days.

But I worked out how to adopt the new structured style to the limitations of the language, and learned a lot. Better languages make better tools, of course, but it's the hacker's attitude that really matters.

Re:OK, here's the thing: this is only the entrance of the ra... by Groxx on Tuesday October 19, 2010 @04:29PM (#1808616)
PHP seems to have a culture of poor abstraction / old libraries, which I think is largely responsible for the hatred. The language itself is... a language. There are better-for-X and worse-for-X, but languages are fairly inconsequential compared to what's already coded in the language (standard libraries, popular frameworks, your application, etc), which can be any degree of good or bad regardless of the language.