PHP At 20: From Pet Project To Powerhouse 281
snydeq writes: Ben Ramsey provides a look at the rise of PHP, the one-time 'silly little project' that has transformed into a Web powerhouse, thanks to flexibility, pragmatism, and a vibrant community of Web devs. "Those early days speak volumes about PHP's impact on Web development. Back then, our options were limited when it came to server-side processing for Web apps. PHP stepped in to fill our need for a tool that would enable us to do dynamic things on the Web. That practical flexibility captured our imaginations, and PHP has since grown up with the Web. Now powering more than 80 percent of the Web, PHP has matured into a scripting language that is especially suited to solve the Web problem. Its unique pedigree tells a story of pragmatism over theory and problem solving over purity."
Cue non-programmers linking "A fractal of bad desi (Score:2)
Re: (Score:3)
Please define "programmer" for us.
Re: (Score:2, Funny)
"Someone who writes PHP and LIKES IT."
Re: (Score:3)
Anyone using PHP is a non-programmer by definition.
I'm a professional software engineer working on OS-level software for a heavyweight in the tech industry. I also use php in a non-work context. And I actually enjoy it
Guess you'll have to peddle your absolutisms elsewhere.
Re:Cue non-programmers linking "A fractal of bad d (Score:5, Insightful)
PHP is great (Score:5, Insightful)
The great thing about PHP is that it's the one language that native, Java, .NET, python and ruby guys can all make fun of together.
Here's to another 20 years (or maybe 19, depends)!
Re:PHP is great (Score:5, Interesting)
> can all make fun of together.
I'm a Java dev of nearly twenty years, and I used to make fun of PHP. That was until my company added a team of PHP developers to work on prototypes. Over the past eight years, they have constantly exceeded the productivity of my Java devs by more than tenfold. Yes, the PHP code is harder to maintain long term, but it's amazing how fast you can build things that work. It is the best glue language I've ever seen. Basically it's just a thin shim between C libraries, and no one can argue with the quality and expansiveness of the C libraries available for Linux. PHP lets us use them very, very quickly in web, command line, and GUI apps. The only real weakness I've seen is that PHP-GTK is not very well maintained.
Re:PHP is great (Score:5, Interesting)
exceeded the productivity of my Java devs by more than tenfold
On my team of twenty-one devs, we have eleven Java guys and three PHP guys. We do fortnightly sprint planning meetings and score backend tasks as a group. The Java guys do about 50 points per sprint of work. They're very consistent and dependable, which is nice from a management point of view. For the PHP tasks, we schedule 75 points per week. The PHP guys, over the past three years we've been doing this, are doing 5.5 times as much per developer. PHP is amazing.
The problem is that on a per-Sprint basis, the PHP guys are very inconsistent. Sometimes they'll do two to three times as many points as we planned on, and in a few sprints, they got no points. So even though they're five times more productive on average, our management wants to move everything to Java because it is easier to manage. Also, since we recently released v1, we know PHP maintenance tasks are going to be even more inconsistent wrt time to fix.
Re: (Score:3)
"everything to Java because it is easier to manage"
Sounds like they want a waterfall and not Agile.
Re: (Score:3)
If you start measuring productivity with points, your developpers are going to game the system and change their scale to achieve your said productivy. Sometimes, it happens unconsciously.
If you say "it's too expensive" then, they are going to game the system to reduce points. In either case, you lose.
Story points are just a
Re:PHP is great (Score:5, Informative)
thin shim between C libraries
That is a great point. Since the Microsoft fanbois hate Linux, they hate PHP. PHP is basically a way to call C libraries. That is why the library naming conventions in PHP are so inconsistent. It's because PHP is exposing those libraries, with all of their individual quirks, to an easy to use scripting language.
Where I work, we converted a C-based CGI program that was developed from 1994 until 2009. At peak, I think we had nine C developers working on it. It took us only six months with three PHP developers to write a good PHP replacement that called our C libraries. Now I have two new college grads that are very productive adding features to the web site whereas before, I had expensive C programmers each with more than ten years of experience that took dozens of times longer to complete tasks. PHP has cut our development overhead by probably 80%. Now the three remaining C programmers can work on interesting projects rather than on web pages. PHP has, and this is not an exaggeration, saved my company.
Re: (Score:2)
That is a great point. Since the Microsoft fanbois hate Linux, they hate PHP. PHP is basically a way to call C libraries. That is why the library naming conventions in PHP are so inconsistent. It's because PHP is exposing those libraries, with all of their individual quirks, to an easy to use scripting language.
Is that a good idea? Maybe there should be a little more logic in between the libraries and the scripting language, for a variety of reasons including convenience and security.
The only thing I hate about PHP is the way it cornholes your RAM.
Re:PHP is great (Score:5, Insightful)
Yes, the PHP code is harder to maintain long term,
Do you understand that the vast majority of time spent on a software project is maintenance? If you optimize for the initial development, you are wasting your time.
The only real weakness I've seen is that PHP-GTK is not very well maintained.
ok, now you're just trolling.
Re: (Score:2, Interesting)
> vast majority of time spent on a software project is maintenance?
True, but the company needs to survive long enough to get to that point. Out of the fifteen start-ups I've worked for in Seattle since the first one in 1983, most failed before we got to the point where we started to do maintenance. Most failed because .NET and Java apps take so much time and effort to get to a minimum product. Having to do maintenance, even if it is harder, is a high quality problem. It means you've survived longer t
Re: (Score:2)
Most failed because .NET and Java apps take so much time and effort to get to a minimum product.
If that's your problem, it's lousy programmers not lousy platforms.
Like, if it takes you much longer to get a web page up in ASP than in PHP, something is wrong with you. The effort of setting up the framework is not very heavy.
Re: (Score:3)
Quick doesn't have to mean dirty [eev.ee]. You can be extremely productive without creating unmaintainable crap in an ugly, badly-designed language. It's not a trade-off, you can have a better language and better productivity at the same time.
Re:PHP is great (Score:5, Informative)
PHP is a truly terrible language, with a truly terrible API. Just look at functions like implode [php.net], which can accept parameters in either order. Also (according to one commenter), imploding an array of booleans results in the "true" values being converted to 1, and the "false" values being converted to empty string. That's just a single function. Don't even get me started on mysql_escape_string [php.net] vs. mysql_real_escape_string [php.net]
The only reason it's so popular is that for such a long time it was the only choice for server side languages on a shared hosting environment. Even now there aren't really any good alternatives. Shared hosts still don't allow things like Java,.Net, or Node.JS on the server side unless you are prepared to pay a premium. Many hosts don't even offer Ruby, or Python, even though they don't require a constantly running process.
PHP started off as a toy project, and although a lot of work has been done to add functionality to make it useful, it still shows that it was lacking a lot of design considerations. Object Oriented capabilities and namespaces were tacked on later, and it really does feel tacked on, because only a very small part of the available libraries use object oriented features.
Re: (Score:3)
Don't even get me started on mysql_escape_string [php.net] vs. mysql_real_escape_string [php.net]
If you see anyone using the mysql extension then they deserve to receive as much shit as you can give them. It was outdated in 2004. People should be using PDO [php.net] these days.
Re: PHP is great (Score:5, Funny)
mysqli_real_escape_string has been deprecated. You should be using mysqli_real_escape_string_honest_guv_we_won't_change_this_again
Re: (Score:3)
Sorry man, mysqli_real_escape_string_honest_guv_we_won't_change_this_again has been flagged for depreciation with no planned replacement.
It is deprecated in PHP 6.
But PHP 6 has been deprecated, so now it's back in. Until it's not.
Re: (Score:3)
Re: (Score:3)
Indeed. PHP is one of the shittiest languages ever implemented.
* https://wiki.php.net/rfc/incon... [php.net]
It tends to bring out all the language apologists who are in denial over how shite it is:
* http://www.reddit.com/r/lolphp... [reddit.com]
It makes crappy Javascript look good in comparison:
* http://strilanc.com/visualizat... [strilanc.com]
Re: (Score:2)
> JavaScript is still worse [then PHP]
That is like arguing if cat or dog shit smells worse. :) They both stink, badly.
Re: (Score:2)
PHP is a web language that runs a script per page view and there is no state saved between page loads (other than a session variable that is stored to disk).
Object-oriented programming is great, but it is really a lot of overhead when you're creating and destroying the objects on every page load. I'll admit I've created a few classes in PHP, but most of the work I do simply doesn't require it.
Re:PHP is great (Score:5, Insightful)
I'm currently developing in python after 7 years in the PHP world.
There are a lot of PHPisms I have grown accustomed to, that I would really like in PHP. Namely, I want var_dump.
PHP makes a lot of sense to me from the context of a kid who wrote awful raw HTML pages. I just wish we had a mode for PHP that wasn't "here's a pretend HTML page" for all sorts of backend logic. That's the only thing I want from python that isn't in PHP. WSGIServer is a boil on the ass of the python world.
Re: (Score:2)
I'm currently developing in python after 7 years in the PHP world.
There are a lot of PHPisms I have grown accustomed to, that I would really like in PHP. Namely, I want var_dump.
What does it do that Python's repr or json.dump or json.dumps fails at?
Re: (Score:3)
You can do far better than that. If you use a tool like the Flask debug toolbar, you can jump into an interactive debug session, running on the server, right from your browser.
Re: (Score:2)
Re: (Score:3, Insightful)
Programming languages are complex things. Just because you're not fit to use the tools properly doesn't mean the tools are to blame.
Re: PHP is great (Score:3, Insightful)
No it really is a pile of garbage. The fact that it continues to work at all is a testament to the commitment of the maintainers to continue tilting at that particular windmill.
Why garbage? Here's why:
1. Standards change all the time. What's the default value for that global? Depends upon the version. What? That global didn't exist when you wrote your code, so you can't check its current value to see if it affects you? Go fuck yourself.
2. Libraries and APIs are added, replaces, and sundowned at will. Want t
Re: (Score:2)
Standards change all the time.
Such as Python 2 to Python 3.
Error handling. Look it up. Or, rather, the designers need to do that and then implement something sane, and do it consistently.
"Sane" would involve dropping "warnings" in favor of exceptions. Fortunately, PHP's error handling allows your program to do this most of the way, using ErrorException: [php.net]
My beef with PHP error handling is that certain errors are fata
Re: PHP is great (Score:5, Insightful)
No it really is a pile of garbage.
The very best programmers that I've encountered in my long career were the ones that could make the code sing (figuratively speaking) regardless of the environment. Any language, any OS, any hardware -- none of these things ultimately matter. All those things will be replaced by something better (or maybe worse) at some point in the future. Being able to put aside juvenile biases and petty preferences is a hallmark of the truly great programmer.
The very worst programmers that I've encountered were the ones that bitched and whined endlessly about minute details, or those who let their pure philosophical ideals get in the way of the task at hand. They adopt stupid star-belly-sneetches attitudes for the sake of appearing smart among their peers, slagging that which they do not approve of.
Guess which one you are.
Extending an existing PHP app in other than PHP (Score:3)
So what? If you don't like it, don't use it.
How would one go about writing an extension for an existing large codebase, such as phpBB, MediaWiki, or WordPress, in a language other than PHP? And it's likely that some of these codebases began years ago when shared web hosts charged extra for languages other than PHP.
Re: (Score:3)
If you're writing extensions for PHP applications but you don't like PHP and don't want to use it, maybe you need to reconsider your job. That's like a Linux fanatic complaining about needing to use Microsoft products in their job as a programmer of Office add-ins. Or a vegan chef complaining about having to deal with meat at the steakhouse they opened. Or someone who is frightened of flying bitching about needing to go to work as a co-pilot tomorrow.
If you don't like PHP, then maybe don't work a job tha
Re: (Score:2)
Re: PHP is great (Score:5, Informative)
What? HTTP redirects with the header() function have been simple and consistent the entire lifetime of the language. The function is not an alias and does not require an optional library as you claim. I especially like that it exposes the underlying HTTP headers of the protocol instead of wrapping the redirect into some type of hidden Response.Redirect() type function. This "lower level" makes understanding and debugging redirect problems much more obvious.
Re: (Score:3)
As you can see, it talks directly to the SAPI in
Re: (Score:2)
Try ExpressionEngine and its fun "parsing order" from Hell.
PHP is heaven in comparison.
Re: (Score:2)
The most popular language on the web HTML.
The second most popular language on the web is Javascript.
The third is XML.
Re: (Score:3)
Neither html or xml are programming languages. They do nothing until a programming language comes along.
Re: (Score:2)
The person I was responding to did not specify "programming language".
Re: (Score:2)
Did the person I responded to specify "programming language"? (Hint: NO)
There is far more HTML and Javascript and XML on the web than there is English.
Re: awwww (Score:2)
JavaScript isn't just client side. If you disagree, I'll get MEAN with you ;-)
Re: (Score:3)
Node exists because it can, not because it should.....
Holy crap (Score:5, Funny)
This almost makes me wish Dice would go back to starting its flame-wars with stories on gender inequality.
Why PHP Won (Score:5, Informative)
Hello world in PHP:
No Bullshit Boilerplate (TM), no needing 5KLoC of code and configuration, no application server to babysit 24/7, no need for catalina+tomcat+jakarta+jre+struts+hibernate+Xmxwtfbbq16GB, just load one module and every single customer sharing the server can use it... No need to understand the CGI protocol, no need to understand the HTTP protocol, no need to understand HTML even.
Re: (Score:3, Interesting)
It's because in 1996 to do this on a web page:
<? echo "Today is " . date("Y/m/d") . "<br>"; ?>
Was AMAZING and easily understandable.
Re:Why PHP Won (Score:5, Informative)
Today is <?=date("Y/m/d");?><br>
A big part of the appeal of PHP was how it could be mixed in to HTML documents to make a mess of server side and client side code.
Re: (Score:3)
A big part of the appeal of PHP was how it could be mixed in to HTML documents to make a mess of server side and client side code.
Very appropriate choice of words. I hope I'm never asked to make such a mess (i.e., write code in PHP or JSP), ever again. Separation of concerns is key to maintainability, and this style of development is obsolete.
Re: (Score:3)
Re: (Score:2)
The same way you avoid vulnerabilities in other programs - you write good code and/or become a better developer.
I can concatenate SQL strings in pretty much any language and a language that prevents me from doing so is hopelessly overcomplicated. I don't mind a library forcing me to use safer methods but if the language prevents me from sending a custom SQL or LDAP query, it's broken.
Re: (Score:3)
Same way you do for just about any other language - don't trust any input given. Check it for type, check it for how it was delivered (POST vs GET vs reading from file/stdin/whatever), check it for a (sane) value, deal with unexpected or missing values in a sane way, etc. When using SQL stuff use PDO or mysqli class/functions to use prepared statements.
Re: (Score:2)
Or just learn how to code reasonably well in PHP and be done with it.
That's not possible. Plenty of people try, but then leave security vulnerabilities all over the place.
Re: (Score:3)
I won't sugar coat this: PHP allows you to write security vulnerabilities into your code. But it doesn't require it.
You just have to actually understand vulnerabilities and be the one working to avoid them. I wouldn't use ANY large open-source piece of software written in PHP as an example. There is a LOT of garbage out there. But it's not hard to understand SQL injection and any of the other risks.
Re: (Score:3)
You just have to actually understand vulnerabilities and be the one working to avoid them. I wouldn't use ANY large open-source piece of software written in PHP as an example. There is a LOT of garbage out there. But it's not hard to understand SQL injection and any of the other risks.
If there are no large open source PHP projects that have good security, it doesn't give me confidence that I can understand PHP well enough to avoid security vulnerabilities.
Re: (Score:2)
I didn't say there are no such large projects. But Wordpress is really bad code. Or at least b2 was before it was Wordpress. phpBB is far worse. But you don't even have to understand PHP much to know what's wrong. A lot of larger projects are run by people who see nothing wrong with putting unsanitized GET variables directly into a db query.
Re: (Score:2)
Yeah, but THIS looks more like real work:
Nobody will feel like paying you big bucks unless it looks hard to do.
A poor workman... (Score:5, Insightful)
Re:A poor workman... (Score:5, Insightful)
Re: (Score:3)
Re: (Score:2)
In what possible situation would PHP be the best tool for new development?
I can't think of ANY.
Re: (Score:2)
In the situation where you're developing a new extension for an existing project, such as a new MediaWiki extension. Or in the situation where you're developing a new program to run on a shared web host that has only PHP installed and not Java, Node, or ASP.NET.
Re: (Score:2, Insightful)
The Tao gave birth to machine language. Machine language gave birth to the assembler.
The assembler gave birth to the compiler. Now there are ten thousand languages.
Each language has its purpose, however humble. Each language expresses the Yin and Yang of software. Each language has its place within the Tao.
But do not program in PHP if you can avoid it.
Re: (Score:2, Insightful)
You are misusing that saying.
What it means it that a good craftsman knows not to use substandard tools.
A good programmer knows not to use substandard languages like PHP.
I love that it exists because it is an easy and accurate resume filter. PHP on it? Delete it!
Re: (Score:2)
> A good programmer knows not to use substandard languages like PHP.
A good programmer understands what standards to adhere to.
Try not to be a stickler for metrics that have become religious for you, as they do not seem to be significant barriers to existing projects.
Re: (Score:2)
PHP is a significant barrier for existing projects.
Look at the pile of crap that is Wordpress or any PHP CMS for that matter.
Ask Facebook how much money and time they have spent trying to hack around PHP's many warts.
Re: (Score:3)
...and yet, despite all the issues you see with PHP, they're still using a language derived from it. Even though they have more than enough manpower and money to remove it entirely if they so choose.
Re: (Score:2)
Did PHP kill your mother? What is the metric for being horrible? Is it based on lack of adoption or is it some score or is it something you only know when you see it?
> PHP is a significant barrier for existing projects.
> Look at the pile of crap that is Wordpress or any PHP CMS for that matter.
WP is confusing, unmaintainable code, except for the brave few who do. Those outliers aren't really important in the grand scheme. I have encountered many proprietary CMS systems that were maintainable and maint
Re: (Score:3, Insightful)
I'll probably be downmodded but I'm going to call horseshit on that cliche. While it may be PC to be in denial over crappy tools, the fact remains some tools (programming languages) are well designed and others are not. So yeah, um, no, I don't buy that argument that a poor craftsman blames his tools. It is the good craftsman that is able to spot the crap tools DUE to experience of having used good ones AND crap ones that they can tell what is complete shit.
Second, just because you CAN write code in Brain
Use === (Score:2)
The == operator is broken
The same is true of JavaScript, which is why Douglas Crockford in JavaScript: The Good Parts recommends always using ===. PHP developers would be wise to read that to see what warts PHP shares with some other popular languages.
Re: (Score:2)
Yup, Javascript's == operator is just as fucked up.
* http://strilanc.com/visualizat... [strilanc.com]
> PHP developers would be wise to read that to see what warts PHP shares with some other popular languages.
You and I wish that but sadly that will never happen based on their past apologists. Too much ego and stupidity at stake such as having a broken ternary operator [php.net] ?: as opposed to C. (WTF!?) And then you get stupid bugs like this memory leak [drupal.org] ... *sigh*
This post sums up the problem with the design of PHP:
http://www [reddit.com]
Re: (Score:2)
If the PHP devs would even fix any of these listed here, it would be a improvement.
* PHP: a fractal of bad design [eev.ee]
Re:A poor workman... (Score:4)
When the official docs has a page called Inconsistent Behaviours [php.net] you know there is a bigger problem
My favorite part is where whoever wrote that page actually uses MySQL's behavior to defend PHP's typing stupidity.
Re: (Score:2)
Re: (Score:3)
I wish this fuckling meme would die a thousand deaths, because it's so much bullshit. Good workmen ensure they have good tools. I have plenty of mediocre tools because I can't afford the very best ones.
I recently had some contractors in to replace my roof. Almost everything they had was Makita or Hilti. There wasn't a single 25 quid Homebase special power drill in sight. They always used the drills costing hearly half a grand. Why?
Because a Hilti drill is better in every single way (jus
s/power/out/ (Score:5, Funny)
It's definitely a house, but I'd disagree about the power part.
When does the powerhouse part start? (Score:5, Interesting)
PHP is Turing complete, so it's technically possible to write anything in PHP that you could write in another language. That seems to be about the most it's got going for it. PHP does nothing to help programmers write sane, maintainable code. It's almost impossible to develop without having a browser tab open to php.net ("The online docs are great!" "Well, they'd have to be."). There is zero consistency with things like argument order. Dangerous legacy concepts like "mysql_real_escape_string" are only recently deprecated and don't have a set removal schedule. It's a one-trick pony that's nearly useless outside its niche as a web page generation language. It's just a mess - a dangerous, unmaintainable mess.
I won't refuse to use an app just because it's written in PHP, but I do heavily weight it when comparing alternatives. PHP is a powerhouse in much the same way as McDonald's. It may be ubiquitous, but it still sucks and you have to question the judgement of anyone who chooses it to start a new project.
Re:When does the powerhouse part start? (Score:4, Insightful)
When you need low-cost web hosting, PHP is quite often the only choice other than Perl.
And Perl code looks like someone who vomited RegEx all over the place...
Re:When does the powerhouse part start? (Score:4, Interesting)
And Perl code looks like someone who vomited RegEx all over the place...
To be fair, you don't have to write perl like that, and in theory the optimization is good enough to where you don't actually get anything out of it unless you miss line noise. People just tend to. They write technically beautiful perl, which is a sure road to making someone else cry later.
I'm not an ubercoder so you can read my perl and I comment it so you can read it even more. So while some perl genius can do much more with perl than I can, my perl is probably more useful to future generations... unless we're going to cryogenically preserve some perl hackers
Re: (Score:3)
While I don't know whether you're peddling for said hosting provider or not, you cannot get a good VPS under $50/mo. I've tried lots and lots of them, once you start using your capacity (try to demand ~500MB RAM, a CPU and 100IOPS in a process for a few minutes), performance will tank. At that point you're better off with a good shared hosting.
It costs money to put a machine in a datacenter and you can only share said machine so much. Once you get >50VPS on a single host, you're screwed. And yes, it cost
Re: (Score:2)
I'm sorry, but web page generation language is "niche"?
I don't necessarily disagree with anything else you said, but I just found that an odd statement considering the ubiquitous of the web in modern times.
Re: (Score:3)
Yes, it is. There are plenty of languages that can cleanly generate web pages and system and application development. Web frontends are important and popular, but hardly the end-all be-all of modern programming. PHP is losing a lot of ground to single-page frameworks like AngularJS. It never had ground for backend platform development outside a handful of visible companies: for every Facebook, there are 100 companies with Java or Python infrastructure platforms.
I contend that PHP is good at exactly one thin
Re: (Score:2)
Re: (Score:3)
Realistically speaking, you'd be truely astonished about how much code actually gets written behind the scenes that never show up in 'things you see'. It makes a big difference when determining the true scope of software development as a whole. According to Google, there's around 18 million software developers in the world. They all aren't writing front-ends to your latest social media web site.
Its not surprising that PHP is a popular deployment platform for one painfully obvious reason: Hosting. Well, and
Re: (Score:3)
I'm sorry, but web page generation language is "niche"?
I don't necessarily disagree with anything else you said, but I just found that an odd statement considering the ubiquitous of the web in modern times.
Personally, I lost interest when the GP made it clear they consider PHP only good for generating web pages, and that it does nothing to help users write sane readable code (It's so so easy to write sane reliable reusable PHP that the next wet behind the ears college grad can make sense of and build upon, pretty much just don't be lazy, identify the PHP version, and use all the general programming language-agnostic skills like structuring and commenting.... Just because it doesn't force you to do something d
Re: (Score:2)
PHP is a powerhouse in much the same way as McDonald's. It may be ubiquitous, but it still sucks and you have to question the judgement of anyone who chooses it to start a new project.
Yes......to the point that you might be better off writing your own custom parser rather than using PHP. You'll be at a lower risk of security vulnerabilities, anyway.
Re:When does the powerhouse part start? (Score:5, Insightful)
PHP does nothing to help programmers write sane, maintainable code.
PHP does nothing to force programmers to write good code. It also doesn't force you to write bad code. It doesn't do anything, actually, other than waiting for you to use it however you want to. That means that the fact that you produce good or bad code is a reflection of your abilities instead of the language.
Re: (Score:2)
PHP was built to be a thin wrapper to C libraries. Don't blame PHP for what is not its fault.
It is at fault. It's the job of the wrapper to present a consistent interface to the things being wrapped. Otherwise, why even bother?
It is trivial to build very high performance web, command line, or GUI apps with PHP
And yet the only PHP command line utilities I've ever seen are shells for controlling PHP web apps. I've never seen a PHP GUI app so I can't speak to that.
For being as allegedly suitable for developing those kinds of things, almost no one seems to be doing it.
Party like it's 1995! (Score:5, Interesting)
I used the original, or close to it.
In 1995, I worked for a company in San Diego (MediaShare) that did Tesco's first online store.
MediaShare had a publishing tool called ProductBase, that put product details in a database, and you could publish to print or CD-ROM (remember those?). I proposed to my boss that we could also easily publish to HTML, and he let me explore it.
This turned ProductBase into basically a static-site generator, and Mediashare built some sites for some of their existing clients ("the threes" - 3COM and 3M - we put the 3M Adhesives catalog and 3Com's catalog of network products online for the first time) and some new ones.
One of the new ones was Tesco, and I built a little shopping cart with a very-close-to-1.0 PHP script running under Netscape Server CGI.
I would have never thought that PHP would still be kicking around this many years later. That was the last time I ever used PHP.
The author had no pretensions about PHP. It was a simple little script to help him with his personal home page, and he admitted his lack of programming expertise. Others turned it into a Frankenstein's monster.
Good PHP Code is Possible (Score:2)
Re: (Score:2)
Just like good Perl is possible.
[citation needed]
Re: (Score:3)
http://modernperlbooks.com/boo... [modernperlbooks.com]
80% is misleading (Score:4, Insightful)
PHP does not power 80% of the web, it is merely present on at least one server behind 80% of TLDs. That's not the same thing.
Re: (Score:3)
More specifically: if PHP is installed on a server, it typically advertises itself in the Host: HTTP header for every outgoing request, regardless of whether it was used to serve that request or not. Most other languages do not, even if they were used to serve that request. The tools that perform these language surveys can't adequately control for this, so it leads to a phenomenally large overestimation of the usage statistics for PHP.
Re: (Score:3)
It's exactly as I suggest:
We investigate technologies of websites, not of individual web pages. If we find a technology on any of the pages, it is considered to be used by the website.
So a single PHP file on slashdot.org would label it as "powered by PHP" despite everything else on the site being in perl.
We do not consider subdomains to be separate websites.
forums.mysite.com might use PHP, but that doesn't mean that www.mysite.com is "powered by PHP". But their stats count it as such.
In short, they treat PHP like a virus: *ANY* evidence of PHP on an entire TLD labels the entire TLD as "powered by PHP".
"Powerhouse" (Score:2)
PHP is the shitiest except... (Score:2)
PHP is the shitiest language out there except for all of the others.
Re: (Score:2)
:: isn't namespacing. It's the scope resolution operator.
\ is namespacing.
Re: (Score:2)
Now that MS is putting dot net everywhere, we are going to jump ship for C# and ASP Web API to create a SPA.
You criticize closures, dependency injection, generators........and you want to use C#?
Re: (Score:2)
i don't think you read what i wrote properly. i'm complaining about those things being implemented over stuff that could have a real impact on productivity, rather than a 'me too!' race to keep up with the big boys features.
Got it.
as for C# the ASP.net libraries look pretty good, as is the entity framework, linq is quite cool...
ASP.net is fine, and linq is cool, but I would stay away from Entity Framework. I've seen so much sorrow is produced by Entity Framework and Nuget.
If you do use Entity Framework, keep a clear line of separation between the DB layer and the rest of your code (ie, don't spread entity framework objects all over the place), so it can be removed without too much pain if necessary. You should have a clear line between DB code and the rest of your code anyway, just as general practice.
FWIW, I interview