Skip to content

Instantly share code, notes, and snippets.

@philsturgeon
Created March 31, 2016 21:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save philsturgeon/e87785a4fc96760683700d0907a18b47 to your computer and use it in GitHub Desktop.
Save philsturgeon/e87785a4fc96760683700d0907a18b47 to your computer and use it in GitHub Desktop.
What Rails Can Teach PHP About Building APIs

As somebody who's built APIs with PHP since 2009, and built APIs with Rails for the last two years, the contrast in some of the tooling available is mind-blowing. When it comes to factories for generating test data, spec-driven testing with tools like RSpec, mutation testing, simplistic state machines, serialization and deserialization in JSON-API, REPL debugging with breakpoints, file upload handlers, etc., Ruby (and Rails) very often has a strong lead in maturity of the tooling.

Objectively speaking, PHP either does not have some of these tools, or they're immature in comparison. This is by no means a fault of PHP as a language or a community. Ruby has had Gems for far longer than PHP has had Composer, and while PHP is starting to learn how to get this done in a post-framework-everything world, it has a way to go.

This talk looks at some of the cool stuff Ruby can do, and some of the lesser known tools that provide similar functionality in PHP.

@ramsey
Copy link

ramsey commented Mar 31, 2016

I like the abstract. Maybe change the title from "Rails" to "Ruby?" I only make this suggestion because the statement "Ruby (and Rails) very often has a strong lead in maturity of the tooling" seems to indicate that the focus is on Ruby and not just Rails.

@eryno
Copy link

eryno commented Apr 1, 2016

I like it, and I'd totally go to this talk. My only feedback is grammatical/stylistic:

"Ruby has had Gems for far longer than PHP has had Composer, and while PHP is starting to learn how to get this done in a post-framework-everything world, it has a way to go."

  1. That sentence is a little long, and I got lost in it.
  2. It's not clear what "this" is referring to.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment