Live data from Hacker News

In many ways PHP is just now starting to come into its own

gist.github.com

81–90 of 133 posts

Re: In many ways PHP is just now starting to come into its own

#81
I started with php and never used a framework quite some time ago. Every web site/app I've built had different file structures and my own little twists on how to abstract away certain things. I rarely used any third party php code too but my code slowly improved on its own.

Now a days I use rails and prior to that I used node/express for a year or so. I think working with php made me a better developer because you need to learn from your mistakes and using bare bones php is the best way to ensure you make mistakes.

You don't really understand why things are done a certain way until you've experienced first hand at how horrible it is to maintain a 6,500 line php file that's mixed with sql, php, html and a ton of inline css in a project that has about 500kb of mixed php/html/css files and like 30 different dynamic pages.

Re: In many ways PHP is just now starting to come into its own

#82
post #80
post #25

Earlier quoted context omitted.

> PHP is still the only language that assumes HTML output by default. For me, that's not a feature, it's an oddity that I have to work around. I guess it's a feature if you're using PHP as the HTML template language it was designed to be, but I suspect that's a minority use case these days.

I would actually argue that using PHP as the templating language in a PHP MVC application has become the majority use case. Why layer an additional templating language (Smarty, etc) on top of PHP - incurring extra processing and parsing - when PHP is a perfectly capable templating language itself? There are cases where you may need to do this (if you can't "trust" the templates for example and you need to enforce som…

I actually agree with you. It's been a while since I used PHP much, but the last time I did some work in, erm, I think it was Symfony, I remember thinking that PHP was pretty nice for the template layer. That may partly be because I'd got used to Django, which had an aggressively simplistic template layer at the time.

Edit: By which I mean, Symfony improves things by working around PHP's suboptimal default.

Re: In many ways PHP is just now starting to come into its own

#83

Prepare yourself for gross generalizations, but I have a point :) In 1997, people moved from perl to PHP in the same way that in 2004+ people moved from PHP to Ruby. At the time, the hard part of web programming was deployment, easy access to libraries of functions relevant for web programming, digesting forms, and emitting HTML. PHP suddenly made that trivial. PHP was basically a new language with a stdlib for web p…

> In 1997, people moved from perl to PHP in the same way that in 2004+ people moved from PHP to Ruby.

Ah yes, 2013 PHP:Ruby is the same situation as 2008 Perl:PHP.

Re: In many ways PHP is just now starting to come into its own

#84
PHP is like that old phillips screwdriver you have in your toolbox. You know, the one with a crack going down the side of the handle. Wrapped in masking tape to keep the thing together. You bought it when you moved into your first house and you need to screw a lighting fixture that was about to fall off the wall. It's been with you for years, always there in case something needed a little tightening.

Sure you have better, more streamlined tools in your shed, but sometimes you just need a little elbow grease and your old pal the screwdriver.

Re: In many ways PHP is just now starting to come into its own

#85
post #22

I spent a couple of years with php recently. I was using Codeigniter as a framework. Php frameworks now compete with the rest and the language is as complete as most others. Setup couldn't be much easier and it's probably the most ubiquitous web language. It does, however, have some bad behaviours of out the box that promote bad app development. I was startled at the default error handling when I had to start using i…

Your framework may have been catching exceptions and continuing execution.

If you want all errors displayed, you should tell PHP about it. In fact, it is recommended you display everything possible and code to strict standard while in dev. Doesn't sound like you were doing that.

Re: In many ways PHP is just now starting to come into its own

#86
post #71

Ok, PHP got package manager and MVC frameworks, but half of problems mentioned here http://me.veekun.com/blog/2012/04/09/php-a-fractal-of-bad-de... are still not fixed. It's shitty language and package manager and MVC will not help.

PHP as a language is broken. I don't want to speak in broken language. It hurts my brain as human..

Unlike other popular language which has language designer around it, PHP 'copy' other language feature without even serious consideration around it. Even more, there are no language guru who want to research the Good parts of it, like Javascript who has Douglas Crockford who tels us the good parts...

Re: In many ways PHP is just now starting to come into its own

#87

Earlier quoted context omitted.

They are doing it, though. For example they have now deprecated the dreaded mysql_, pgsql_ interfaces (including mysql_now_escape_the_string_for_real() and the like ;) for accessing the database in favor of PDO. They will be removed in the future. Lots of projects still use those. Just 1 example of PHP dropping backwards compatibility. It's not quite so bad as you make it out to be.

Deprecation of those awful vendor specific DB extensions is a good start, no doubt. But those are library functions, rather than language features. Another thing to consider is that PHP developers have a track record of deprecating certain functionality, then a few releases later changing their minds and no longer deprecating it. Some examples of this include is_a, and var in property declarations. Given how it's sti…

I like that `var` still exists, it lets me know that I am looking at crap code within half a second.

Re: In many ways PHP is just now starting to come into its own

#88
post #39

I'm just wondering, why should it take 15 years to get operators [] and -> to work with any subexpression (and to my knowledge it's still not 100% there)? Shouldn't it be implied and kind of automatic in a programming language? Or why should it take 15 years to adopt [...] as an array constructor in a language where arrays are one of the central data structures? Here is opinion No. 823,664,783 about PHP from a long t…

PHP Core is not some Mount Olympus, if you have C skills you can contribute!

Re: In many ways PHP is just now starting to come into its own

#89
post #63

One of my main challenges with PHP is that it has no package manager with large community support. With npm and gem, and the community supporting them - developers get so much help in building robust products. Every developer that I've known for a few years and successfully switched from PHP to Node has said "Why didn't you tell Me about this before?!"

This is exactly the problem with so many HNers - they have no idea what they're talking about.

5 years ago, you may have been right. Now? You are so wrong.

Before bashing something, you should make sure you're correct.

Re: In many ways PHP is just now starting to come into its own

#90
post #17

> If PHP hadn't evolved [...] > But it has. Honestly, how can languages (what PHP in the end boils down to) possibly evolve? Example: you cannot bolt OO to it later on, PHP, Perl and to some lesser extend even Python are a testimony to that. It just does not feel right, leads to syntactic horrors and is usually not very performant. Neither can you modify the syntax. You can add to it. But not much modify existing syn…

I'm not sure why you're getting modded down, I think you make a very obvious point. There is a programming language (syntax) and there are libraries. PHP syntax is not informed by much of Computer Science of the 30 past years, and it can't be fixed, that would be a new language. Frameworks can evolve and as long as the syntax allows enough, can be as amazing as anyone bothers to engineer them. This has nothing to do with how good a language actually is.
Post reply on HN