Live data from Hacker News

High Quality PHP

acquia.com

51–60 of 98 posts

Re: High Quality PHP

#51

Earlier quoted context omitted.

The same thing could have been said about visual basic... one of the worse language ever made.

Yup! Yet it helped millions achieve their goals. :)

By back-loading the development process, making it more difficult to get shit done later when your ability to avoid institutional inertia and code complexity has significantly decreased. That's not a good thing.

Re: High Quality PHP

#52
post #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 id…

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

You can easily write one with Rails over just a few months of maintenance. I hate, hate having to do a damned autopsy to trace all the @instance (read, global) variables copied and inserted into the objects that you never create yourself, -because Rails devs are apparently above having to endure the savagery of passing arguments to their methods- and having to grep every single function that gets automatically included from everywhere in the project into the namespace.

Re: High Quality PHP

#53
post #26

Earlier quoted context omitted.

That's true. But why make it worse by choosing a bad language. Surely you have good practice and a language that makes it easier.

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.

Agree.

Reminds me of some of my friends who will obsess over the specs on a digital camera (or the power of a particular model of PC or Mac) and completely ignore setting up and composing a good photo. Wanna be purists I guess.

Many years ago I put together some shell scripts using awk, sed and an early shell. The were used to do an estimating system in the business that I was involved in at the time. They were crude and the code was really bad and I had at the time really little clue on how to do things the correct way. Had I had to learn c to do the same thing (which I did somewhat a bit later) I would have never ended up with anything at all. Professionals laughed but the people who bought the business ended up using the system that I wrote for about 4 or 5 years until they found something to replace it. It got the job done. Under the hood what was going on (in this particular case I have to stress as this was pre-net and only used internally) wasn't really a factor.

Re: High Quality PHP

#54

Earlier quoted context omitted.

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

You're reframing all criticism towards PHP to "can it be done with x" from "is it best done with x".

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

s/PHP/Brainfuck

Does your argument still hold? Are you now a snob?

Re: High Quality PHP

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

PHP does not make it necessarily difficult to write good code. It's actually quite easy to write good code. The annoying part is that there is a metric CRAP ton of awful legacy code out there that constitutes the majority of PHP work. But you can say the same thing about any language - reality != trope.

I won't argue that there are large pockets of PHP developers who do fit the bill of encouraging a culture of sloppiness, but to paint the entire userbase this way is just ignorant.

Re: High Quality PHP

#56

Earlier quoted context omitted.

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

"Point to a thing you can't do" is bitterly disingenuous. Nobody's saying you can't do things in PHP, they're saying it's extremely disadvantageous to do so. Technical debt can't be wished away by screaming about "haters" and it's juvenile to try.

Re: High Quality PHP

#57

Author here. I wrote this article as a guestblogger for Acquia, which is the company behind Drupal. I don't work at Acquia. The article obviously uses Drupal as an example, PHPBB and Wordpress as comparison because they are all in the off-the-shelf, customizable category of PHP applications. Both Drupal and phpBB (contrast to Wordpress) have massively modernized their code bases in the last years and improved the qua…

FYI, there's currently a typo in the first paragraph ('loosing' => 'losing',) which made me cringe; you have to bury the typos further down where they'll have less influence on my perception of the piece.

[edit]It's since been fixed. That was an impressively quick response.[/edit]

Re: High Quality PHP

#58
post #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 P…

I would argue this isn't odd behavior - it's doing exactly what you asked it to do, and giving you the proper result. If this is incorrect, do it properly.

If you're encountering this pitfall, the problem isn't the tool being used, but the person writing the code.

Re: High Quality PHP

#59

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…

Beauty is subjective. I don't think Ruby is beautiful, I much prefer Python.

The difference is that PHP was not really designed for the type of use it gets. It began as one guy's hobby project and somehow snowballed to power some of the biggest sites on the internet without really having the backing necessary to support that position. PHP maintainers have been desperately attempting to backport the type of functionality that Serious Business people need, but it's never going to be as organized or clean as something that was conceived to serve that purpose.

If you care about code quality, choosing PHP already puts you at a disadvantage. It's not that people can't write adequate PHP code, or that people can't write ugly code in other languages. It's just that most other languages give you a pretty healthy head start over PHP when it comes to cohesion of organization, presence of important language features, etc.

Re: High Quality PHP

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

blindhippo: you are hellbanned. Most readers cannot see your comments.
Post reply on HN