Live data from Hacker News

High Quality PHP

acquia.com

41–50 of 98 posts

Re: High Quality PHP

#41
post #22

It is really easy to talk smack about PHP because as a language it is not the prettiest, best designed, or cleanest language out there. It often leads to some very gross code. However, programmers write ugly code in every language and even in a much more beautiful language like Ruby, there are so many projects that end up with ugly codebases, poor performance, etc. that PHP by no means holds an exclusive ownership of…

You can trot out the trope about how you can write good code or bad code in any language as many times as you wish but it will not change the fact that php makes it unnecessarily difficult to write good code and, through both the language's and its standard library's misfeatures as well as the surrounding culture of sloppiness, encourages writing bad code.

I don't disagree with you at all.

Re: High Quality PHP

#42

Earlier quoted context omitted.

Bad tools? In what alternative universe is PHP a bad tool? It is one of the easiest to get started with, most documented, best supported and flexible tools out there for 90% of the things you see on the internet today.

Obligatory http://me.veekun.com/blog/2012/04/09/php-a-fractal-of-bad-de... I spent many years doing PHP. I am very glad that those years are behind me. Even if you allow for it being easy to setup - which is debatable - setup only happens once and is not very hard in any language. If you find it hard to install a programming language by following instructions, you are an amateur pretty much by definition.

Are there blog posts about how someone tried to solve an actual problem in PHP, but couldn't because the language sucked too much? You know, instead of pointing and laughing at things they saw in the manual or newsgroups that hardly matter in practice.

Re: High Quality PHP

#43
post #39

Earlier quoted context omitted.

You wanna know why PHP is so popular and why many people chooses it? Because it's so easy to get started using. Compare that to almost any other language out there that is a nightmare to set up. At the end of the day the code if it works it works and PHP just simply works. Not for everything but for most things.

I think that setting up apache+php is much harder than copy&pasting few basic lines of flask code a running simple python program.

What have Mamp done? Furthermore most web hotels support PHP.

Re: High Quality PHP

#44
I think a valid point to make here is that what has propelled Ruby, Python, JS, etc, forward has not been the language, but the frameworks that have put context and boundaries around using those languages.

Its entirely possible to write a poorly organized bowl of spaghetti using Ruby if you leave Rails out of the picture. I would venture to say the same is true for any programming language.

PHP was born before the idea of an open source framework had been propagated, it spread around the web before many of the paradigms and patterns had evolved to what they are today, and unfortunately it failed to gain acceptance by the elite programmers that have carved a community out using those other languages.

The other languages' respective frameworks have large, organized communities which have attracted very smart people that have put large swaths of functionality in place, before you ever have to write a line of code.

Its playing catch-up now, but there are good examples of PHP out there and it most certainly can be used in an elegant, high-quality manner.

Re: High Quality PHP

#45

Earlier quoted context omitted.

In a Universe where consistency, soundness, orthogonal API design, modularity and evidence that the developers gave some thought to their language is expected. I would like to believe that this is such a Universe. I mean, many of the endless list of functions imported into the default namespace were named so that their hashing distribution worked well with strlen for a hash. How much work went into working around the…

You are in the wrong universe mate. And you are missing the point. It's not just about the language it's about all the other things around the language. How easy it is to find a webhotel and get started, how easy it integrates with HTML, JavaScript, CSS. Of course it's ugly, but who besides a bunch of snobs and people who actually can't use it really cares? Who should care?

> how easy it integrates with HTML, JavaScript, CSS

No more than any other language or product written in such.

> Of course it's ugly, but who besides a bunch of snobs and people who actually can't use it really cares? Who should care?

You see, this is a big part of what's wrong with the PHP community, the apathy and immaturity. How on Earth is dismissing the reasoned criticism from professional peers and academics as "bashing" from "haters" or "snobs" an appropriate response?

Re: High Quality PHP

#46
post #16
post #7

Earlier quoted context omitted.

The author loses a lot of credibility by calling those three apps "great". If the article is about high quality PHP I'm interested in that, and not the poster children for PHP's popularity. As a user, phpBB is a nightmare to use, as a developer, WordPress is spaghetti code at it's worst. Edit: What's even worse is that we don't get examples of PHP code that was actually written with proper development procedures from…

Wordpress isn't the prettiest blog engine out there, but once you get its way of doing things, it's remarkably easy to get things done with it without your code devolving into an unmaintainable mess.

As somebody who has made a living writing WordPress code for a few years I strongly disagree. I know how to get things done with it, but I know that the way of doing things is clumsy. Once you want to do something that's not totally common you have to interact with opaque core code that's a horrid mess and never returns useful error codes for example.

Yes, it's not hard to make trivial stuff, but it's nearly impossible (and certainly a waste of time) to do complex things.

Re: High Quality PHP

#47

Earlier quoted context omitted.

You are in the wrong universe mate. And you are missing the point. It's not just about the language it's about all the other things around the language. How easy it is to find a webhotel and get started, how easy it integrates with HTML, JavaScript, CSS. Of course it's ugly, but who besides a bunch of snobs and people who actually can't use it really cares? Who should care?

> how easy it integrates with HTML, JavaScript, CSS No more than any other language or product written in such. > Of course it's ugly, but who besides a bunch of snobs and people who actually can't use it really cares? Who should care? You see, this is a big part of what's wrong with the PHP community, the apathy and immaturity. How on Earth is dismissing the reasoned criticism from professional peers and academics a…

Critique is fine but it just need to be based on other things than taste.

Point to a thing you cant do with PHP and you have valid criticism.

Critiquing PHP because you you think it's ugly or not elegant enough is only valid if you care about such things and then you are by definition a snob.

Re: High Quality PHP

#48

Earlier quoted context omitted.

Obligatory http://me.veekun.com/blog/2012/04/09/php-a-fractal-of-bad-de... I spent many years doing PHP. I am very glad that those years are behind me. Even if you allow for it being easy to setup - which is debatable - setup only happens once and is not very hard in any language. If you find it hard to install a programming language by following instructions, you are an amateur pretty much by definition.

Are there blog posts about how someone tried to solve an actual problem in PHP, but couldn't because the language sucked too much? You know, instead of pointing and laughing at things they saw in the manual or newsgroups that hardly matter in practice.

That's not the problem with PHP. The problem with PHP is that its design flaws cause friction that scales at least linearly and probably more like geometrically with application complexity--and it doesn't hit you until a project is of sufficient size that every change comes with more and more pain.

"It's easy to start with" is only a virtue if that doesn't come with "it turns into a tire fire a year later".

Re: High Quality PHP

#49
I believe "high quality PHP" is an oxymoron. It's just impossible to be aware of all the pitfalls PHP contains. Here is just one example among many:

> if( '33333333333333333333' == '33333333333333333334' ) echo "equal"; Output: "equal"

The "reason" for this very odd behaviour is that the two strings are automatically converted into integers, which leads to an int overflow, which PHP ignores (ignoring errors is very PHP specific) by guessing that the two "numbers" must be equal. I'm sure they even call this a feature...

Re: High Quality PHP

#50
post #36

High quality PHP does not exists, since PHP is ultra low quality language: http://me.veekun.com/blog/2012/04/09/php-a-fractal-of-bad-de...

You're right, but the post wasn't really about PHP itself. Of course, with this in mind, PHP apps can never reach high quality.
Post reply on HN