Win a copy of liveProject: Protecting User Data with Spring Security and OAuth2 this week in the Spring forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • paul wheaton
  • Devaka Cooray
  • Jeanne Boyarsky
  • Tim Cooke
  • Liutauras Vilda
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Piet Souris
  • salvin francis
  • Mikalai Zaikin
  • Himai Minh

Practical API Design: Chapter 13 - Extreme Advice Considered Harmful

Posts: 16140
Mac Android IntelliJ IDE Eclipse IDE Spring Debian Java Ubuntu Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
This is probably the chapter I have the most trouble with in practice. I get where he's coming from with not blindly accepting the opinions of people just because they are "senior" or your "elder". I can even accept the need to strike a balance and make tradeoffs between different aspects of the API design: beautiful APIs vs deprecations, correctness vs ease of use, simplicity vs variety/depth/breadth of use, performance vs premature optimization, backwards compatibility vs practical impact of incompatibilities, and symmetry vs other aspects like simplicity or potential to evolve.

It's the decision process in making tradeoffs and finding a balance that's hard to do in practice. That's where the "art" comes in and skill, experience, and aptitude really make a difference. In almost all aspects of the API design that he cited, I tend to start by favoring the former: beauty, simplicity, correctness, backwards compatibility, symmetry. The exception is performance. I'm a big believer of not optimizing prematurely so I take care of all the other aspects first. Seems like if you do that, performance very seldom needs much attention. And when it does, never forget that developers are notoriously bad at optimizing code based on gut feeling and intuition. Use a profiler!
Friends help you move. Good friends help you move bodies. This tiny ad will help:
Thread Boost feature
    Bookmark Topic Watch Topic
  • New Topic