HN Theater @HNTheaterMonth

The best talks and videos of Hacker News.

Hacker News Comments on
How To Design A Good API and Why it Matters

GoogleTalksArchive · Youtube · 124 HN points · 4 HN comments
HN Theater has aggregated all Hacker News stories and comments that mention GoogleTalksArchive's video "How To Design A Good API and Why it Matters".
Youtube Summary
Google Tech Talks
January 24, 2007

ABSTRACT

Every day around the world, software developers spend much of their time working with a variety of Application Programming Interfaces (APIs). Some are integral to the core platform, some provide access to widely distributed frameworks, and some are written in-house for use by a few developers. Nearly all programmers occasionally function as API designers, whether they know it or not. A well-designed API can be a great asset to the organization that wrote it and to all who use it. Good APIs increase the pleasure and productivity of the developers who use them, the quality of the software they produce, and ultimately, the corporate bottom line. Conversely, poorly written APIs are a constant thorn in the developer's side, and have been known to harm the bottom line to the point of bankruptcy. Given the importance of good API design, surprisingly little has been written on the subject. In this talk, I'll attempt to help you recognize good and bad APIs and I'll offer specific suggestions for writing good ones.

This talk is part of the Advanced Topics in Programming Series at Google.

Google engEDU
Speaker: Joshua Bloch
HN Theater Rankings

Hacker News Stories and Comments

All the comments and stories posted to Hacker News that reference this video.
Josh Bloch did a good google tech talk on general aspects of API design.

https://www.youtube.com/watch?v=heh4OeB9A-c

Jul 09, 2021 · waoush on Ask HN: API Design Courses?
Josh Bloch refactored libraries in Java that handles a bunch of data structures. It was widely considered a success and he teaches API design at CMU (was also an engineer at Google):

https://www.youtube.com/watch?v=heh4OeB9A-c&ab_channel=Googl...

https://www.cs.cmu.edu/~charlie/courses/15-214/2014-fall/sli...

These use Java as the language, but a bit of this applies to web APIs as well.

Sep 06, 2020 · 5 points, 1 comments · submitted by tosh
gabrielsroka
Original video, on Google's channel: https://youtu.be/aAb7hSCtvGw
That's such a great quote. Joshua Bloch's talk "How To Design A Good API and Why it Matters"[1] is one of my favorite ever

[1] https://www.youtube.com/watch?v=heh4OeB9A-c

Jun 06, 2016 · 119 points, 21 comments · submitted by jdnc
collyw
This sounds just a lot my systems analysis and design classes years ago (waterfall days). Who would think of gathering requirements and specs in these days of Agile....
Bombthecat
And Facebook showed clearly that you can change your API daily and no one cares.
guelo
Well, a lot of people care it's just that they don't have another option.
gnaritas
Everyone cared and complained loudly, so no, they really didn't.
caseysoftware
Yes, when you become a de facto standard with 1.6B users, you get to set the rules.

For everyone else, we have to provide good experiences with stable products.

jolux
And people say there's nothing copyrightable in an API design...
magicalist
Just because something is a creative act doesn't mean it's covered by copyright. If your functional creation is useful and novel, get a patent on it.
paulddraper
And when should I get a copyright?
jolux
I'd argue that the functional part of all APIs is nearly identical and that the creative part is what differentiates them.
magicalist
> I'd argue that the functional part of all APIs is nearly identical and that the creative part is what differentiates them.

You misunderstand.

It's not that functional things are covered by patents, "creative" things are covered by copyright. First, functional things can of course be creative; that's in the very definition of invention. Second, copyright is limited by law to the expression of an idea, not the idea itself.

US law is very clear about this:

> In no case does copyright protection for an original work of authorship extend to any idea, procedure, process, system, method of operation, concept, principle, or discovery, regardless of the form in which it is described, explained, illustrated, or embodied in such work.

Source code is indisputably copyrightable, but the question of law is if the functional aspect of an API, the way you interoperate with it, is protected by copyright. I believe Judge Alsup decided correctly that an API is a "system or method of operation", avoiding "the danger of conferring a monopoly by copyright over what Congress expressly warned should be conferred only by patent". I'm hopeful that the other circuit courts will agree.

jolux
And when you copy source code that has an API in it, you violate the copyright for that source code. This is not hard.
ciupicri
Someone should add (2007) to the title.
dang
Someone at your service. Kind of interesting that this was posted 15 times and never really discussed:

https://hn.algolia.com/?query=How%20To%20Design%20A%20Good%2...

ttam
interesting, any idea why? how many times were the other threads opened? etc
s_dev
This regularly happens with most HN submissions. New can be equally as fruitful in its own right as front page.
clumsysmurf
I think Android could have been much better if these principles were taken to heart during the design of the main APIs. From what I recall Josh collaborated with the Android team at some point; sadly too little too late.

IMHO almost every Android API i use violates some principle in this presentation.

pjmlp
So far I have spent more time on the NDK side than on the Java side, but for me the worst parts are the way Renderscript is bolted into the platform, all those m* member variables and anonymous classes everywhere.
miguelrochefort
Android indeed has some of the worst APIs. They feel extremely inconsistent.

iOS and Windows APIs are so much better.

I think it's fair to assume that most people share the same experience.

antiviral
My response (in good humor of course): https://cdn.meme.am/instances/500x/45999359.jpg

More seriously, every sufficiently complex, real-life design I have ever seen has been a set of compromises to best meet a set of competing constraints. The most that I hope that a book or a lecture can do is provide a general set of principles that an engineer should consider, and be mindful of they are going to violate them. I can't think of any very complex platform that hasn't run into this issue, and Android is no different, and probably fares better than most. Do you have any examples that you would prefer instead?

chubot
Uh, isn't the obvious comparison iOS?

I think the difference is that Apple had decades of institutional GUI expertise. Android engineers were more like hardware/OS guys as far as I can tell, and perhaps less experienced with the abstractions conducive to easily creating nice GUIs.

rqebmm
iOS and the Cocoa framework also have their fair share of hard to work with APIs. Like the OP said, you're always going to have to make compromises between conflicting requirements.
I'll leave this here from Joshua Bloch:

http://www.youtube.com/watch?v=heh4OeB9A-c

How To Design A Good API and Why it Matters

HN Theater is an independent project and is not operated by Y Combinator or any of the video hosting platforms linked to on this site.
~ yaj@
;laksdfhjdhksalkfj more things
yahnd.com ~ Privacy Policy ~
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.