What MVC framework for web development?

Answered in Quora:

Q: Why should I learn the combination of Python/Django rather than PHP, JS/Node? I am a web designer moving to web development. What is the scope of Python/Django?

Python/Django is like learning Ruby/Ruby on Rails. The equivalent in the PHP world would be PHP/Drupal or PHP/Laravel. Equivalents in NodeJS is not Node/JS but NodeJS/Meteor or NodeJS/Sails. In all those examples above the first part would be the underlying web language, and the second would be a MVC framework on top of the language.

(There exist web frameworks that do not provide MVC but just the web server and HTTP request-response plumbing. This isn’t common in PHP since it is embedded in a web server such as Apache or nginx, but in Python it would be flask and in NodeJS it would be Express or Koa— these are sometimes referred to as “microframeworks.”)

However, unlike on the front-end with things like Vue.js, React/Redux and AngularJS, full-service MVC web frameworks have increasingly less utility on the back-end. This is because most the the advantage a framework provides is to do heavy-lifting of tedious but repeatable tasks that require a lot of code (very common when building a user interface) the bulk of which has been moved onto the client in web development. What value is a MVC’s templating system and router when both have moved into javascript on the client-side and all interactions are through an API? This becomes more extreme with standardization of the data interface (a la GraphQL) and the prevalence of more service-oriented architecture popularized by microservices or serverless FaaS architectures.

MVC web-frameworks still provide things such as a configuration management, a data object model and abstraction, but even those can get in the way as a website becomes more mature and this pre-fab approach becomes a hinderance to future scalability and optimization.

Also, when not building to scale or building proof-of-concept, a full MVC architecture will help you starting out on server-side web development because it does all the heavy lifting for you. So it might be good to start out with one, though YMMV (your mileage my vary).

Continue reading about the state of web frameworks after the jump

What’s something very few people know about PHP?

Answered in Quora:

Q: What’s something very few people know about PHP?

It is mind-bogglingly popular for web development. That popularity hasn’t diminished even though conventional wisdom says otherwise…

Over a decade ago, I said about 40% of the top 100 websites use PHP — a number I pulled out of my ass — but nobody (not even the Ruby on Rails developers I pissed off) argued with that spurious claim. In 2009, Matt Mullenweg, the creator of WordPress became curious with my claim and did a survey of Quantcast’s top 100 sites — he got almost exactly 40. Even today, among the 10 most important websites, four use PHP as their language of choice — 40% again.

Overall, almost 80% of the internet is powered by PHP, and that has held steady for years! Newer web languages such as Ruby or NodeJS have only grown at the expense of other languages such as ASP, Java, or Perl.

Just one single application written in PHP, WordPress, is used by over 30% of all websites on the entirety of the internet. That’s more than double the market share since back when I last worked at Automattic/WordPress in 2011! It grew until it saturated its entire market — over 60% of all CMSs. In the CMS market as a whole, PHP-based CMSs occupy positions 1, 2, 3, 6, 7, and 8 in the top 10. The most popular non-PHP-based CMS is both closed source and sitting at only a 2.5% share.

It was estimated back in 2009 that there were 5 million PHP developers worldwide. It’s difficult to make this estimate today, but it’s obvious that that number has also held steady or grown.

These last few years, I’ve been commercially working in Ruby (on Rails), GoLang, NodeJS (for static servers), and Python (Django), but PHP is still also my love in that love/hate relationship.

Come see my talk in February 2019 at SunshinePHP in Florida!

Which has better packages, Python or PHP?

Answered in Quora

Q: Which has better packages, Python or PHP?

It depends on the target utility. In the Python world, the most common package installer is pip; the PHP world didn’t settle on a dominant format/installation for packages until composer, and that was relatively recently (last 4 years).

The reason for this is because PHP is a language almost exclusively designed for websites, and the economy of the open-source world has found that a dedicated application, instead of a framework or library could serve the bulk of most commercial needs. For instance, a single application, WordPress, four years ago (2014) accounted for nearly 20% of all websites and 50% of all blogs. There is little need package management when a single download and install (or a single click during ISP/hosting account creation or visit to site like Bitnami) can set up everything a typical website might need, fully under your control, with its own package infrastructure (plugin and theme ecosystem) where the underlying language (PHP) is pretty much irrelevant to the user.

Other languages like Ruby (with gems) or Go (import) or Javascript (with npm) which matured later and are more general purpose had a more robust package management and installation system. PHP Composer, in fact, is most modeled on npm.

Python, like Perl, predates these languages, but its general purpose demanded package management early in its development. However, because of this, pip takes less advantage of web conventions that npm does. Python has the added headache of version compatibility with its core runtime. Still pip is perfectly workable and relatively seamless and easy to use.

So which has better packages? The answer is it depends on the domain. In nearly any language you can find an adequate package for any of your needs, but overall you will find the packages are higher quality, more up-to-date, and sometimes just better overall in the domain the language seems to target well.

In my opinion, packages for data science/AI/ML applications, Python packages are second to none. As a PHP expert, I wouldn’t even bother looking in Composer for them and would instead find a PHP extension that binded to a dedicated engine optimized for the problem area or write a dedicated solution/web service in Python/flask and call it from PHP. If, for some crazy reason, I needed to do this entirely within PHP, I would search for the best solution in Python and see if someone has a port for that in PHP.

I would expect the same in DevOps for Python, but right now that space, like blogging (WordPress), seems to have dedicated solutions where a domain-specific language has abstracted one from the language-specific package management solution. For instance, in the configuration management space the top four applications are: Puppet, Chef, Ansible, and SaltStack. Of those four, I believe only one (Chef) exposes the underlying language (Ruby), and it does this to the DevOps engineer no more than WordPress exposes PHP to a blogger.

For server-side web-based packages, I feel PHP and Composer are going to have a solution for any problem PHP itself is capable of solving. That is a restricted set, however, as more and more work for web applications is being done on the client-side in Javascript and there is already an adequate toolchain for that (as well as a package management system in npm). Other web-based languages will probably have adequate solutions in this space with decreasing order/quality: Ruby (on Rails), Javascript (NodeJS), Python, Go, Perl, Java… The web problem is now pretty discovered at this point so there is less a need to adopt the bleeding edge in the web problem.

In with a bang, and out with a burrito

In the crossfire between the landlord and the city, Automattic got [evicted][evicted] from their home on Pier 38 on Friday.

At the end of every week, some of the [Automatticians][automatticians] have been having #burittofridays, so they made one last burrito run before closing the doors. As Beau, put it, “We came in with a bang, and out with a burrito.”

P9306488

In with a bang…and out with a burrito
Pier 38, South of Market, San Francisco, California

Olympus E-P2, Lumix G HD 14-14 f/4-5.8 OIS
1/320s @ ƒ9, iso 200, 19mm (38mm)

One of the advantages of working for a distributed company is that now that we are homeless, we’ll simply be working from home. The Bay Area crew won’t get to see each other each week though. 🙁

And here is one last parting shot from [our fearless leader][matt]:

Our fearless leader

Our fearless leader
Pier 38, South of Market, San Francisco, California

Olympus E-P2, Lumix G HD 14-14 f/4-5.8 OIS
1/400sec @ ƒ8, iso 200, 103mm (206mm)

He leaves us with a bit of= T.S. Eliot:

> We shall not cease from exploration
> And the end of all our exploring
> Will be to arrive where we started
> And know the place for the first time.

I’ll miss you guys.

[matt]: http://ma.tt “Matthew Mullenweg”
[evicted]: http://articles.sfgate.com/2011-09-09/business/30133602_1_evictions-tenants-carl-ernst “Pier 38 deemed unsafe; tech tenants evicted—SFGate”
[automatticians]: http://automattic.com/about/ “About Us—Automattic”

OpenSearch on WordPress.com

A couple months ago, I did something so small it doesn’t really deserve mention. Nial and I got OpenSearch working on WordPress.com for individual blogs:

Opensearch on WordPress.com

Search of the entire domain has always been working, but this allows you to add a special search for one blog. To activate this, open Firefox (or Internet Explorer), and click on the search dropdown and you’ll see a new entry to “Add your blog name.” Select that.

Maybe I’ll add a plugin to WordPress with this code. I’m not too sure there’s a need though since there are already a couple OpenSearch plugins and this one only works in WPMU and PHP 5. There’s also a couple of WordPress.com-specific features like tags, privacy flags, and blavatar support in this one.

TumblrPad

(Full disclosure: I work on Automattic, which makes software and services in the same space as SixApart.)

Image representing Six Apart as depicted in Cr...
Image via CrunchBase

Today, TypePad announced the launch of TypePad micro, which I found out about from John Gruber’s somewhat snarky tweet.

This marks the first time (to my knowledge) that SixApart is embarking on a free hosted blogging service, so it was definitely worth a look, especially given some of the things we’ve worked on, have recently got working, and will work on at here at Automattic. Besides, free is the price I like 🙂

Registering for a new account (especially with the Facebook Connect integration) was so easy, I thought, “Wait! Where is my Staples button?

 

It only took seconds to create this blog using the default look and feel.

The blog, though there is some confusion as to the URL, has an aesthetically pleasing layout. It certainly seems to share a lot of influences from Twitter, WordPress P2, Pownce, etc. but the biggest influence has to be Tumblr.

Continue reading about Thoughts about TypePad micro after the jump

Vivanista

(Disclaimer: I work for Automattic which contributes to the development of WordPress, WordPressMU, BuddyPress, and bbPress.)

At this month’s Bay Area WordPress Meetup, there were four interesting talks. One of which wised me up to the Zemanta WordPress plugin, which I’m using now, any content creator (or Another Search Startup) should check it out—it’s quite clever.

But the presentation I want to focus on in this article, was Annie Vranizan’s Vivanista demo.

The Vivanista homepage

Vivanista is a social network for women focusing on philanthropy. Even if you don’t have a passing interest in such things, the website deserves a look, it’s quite an attractive website and built in record time—a couple of months.

Being a vertical, this is mostly the territory of white-label social networks, and more recently, Facebook. In fact, if you look at their team, it reads more like a group blog than a company.

That’s because it is.

What makes Vivanista so interesting is that it is built on WordPress MU blog publishing platform in combination with Andy Peatling’s BuddyPress plugin.

Continue reading about More about how Vivanista was created after the jump