Live data from Hacker News

PHP: A fractal of bad design

me.veekun.com

81–90 of 514 posts

Re: PHP: A fractal of bad design

#81
post #42

I'm going to be unfair and quote just two words from the article: > empowered amateur PHP is a gateway drug to web development. And that's awesome. With almost every other popular web development language I've heard of[1], there's this grey area between "my app works on my local machine" and "my app works on the server" that is really hard to grok as a beginner. There's a reason entire businesses are built on the ide…

web2py is a good alternative for beginners.

Re: PHP: A fractal of bad design

#83

I admit, PHP sucks. But there is one thing it has going for it. It's simple to configure and secure a server that your general userbase can run applications on. I work at ITECS, the Engineering IT department at NC State University. ITECS is responsible for maintaining the server infrastructure for dozens upon dozens of university Web sites, most of which have dynamic content. Not to mention the people server, which a…

Whoa. Definitely don't run Python as CGI. Use WSGI, run your app as a devoted low-priv user, proxy to it. Then you have only one entry point; there IS no sandbox, and nothing to exploit.

Re: PHP: A fractal of bad design

#84
It would be nuts to consider starting a brand new, dependency-free project in PHP today for all these reasons and more. If the reason for doing that is "all I know is php", well, now you have two problems.

That said, my primary language is PHP and I've written a whole lot of it over the last few years. I can report back that the choice of language is somewhere around the 37th most important factor in the end result. Whatever its flaws, they just don't have that strong of an impact in reality.

Re: PHP: A fractal of bad design

#85
post #59
post #38

Earlier quoted context omitted.

[deleted]

I'm sorry to say I'm deadly serious O_O

In that case..

- I feel there is more important stuff for me to do with my life than worry about the structure of a common language.

I actually think you answered your own question :) A love of simplicity is as meaningful as a love of good structure, consistency or design.

I envy your ability to -not- want for something better.

Re: PHP: A fractal of bad design

#86

Earlier quoted context omitted.

Exactly! One of the reasons I hate Ruby is that nearly every person I've come across that likes it is exactly how you describe. It seems to be part of the Ruby culture.

Exactly! That's the reason I hate broccoli -- every person who tries to feed me it seems concerned that salt and vinegar potato chips are the only vegetable I eat. It seems to be part of their whole culture. They're clearly just potatohaters.

I never said I don't use other languages. You are making assumptions.

I'm sorry if you like using Ruby and the majority of the community are pretentious assholes. I will never use Ruby or Rails for any project.

I can tell I must have gotten a little too close to home.

Re: PHP: A fractal of bad design

#88
Meh, I've written a lot of PHP code. I also work in Ruby and Python. All three have problems, but I like all three.

With PHP, you have to develop a coding style that naturally avoids PHP's weird areas. It's not really that hard to avoid the mines, but you do have to be aware of them.

In exchange, you get a scalable web server and a language that requires minimal babysitting. Instead of automatically throwing a 500 on a random, unimportant, uncaught exception, PHP makes a best effort, and most of the time the result is fine. 99% of the time, this is better behavior from a user's perspective as long as functioning perfectly isn't mission critical. It may feel offensive to your OCD programmer nature, but from a pragmatic engineer's standpoint, it's oftentimes a better choice, especially when dealing with the dirty data that's so common in webapps. Do not use PHP in a banking setting.

Compared to running a rails app, administering and scaling mod_php is pleasantly hassle-free. A single webserver with a modest amount of memory can handle an large number of concurrent PHP processes and requests without needing to resort to reverse proxies or anything more exotic than a simple apache install. That's nice not only for the ease of setup, but also because it means fewer moving parts, and less maintenance. That's a very real plus, and I'd say that the shared-nothing architecture of PHP was great engineering choice.

Yes, the language is weirdly architected and oftentimes inconsistent. It can also be extremely productive, and many of its weird choices are extremely pragmatic. The security holes are pretty horrifying, though - the defaults should be much more locked down, and I've always been a bit mystified that they're not.

Re: PHP: A fractal of bad design

#89
post #42

I'm going to be unfair and quote just two words from the article: > empowered amateur PHP is a gateway drug to web development. And that's awesome. With almost every other popular web development language I've heard of[1], there's this grey area between "my app works on my local machine" and "my app works on the server" that is really hard to grok as a beginner. There's a reason entire businesses are built on the ide…

Interesting point, and I agree that PHP has some properties that make it easier for beginners to get started with (which doesn't necessarily make it the best language to learn with, but definitely an easy one). I wrote my first few programs in BASIC before I graduated to C. Like BASIC, PHP makes it easy to get something running quickly, and horrible to do anything more complex.

The problem comes in when people don't quickly figure out that the language that they started out in should not remain their primary language for any serious project.

Re: PHP: A fractal of bad design

#90
post #42

I'm going to be unfair and quote just two words from the article: > empowered amateur PHP is a gateway drug to web development. And that's awesome. With almost every other popular web development language I've heard of[1], there's this grey area between "my app works on my local machine" and "my app works on the server" that is really hard to grok as a beginner. There's a reason entire businesses are built on the ide…

I posit that one of our modern "Things You Can't Say" is that the widely-held belief that the world would somehow be better if every single average Joe learned to program just might be totally bogus.

As was pointed out by djmdjm below, there are Real Consequences when amateur hour overflows into the real world. In many cases it simply would be better had many of these apps not been made by the unskilled - even if that means they hadn't been made at all.

What's so wrong about a barrier to entry that is effective against those who have not yet figured out what the fuck they are doing? We learned despite such barriers, did we not?

Post reply on HN