Your SlideShare is downloading. ×
Web APIs: The future of software
Web APIs: The future of software
Web APIs: The future of software
Web APIs: The future of software
Web APIs: The future of software
Web APIs: The future of software
Web APIs: The future of software
Web APIs: The future of software
Web APIs: The future of software
Web APIs: The future of software
Web APIs: The future of software
Web APIs: The future of software
Web APIs: The future of software
Web APIs: The future of software
Web APIs: The future of software
Web APIs: The future of software
Web APIs: The future of software
Web APIs: The future of software
Web APIs: The future of software
Web APIs: The future of software
Web APIs: The future of software
Web APIs: The future of software
Web APIs: The future of software
Web APIs: The future of software
Web APIs: The future of software
Web APIs: The future of software
Web APIs: The future of software
Web APIs: The future of software
Web APIs: The future of software
Web APIs: The future of software
Web APIs: The future of software
Web APIs: The future of software
Web APIs: The future of software
Web APIs: The future of software
Web APIs: The future of software
Web APIs: The future of software
Web APIs: The future of software
Web APIs: The future of software
Web APIs: The future of software
Web APIs: The future of software
Web APIs: The future of software
Web APIs: The future of software
Web APIs: The future of software
Web APIs: The future of software
Web APIs: The future of software
Web APIs: The future of software
Web APIs: The future of software
Web APIs: The future of software
Web APIs: The future of software
Web APIs: The future of software
Web APIs: The future of software
Web APIs: The future of software
Web APIs: The future of software
Web APIs: The future of software
Web APIs: The future of software
Web APIs: The future of software
Web APIs: The future of software
Web APIs: The future of software
Web APIs: The future of software
Web APIs: The future of software
Web APIs: The future of software
Web APIs: The future of software
Web APIs: The future of software
Web APIs: The future of software
Web APIs: The future of software
Web APIs: The future of software
Web APIs: The future of software
Web APIs: The future of software
Web APIs: The future of software
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×
Saving this for later? Get the SlideShare app to save on your phone or tablet. Read anywhere, anytime – even offline.
Text the download link to your phone
Standard text messaging rates apply

Web APIs: The future of software

677

Published on

Since the beginning of software, we have bundled frequently-used functionality into libraries -- both our own, and those created by third parties. APIs tell software developers how to use a library, …

Since the beginning of software, we have bundled frequently-used functionality into libraries -- both our own, and those created by third parties. APIs tell software developers how to use a library, and make it possible for developers to treat libraries as black boxes, considering only what the library does, not how it does it.

Today, as software moves increasingly to the Web, APIs and libraries are also moving to the Web. This means that you can now outsource, by means of Web APIs, a huge amount of your application's functionality.

What does this mean for software developers? What does this mean for the future of software development? In this talk, I describe the past, present, and future of APIs, and how I believe the Web is changing the landscape.

Published in: Technology
0 Comments
1 Like
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total Views
677
On Slideshare
0
From Embeds
0
Number of Embeds
3
Actions
Shares
0
Downloads
26
Comments
0
Likes
1
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide

Transcript

  • 1. APIs: The future of the Web Reuven M. Lerner • reuven@lerner.co.il February 27th, 2014
  • 2. Web APIs: The future of software Reuven M. Lerner • reuven@lerner.co.il February 27th, 2014
  • 3. In the Beginning, There were Ones and Zeroes.
  • 4. Software • Software is the magical collection of instructions that control a computer • At the end of the day, we know that there are ones and zeroes in there. • No matter what language you use, the programs you write are turned into ones and zeroes when they are executed.
  • 5. Abstraction • So, why not just use ones and zeroes? • Abstraction: One of the most important concepts in computer science! • Abstraction lets you think big thoughts, not worrying about the underlying infrastructure or implementation
  • 6. High level • The greatest abstractions happen in "high-level" languages, such as Python, Ruby, JavaScript, and Lisp • In low-level languages, I work hard to suit the computer. • But in high-level languages, the computer works hard to suit me, by black-boxing the details!
  • 7. Repetition • No matter what language you use, you'll eventually find yourself repeating code. • How can you deal with this problem? • Put the code in a common place, and then use it again and again. • Write it once, and then use it — ignoring the implementation
  • 8. Programmer virtues • "The three virtues of a programmer: laziness, impatience, and hubris" — Larry Wall • Laziness: Write it once, and then reuse it many times!
  • 9. DRY • This leads directly to the idea of DRY — write code only once. • Don't repeat yourself! • Don't repeat yourself!
  • 10. Libraries of code • Writing libraries of code, which can then be used by many different programs, is an extremely common programming task. • With a library, we can concentrate on the most important things to our business, rather than focus on infrastructure.
  • 11. API • "Application Programming Interface" • What is the interface to a library of code? • Function/method names • Effects (what each function does) • Parameters expected by each function • Return value(s) from each function • What happens if there was an error?
  • 12. Modern operating systems • What is an operating system? A bunch of libraries that abstract away the hardware and many other aspects of computers: • Networking • Printing • Running multiple programs • Drawing to the screen
  • 13. Operating systems • In other words, an operating system is just a collection of APIs! • You can write your own printing system, but why bother? Just use the printing API that the operating system provides.
  • 14. From Wikipedia • Win32 (Windows) • • The Windows API, informally WinAPI, is Microsoft's core set of application programming interfaces (APIs) available in the Microsoft Windows operating systems. Cocoa (Mac OS X) • Cocoa is Apple's native object-oriented application programming interface (API) for the OS X operating system.
  • 15. RPC • "Remote procedure call" • Don't invoke a library on the local computer — rather, invoke it on another computer! • Abstraction #1: The software library does some task for me • Abstraction #2: I don't have to know how that things are executing remotely
  • 16. What is the Web? • URLs — what I want, where it's located, and how I get there • HTTP — a great way to get there • HTML — a type of content
  • 17. The entire Web, explained • A browser sends an HTTP request to a server. • The server sends a response (perhaps content, perhaps an error message, perhaps a redirect), and hangs up.
  • 18. What if machines browsed, and not humans? • The Web was designed for people. • But you know, the combination of URLs, HTTP, and HTML could be used by computers, too. • And then you wouldn't need to have a "browser" sending a request. It could be any program, right?
  • 19. XML • "Extensible markup language" • Not a markup language, but rather a way to define new markup languages! • Now computers can send requests and get results not in human-centric HTML, but in machine-centric XML.
  • 20. XML-RPC • Dave Winer suggested that we could use a combination of XML and HTTP for RPC! • • Works across programming languages • Used libraries (XML, HTTP) that already existed • • Works across the Internet Set up a client or server in minutes! But is this really RPC? Actually, yes!
  • 21. SOAP • Simple Object Access Protocol • Officially: A more modern, well-defined version of XML-RPC • Realistically: Massive overhead and complexity
  • 22. "Web Services" • Both XML-RPC and SOAP are protocols that let you advertise Web services • In other words: APIs against which we can make calls from anywhere on the Internet! • There's a whole alphabet soup of standards that were written to address this problem. • But today, APIs are often cleaner and leaner than this, implemented in different ways
  • 23. REST • Representational State Transfer (Roy Fielding) • URLs should be nouns, and different HTTP actions should describe the actions on those nouns • Not a lot of documentation is needed, because REST standardizes how things look on the outside • Wait, how does it look on the inside? What does the implementation look like?
  • 24. JSON • JavaScript is everywhere! • And JavaScript syntax is easy to understand • So Douglas Crockford created "JSON" — JavaScript Object Notation — which makes XMLRPC look clunky and fat by comparison • A huge number of programming languages support JSON
  • 25. REST + JSON • Modern APIs are thus standardized via REST, and exchange data using JSON • Many frameworks, such as Ruby on Rails, make it trivially easy to create RESTful JSON APIs
  • 26. Um. OK. • Web APIs let programs talk to other programs. • And? Why should I care? And how is this the future of software? • Two reasons: • All software is moving online, and • The entire Internet is becoming our OS!
  • 27. If an OS is a collection of APIs you can call, then the Internet is becoming a massively distributed OS!
  • 28. In other words • Build the parts of your application that are special and specific for you. • The rest of your application should leverage APIs on the Web • And by the way, your application can offer APIs as well, leading to a complex web of API calls!
  • 29. Example: FedEx • One of the first companies to offer an API • (Yes, beyond the Web site!) • Benefit to your company: Create custom software that handles all of your package needs, with the appropriate permissions and reporting • Benefit to FedEx: Lock-in, customer satisfaction
  • 30. Example: Payment • It used to be difficult to deal with payment and ecommerce — because you implemented it yourself • But now we have APIs that make it easier to deal with. PayPal, Strip, Dwolla, Amazon, PayByGroup. • How can we simplify the API? Simple: Offer a library that wraps up those APIs. • Charging credit cards becomes a one-line task!
  • 31. Example: Authentication • Why store usernames and passwords? • • Users need to remember another password • • People don't trust you You're vulnerable Solution: Let people log in via Facebook, LinkedIn, Google, etc.
  • 32. Example: New York Times
  • 33. What does this mean? • The New York Times is not only a source for news. • It's now a source for data that people can use to inform others. • It becomes a platform on which you can create new content, and do meta-reporting
  • 34. Weather APIs • wunderground.com offers APIs to current weather data • Get weather data, and integrate it into your app • Location-aware apps on your phone can use this to show weather wherever you are!
  • 35. Amazon Web Services • Everything is available via an API! • Start new servers, shut down existing servers, and monitor servers — all via APIs • Your application can thus spin up (and spin down) entire servers whenever it needs, using nothing more than URLs and JSON!
  • 36. Amazon?!? • Yes, they make billions off of their cloud servers • You can manage those servers via various APIs • Want to manage buying, selling, and management of products on Amazon? Sure, there are APIs for those, too…
  • 37. Geocoding • Have a street address, and want to know its longitude and latitude? • Have an IP address, and want to know its country? • There are APIs for this, generally from mapping companies (e.g., Google, Bing, MapQuest)
  • 38. Geocoding IP address def geocoder_decode(ip_address) Geocoder.search(ip_address).location rescue nil end
  • 39. A/B Testing • optimize.ly lets you do A/B ("split") testing on your Web site by including a snippet of JavaScript • How does it work? By accessing Optimizely's API • How can you modify its behavior? By accessing Optimizely's API from your own program!
  • 40. Storage • Dropbox and Google Drive offer APIs! • Store and retrieve Dropbox documents from within your program • Use Dropbox for storage, and it automatically replicates!
  • 41. Facebook • Get access to a user's personal information — name, address, and interests • You also get information about the person's friends! • This is potentially a huge privacy issue! So users need to agree to add Facebook API applications, and specifically see what capabilities apps want • (The same is true for LinkedIn, of course.)
  • 42. Twitter • Twitter has long offered an API, allowing anyone to tweet from within a program • (You can also read and search through tweets)
  • 43. Using the API def tweet_person Twitter.update("Welcome, #{fullname}, to the #NetLogo Modeling Commons, our #{ActiveSupport::Inflector::ordinalize(Person.count)} user!") end
  • 44. SOA • Service-Oriented Architecture • Instead of a big Web application, write many small ones that talk to each other via APIs! • Each service can then be created, updated, and maintained by different teams. Or companies. Or individuals. • Easier to create, maintain, scale, and understand
  • 45. SaaS APIs • SaaS — software as a service • Applications that run on a server somewhere; they may have a browser-side, as well. • A growing number of SaaS companies offer APIs. This turns the application into something beyond what you use it for in your browser.
  • 46. Example API: Harvest • "Harvest," time-tracking and invoicing software, has an API • The time-tracking API lets you keep track of your time. Build a new widget or app that starts and stops your clock, for example. • The extended API lets you edit your clients, projects, and tasks!
  • 47. Example API: Job seeking • Looking to hire people? You can use an API to post jobs (on monster.com, linkedin.com, and elsewhere) • Looking for work? You can search via an API! • Trying to match jobs and people? You can use these APIs, and build a company on top of them!
  • 48. Example API: Search • Run searches against your favorite search engine • • (Or run searches against multiple search engines, and compare the results!) All search engines provide APIs that let you build on top of what they offer
  • 49. ProgrammableWeb.com • Not sure what's out there? • ProgrammableWeb.com lists as many APIs as it can, categorized by topic, protocol and data format. • Don't reinvent the wheel — find one that has already been rolling for a while, and integrate it! • (Let someone else do the hard work of implementing things. Laziness wins again!)
  • 50. Connecting • IFTTT ("If this, then that") • It's an connector for APIs! • You can say, "When I'm tagged in a photo on Facebook, post a note to my blog." • Once a company is part of the IFTTT family, you can connect APIs for added
  • 51. Mobile apps • Mobile apps all use APIs! • They usually talk to Web sites via XML or JSON • In other words, a mobile app has two parts • • • Client (running on the device) Server (offering a JSON API) Support iOS and Android? Two clients, one API!
  • 52. Single-page apps • As browsers get smarter, more of the app is being pushed onto the client, running in JavaScript • So instead of each click being a new HTTP request, you can create a whole application in the browser that occasionally syncs with a server • How does it sync? APIs, of course! • Google Docs work just like this
  • 53. Even the browser… • How do programs talk to the browser? Via APIs! • DOM — API for us to read and update a Web page • Call APIs from the browser, to talk to lots of servers • e.g., Disqus, Facebook, LiveFyre — add discussion to any page!
  • 54. APIs on the server • Consume: • • Logging, payment, analytics, authentication Offer: • Authentication, read/write your unique data, aggregation, analytics
  • 55. Make a fortune! • The path to startup success: 1. Come up with an idea 2. ??? 3. Profit!
  • 56. What's stage 2? • The path to startup success: 1. Come up with an idea 2. Offer an API to information or analysis that no one else can offer 3. Profit!
  • 57. $
  • 58. Opportunities in your work? • An API doesn't have to be big or complex • It can often solve simple problems — saving you money and making you more efficient • Don't e-mail Excel files to one another. Rather, create an API on a local server!
  • 59. Thanks! Any questions? • You can always find me at: • reuven@lerner.co.il • http://www.lerner.co.il/ • Get my newsletter, with articles and insights like this! • 054-496-8405 • “reuvenlerner” on Skype • @reuvenmlerner on Twitter

×