Live data from Hacker News

PHP: A fractal of bad design

me.veekun.com

171–180 of 514 posts

Re: PHP: A fractal of bad design

#171

Earlier quoted context omitted.

You can put up whatever barrier to entry you like. Invent a certificate for Haskell programmers with Ph.Ds. Require everyone who works on your website to have your certificate. Have fun. But most of the world will tell you where to stick that certification and will cheerfully walk around your "barrier to entry". Then they will hack together a web page using whatever programmers and tools they can find, certified or n…

I wonder if that's only true because we as a society don't (yet) hold people accountable for the code they write, in the way we hold them accountable for the bridges they build or the cars they manufacture? I wonder what the costs of, say, the Gawker password database breach were? Or perhaps the Sony DRM rootkit on CDs? (Or Apples unpatched Java bug?) What if the people who wrote and/or deployed the code knew (before…

[deleted]

Re: PHP: A fractal of bad design

#172
post #61

Earlier quoted context omitted.

It's not awesome if the applications so developed by amateurs grows to store PII, financial information or do anything that has any security consequences whatsoever since it is likely to be riddled with "game over" security vulnerabilities. Unsurprisingly, most PHP applications end up in this state. Cf. http://web.nvd.nist.gov/view/vuln/search-results?query=phpbb... - and phpbb is one of the popular ones with an acti…

Most applications developed by professionals in Big Freaking Enterprise Languages working in regulated industries will also have game over security vulnerabilities. Most applications developed by the cool kids in Ruby/Python working for startups will have game over security vulnerabilities. The current state of information security: basically, we're screwed.

PHP sites will have a hell of a lot more of them, though. You're not shielded against CSRF, XSS or SQL injection attacks unless you use a framework - at which point you're back to being a programmer with no "empowered amateur" in sight...

Re: PHP: A fractal of bad design

#173
post #116

Sure, PHP is full of inconsistencies and irregularities. You know what else is? English.

What English is good at is expressing a huge variety of ideas. I once heard someone argue on NPR (sorry, no citation) that English is perhaps the /best/ language at expressing absolutely any idea to another person precisely because it has such a huge vocabulary and so many idiomatic phrases. I've sometimes heard of programming as an art, like poetry, but if so I'd prefer to maintain that it is a minimalist art that e…

> I once heard someone argue on NPR (sorry, no citation) that English is perhaps the /best/ language at expressing absolutely any idea to another person precisely because it has such a huge vocabulary and so many idiomatic phrases.

I heard that on the radio, and I've been looking for it for years! If anyone knows the show, ideally the specific show or interviewee, I'd be supremely grateful!

Re: PHP: A fractal of bad design

#174

Didn't we all go through this? 1. Ooo, PHP is awesome, I can make stuff happen on a server! 2. Hm, well, PHP has its problems, let's open source a microframework to fix it! 3. Oh my god, PHP is horrible, let's rant about it on a blog! 4. Who cares that PHP is horrible? It's the application that counts. OP is at step 3, currently.

5. Oh fuck, I've been hacked!

Re: PHP: A fractal of bad design

#175
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 agree with you and I'm really surprised in 15 years, or how over old PHP is, THERE IS NOT ONE SINGLE ALTERNATIVE!!

Why? For PHP I sign up for one of the million LAMP ISPs, I upload a .php file with .php embedded in HTML and I'm done.

Where's the Ruby version of this? The Python version? The JavaScript version? The Perl version? THEY DON'T EXIST. You wanna use Perl or Python. You either have to use slow slow cgi or you have to RUN YOUR OWN SERVER. (virtually or otherwise)

PHP sucks, I hate it. I don't code in it unless I absolutely have to. But it's not the language that makes it popular. It's the combination of pre-installed + no setup + plus faster than cgi + works on a shared host + inline templating that's made it popular.

mod_perl? mod_python? As far as I understand them they're not useful on shared web servers so they don't fit the niche PHP is filling. Node? Ruby? They are the server rather than a plugin for apache. Again, not filling the same niche.

Someone with some chutzpah needs to step up and bring the EXACT SAME COMBINATION OF FEATURES except with a different language to the Web. They can be rich writing books and running conferences.

--

Ok, now, I suspect most would want this to be in Python or Ruby but I'd argue if you really want it to succeed make it JavaScript. Because most PHP programmers have to learn JavaScript as well for their webpages. Less to learn = more likely to succeed.

But honestly, if anyone could get any of those languages to fill the niche PHP is providing it would be a huge boon over today.

Re: PHP: A fractal of bad design

#176
PHP is the "Rudy" of web languages. It just won't quit.

I remember switching to PHP for three reasons about 9 years ago. I cycled through Perl, ColdFusion, Java Server Pages, and ASP JScript before getting to it.

1. It was the most accessible free alternative to costly platforms (ColdFusion, MS ASP) or more strict / difficult to configure platforms (Perl, JSP). Error checking was as simple as ASP/JSP and starting up was as simple as paying for a cheap LAMP server that would run it out of the box.

2. It had the largest set of online documentation for both the language itself and tutorials / code examples. This was one of the biggest unavoidable draws to the language. The community was huge and still is to this day although documentation is much more evenly distributed across other languages now.

3. PHP may be one ugly beast but it does pre-package practically every piece of functionality you could ask for within it. I'm not sure I have ever liked the look of the code but there was something magical about being able to grab remote server code via file_get_contents for the first time. It was so damn easy!

If I were to suggest a platform today I would probably have to go with Python. It has all of the same advantages that PHP had in the past but has the added benefit of being better designed and applicable to more than web programming. Ruby would be my second choice simply because the environment setup is a bit more complicated still, although the language is the most beautiful in my opinion.

Re: PHP: A fractal of bad design

#177

Didn't we all go through this? 1. Ooo, PHP is awesome, I can make stuff happen on a server! 2. Hm, well, PHP has its problems, let's open source a microframework to fix it! 3. Oh my god, PHP is horrible, let's rant about it on a blog! 4. Who cares that PHP is horrible? It's the application that counts. OP is at step 3, currently.

No, not all of us. I've never coded anything with PHP. I don't even know how to write hello world with it.

<? echo "Hello World";

Re: PHP: A fractal of bad design

#179

Didn't we all go through this? 1. Ooo, PHP is awesome, I can make stuff happen on a server! 2. Hm, well, PHP has its problems, let's open source a microframework to fix it! 3. Oh my god, PHP is horrible, let's rant about it on a blog! 4. Who cares that PHP is horrible? It's the application that counts. OP is at step 3, currently.

I actually had to learn more PHP than I'd have liked to write this post. It was never my language; I started in the Perl days before PHP was a thing, stuck with it, then jumped ship to Python. I've interacted with it in the form of horror stories from colleagues and the occasional having to fix some friend's oekaki thing or whatever.

I wrote this because nobody had written it comprehensively enough, and as an engineer I am inexplicably convinced that I can do everything better than everyone else if I just redo it from scratch.

Re: PHP: A fractal of bad design

#180
PHP has had its time FWIW gave ASP.net run for its money - and lets leave it at that. Ruby has some difficult points. There are some antipatterns in rails. What dynamic languages do really bad is error reporting. And that what makes its so damned hard to get around becoming really good at a predictable rate.

I wonder if python's Django stack traces are better on errors in templates and such.

Post reply on HN