PHP: Is PHP losing popularity?

I was on Quora earlier this week and ran across a question asking Why is PHP losing popularity? along with the elaboration being:

I’ve been keeping my eye on job boards and tech media, and it seems that the new trend is up with Node.js and down with PHP, Ruby staying about the same.
I know every tool has its purpose, but most web applications could be built in any language and framework and fare all the same. PHP is surely scalable, fast enough, safe enough, and heavily supported. Facebook has been happy enough to keep it around, and they have a lot to own up to.

The top two answers basically declare that PHP is on its way out because developers have more options (Ruby, Python NodeJS, etc.) and because the PHP ecosystem is “standing still”. It’s pretty clear that both of these answers are incomplete, if not outright wrong but then where does the truth lie?

Since this isn’t high school there isn’t a universal metric for how to evaluate the popularity of a given programming language. People tend to use things like search trends, job salaries, or the number of questions tagged on StackOverflow. These KPIs are fine for vanity comparisons but they don’t really reveal anything about the velocity, evolution, or enthusiasm for a language or framework. Since we’re concerned specifically with PHP, it’s easier to pick out specific examples that demonstrate its continuing popularity.

Drupal and WordPress

Although treated with disdain by developers, both applications power hundreds of millions of websites. According to Wikipedia, “WordPress is used by more than 18.9% of the top 10 million websites as of August 2013.” and Drupal “is used as a back-end system for at least 2.1% of all websites worldwide”. Which, to put in perspective, are both absolutely staggering numbers. On top of that, Automatic and Acquia, the companies commercially backing WordPress and Drupal, have been raising money and growing at a phenomenal pace.

So what does that mean for PHP? Velocity. With two well funded commercial companies actively developing, selling, and supporting PHP software there will be an increasing number of PHP sites coming online every day.

Symfony, Doctrine, and Zend

In the last few years, all 3 projects have completely overhauled their architectures and rewritten their code bases to incorporate from their respective “version 1s”. A total rewrite is a heroic feat for any project, let alone a popular open source project with thousands of users. All three rewrites have had a positive effect on the PHP community as a whole, including powering new frameworks (Symfony2, Laravel, etc.), enabling consolidation (Drupal 8 powered by Symfony Components), and of course pushing developers to evaluate PHP for new projects.

For PHP, this certainly signals a continuing evolution and a willingness of the community to learn, adapt, and evolve as the web changes.

The Language / PHP Internals

Unfortunately, this is one facet that strongly negatively affects the perception of the PHP ecosystem. Looking at PHP the language, plenty has been written bemoaning the inconsistencies, “wtfs”, and generally bizarre paradigms that the language constructs introduce. Although things have certainly gotten better, a lot of the same issues people were complaining about in PHP4 still exist today with no roadmap for them to be resolved.

Related to the language, is the PHP internals mailing list where core devs discuss language changes and generally how PHP will evolve. Most recently, core dev Anthony Ferrara outlined the major problems with the internals mailing list and generally why he feels the project is in trouble.

The issues with the PHP the language and its apparent lack of real evolution clearly affect the enthusiasm for the ecosystem. Outsiders look in and ask why we’re dealing with a “shitty” language while insiders are stuck defending PHP by pointing to features it got in 5.4 while meekly dodging the fact that there’s still no real unicode support.

So is PHP becoming less popular? Almost certainly not. In the last few years, dozens of interesting new tools and frameworks have been built and at least two VC funded companies have built successful business on software powered by PHP. Unfortunately, the perception of PHP the language as a ghetto is still persistent and the internals team seems to have no plans to change it.

Javascript: Hijacking document.form.submit()

Earlier this week, I was helping a client of ours interface with a 3rd party widget on a site they work with. What the widget basically does is allow the user to input some information which is then POST’ed to another 3rd party site.

What our clients were looking to do was capture the information in the form before it was submitted, process it before the user left the page, and set any cookies on the user if necessary. Simple enough right? Use jQuery to trap the form’s submit event, do the processing dance, and then allow the form to submit normally.

So I implemented the code as described but for some reason the jQuery submit() handler was never being triggered. Perplexed, I looked through the actual widget code and it turns out that the widget was using a <a> tag with an onclick handler which eventually called document.someForm.submit(). Turns out, the jQuery submit() handler won’t trigger when a form is submitted in this fashion.

Thankfully, it’s relatively straightforward to get around this. You just need to override the form element’s submit() function with one of your own and then eventually call the original function once you’re done.

Well thats about it – As always, questions and comments welcome.

Microsoft & Nokia: Haters Gonna Hate

On the East Coast, most of us woke up from a long weekend to news that Microsoft had purchased Nokia’s mobile hardware manufacturing business. The news didn’t exactly come as a shock, given that the companies had announced a particularly Microsoft friendly operating agreement where Nokia Lumina phones would ship with Windows. What did surprise me was the general skepticism and outright negativity surrounding the deal. From Fred Wilson to the several threads on Hacker News, it seemed like everyone was happy to discount this deal as DOA and go back to arguing about Android and iOS. Personally, I wouldn’t immediately count a combined Microsoft & Nokia team out of the mobile fight for a couple of key reasons.

Consumers are fickle and upgrade cycles are short

This point was brought up on Hacker News and I think it’s one of the key points surrounding this discussion. Consumer attitudes and loyalty surrounding consumer electronics have historically been fairly transient. Six years ago, the iPhone was just hitting store shelves and every teenager was clicking away on a Blackberry. Contrast that with today, where RIM is largely an afterthought and Apple is clearly the dominant player. Discounting that a combined Microsoft/Nokia team could make significant inroads

Along with volatile loyalties, consumer electronics, especially mobile phones have a short upgrade cycle. Compared to desktops or laptops, most American consumers predictable replace their cell phones every 2 years because of free carrier upgrades. Because of this, the mobile phone ecosystem has the potential to change and evolve at a much faster pace than it’s predecessors. This tight upgrade cycle benefits Microsoft/Nokia since it gives them the opportunity to iterate and improve devices much faster than say in the console market where Microsoft has previously used this strategy.

Developers care about install base but it isn’t the only thing

Several comments around the web today pointed to the staggering number of iOS and Android devices already in the wild and made the contention that it doesn’t even make sense for Microsoft to compete. Their primary contention was that since users select a mobile OS based on available apps and developers will only build apps for the biggest platforms there’s a vicious cycle of the less popular platforms not garnering developer attention or user adoption.

The absolute number of available devices is obviously important to developers but it isn’t the only thing they care about. Resource constrained startups are still often building iOS first or iOS only and even larger companies also sometimes focus primarily on their iOS builds. Reasons for this range from everything from the lack of device fragmentation to the engagement and willingness to spend of iOS users.

A combined Microsoft/Nokia should be able to control device fragmentation and also have the software engineering chops to create a best in class toolchain. Visual Studio is generally regarded as a fantastic IDE and if Microsoft can parlay it into creating a true “mobile first” IDE I think they’ll be able to attract developer talent. Another interesting angle is what approach Microsoft takes with HTML5/JS, especially “crossbuild” tools like PhoneGap and Titanium. Playing from third place would give the combined Microsoft/Nokia ample reason to support these crossbuild tools to get more apps onto Windows.

The Living Room and Facebook

It’s becoming clear that the “battle” for consumer living room’s is far from over. With the proliferation of InternetTV devices like the Roku and AppleTV to the announcement of next generation consoles, it’s clear that companies are still very interested in “owning” the living room. The lay of the land is also constantly changing as companies move throughout the value chain. So where does that leave Microsoft? Well its not clear. There’s clearly a lot of XBoxes in living rooms and they’re years away from having any unified mobile + living room experience but that could ultimately serve as a key differentiator and bargaining chip with content owners.

Facebook has always wanted deeper integration on mobile and their Android Home app only solidifies that fact. Microsoft and Facebook also share close ties, Microsoft was a large, pre-IPO investor and Bing is currently powering Facebook’s web search. Given this close relationship, it seems obvious that the two companies would work to tightly integrate Facebook into a phone that was developed in-house. The results could obviously go either way, but there’s no denying that social has helped drive mobile adoption in the past.

However, despite their combined potential the two companies are still facing frighteningly large challenges. With Balmer’s announced departure, the biggest one is certainly who is qualified and willing to lead such a large, multifaceted, corporation down a path that will certainly involve uncomfortable if not downright impossible choices. In any case, consumers and developers shouldn’t count Microsoft out just yet, if nothing else to prevent a Goolge/Apple duopoly in the mobile space.

Fun: Three programming languages I want to experiment with

I spend my days almost entirely developing in PHP and Javascript with the occasional trip to Bash. For the most part, the style of the code ends up looking mostly the same, object oriented PHP and a mix of OO and functional Javascript. Because of this, I’ve been researching a couple of new languages I’d be interested in testing out. Anyway, here is my list – I’d love any feedback or suggestions!

Scala

From Wikipedia:

Scala is an object-functional programming and scripting language for general software applications, statically typed, designed to concisely express solutions in an elegant, type-safe and lightweight (low ceremonial) manner. Scala includes full support for functional programming (including currying, pattern matching, algebraic data types, lazy evaluation, tail recursion, immutability, etc.). It cleans up what are often considered to have been poor design decisions in Java (e.g. type erasure, checked exceptions, the non-unified type system) and adds a number of other features designed to allow cleaner, more concise and more expressive code to be written.

So what makes Scala interesting? Personally, a couple of things stand out. First, the type system looks powerful while also being unobtrusive enough to not offend my dynamic sensibilities. I’ll butcher any explanation of how it works but this presenation does a much better job. Another interesting Scala feature is its rich support for functional programming techniques. I’m excited to try out things like currying and pattern mathing. The last Scala feature that is particularly appealing is that it can be run through the interpreter or compiled to a JAR. Because of this, it would facilitate writing simple “one off” scripts and running them through the interpreter.

Go

Go has been making the rounds on the blogosphere lately so naturally its piqued my interest. From Wikipedia:

Go aims to provide the efficiency of a statically typed compiled language with the ease of programming of a dynamic language. Other goals include:

  • Safety: Type-safe and memory-safe.
  • Intuitive concurrency by providing “goroutines” and channels to communicate between them.
  • Efficient garbage collection “with low enough overhead and no significant latency”.
  • High-speed compilation.

At face value, Go looks familiar and comfortable primarily because of its C inspired syntax and imperative style. The big ticket Go features that look the most interesting are concurrency support and its package and dependency management system. I haven’t written much (or any?) concurrent code and exploring Go’s “goroutines” seems like a great place to start. The official docs provide a great overview of the concurrency features Go exposes. Managing dependencies is painful and nothing is worse than getting stuck in dependency hell. Go has a unique approach to solving these issues, favoring convention over configuration. This post has a great rundown of why Go’s solution looks like a win.

Lua

From Wikipedia:

Lua , from Portuguese: lua meaning moon; explicitly not “LUA”) is a lightweight multi-paradigm programming language designed as a scripting language with “extensible semantics” as a primary goal. Lua is cross-platform since it is written in ISO C.[1] Lua has a relatively simple C API, thus “Lua is especially useful for providing end users with an easy way to program the behavior of a software product without getting too far into its innards.”

Functionally, Lua is a fully featured scripting language written in C which makes it a perfect candidate for embedding places where users need to be able to “script” the behavior of a program. Looking at Wikipedia, Lua has made its way into dozens of projects – including Nginx and Apache. From a language perspective, Lua looks “clean” and somewhat similar to Javascript but the most interesting feature is the possibility of embedding it into a host application. PHP also has out of the box functionality to support embedding Lua.

Anyway, that’s my list – I’d love to hear about any other languages worth checking out.

Thoughts: What is the ultimate brainstorming tool?

Lately, I’ve become interested in the concept and process of structured brainstorming. What makes “structured” brainstorming distinct from its passive cousin is that it has some sort of process and is organized at a specific time. I’d argue that the goal of a structured brainstorming session should be to go in with a loose set of big questions, brainstorm, and then come out with a set of refined questions, themes, and next steps. In our experience, the best way to mentally organize a brainstorm is to group things like ideas, questions, and links under “themes”, continually add to the them, and then sort and prune at the end. Unfortunately, we haven’t really found a software tool that makes this process awesome, let alone easy.

So using this framework, what would make the ultimate brainstorming tool?

Non-linear

One of the most powerful aspects of a brainstorming session is that its non-linear. You easily be able to add “first act” ideas at the same time as adding “late stage” themes without disrupting the flow. In addition to adding, being able to organize information in a non-linear fashion avoids introducing a rigid structure, before the data is really understood.

Organizing data in a non-linear format is one of the primary issues of using a regular text document for a brainstorm. It makes it difficult to add things “out of order” and immediately introduces a rigid structure, since everything is flowing top to bottom.

Collaborative

Successful collaboration is a key point in any team activity and brainstorming is no different. An effective tool should effectively involve all participants by making it easy for everyone to contribute. Since the goal is to eventually prune down anyway, capturing input from everyone involved strengthens the process since it gives a voice to viewpoints that might otherwise go unheard. In our experience, collaborating around a whiteboard works well until 4 people are involved and then it quickly degenerates. By 6 actors, including key stakeholders, some people are hesitant to contribute since they’re afraid of “looking dumb”.

An ideal tool would allow everyone to easily contribute without disrupting active conversations and also without fear of embarrassment.

Linking

Having a ton of great data is awesome but without any way to develop links between the nodes you’re really just left with a massive list. Linking as a feature would let you “chain” pieces of data together, similar to “a href”s in an HTML document, allowing you to develop richer connections within your data.

Current digital tools like Trello or Evernote support linking and I’d imagine an ideal tool supporting it in a similar fashion. The primary concern would be making it easy to visualize the connections between nodes to drive a better understanding of how things fit together.

Ok so we’ve laid out some features, now what does this thing look like? I think ideally this is a SaaS product with a mobile client that looks like a giant table top. The table top would let you add themes, elements within those themes, and also let you create links between anything you’ve added to the table. So does this tool exist? Unfortunately, I don’t think so – or at least I haven’t found it yet.

Anyway, I’d love to hear about your experiences with brainstorming, especially what tools you’ve used.