Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 105579
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T01:27:41+00:00 2026-05-11T01:27:41+00:00

Background: I am taking a class at my university called "Software Constraints". In the

  • 0

Background:

I am taking a class at my university called "Software Constraints". In the first lectures we were learning how to build good APIs.

A good example we got of a really bad API function is the socket public static void Select(IList checkRead, IList checkWrite, IList checkError, int microseconds); in C#. The function receives 3 lists of sockets, and destroys them making the user have to clone all the sockets before feeding them into the Select(). It also has a timeout (in microseconds) which is an int, that sets the maximum time the server can wait for a socket. The limits of this is +/-35 minutes (because it is an int).


Questions:

  1. How do you define an API as ‘bad’?
  2. How do you define an API as ‘good’?

Points to consider:

  • Function names that are hard to remember.
  • Function parameters that are hard to understand.
  • Bad documentation.
  • Everything being so interconnected that if you need to change 1 line of code you will actually need to change hundreds of lines in other places.
  • Functions that destroy their arguments.
  • Bad scalability due to "hidden" complexity.
  • It’s required from the user/dev to build wrappers around the API so that it can be used.
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-11T01:27:42+00:00Added an answer on May 11, 2026 at 1:27 am

    In API design I’ve always found this keynote very helpful:
    How to Design a Good API and Why it Matters – by Joshua Bloch

    Here’s an excerpt, I’d recommend reading the whole thing / watching the video.

    II. General Principles

    • API Should Do One Thing and Do it Well
    • API Should Be As Small As Possible But No Smaller
    • Implementation Should Not Impact API
    • Minimize Accessibility of Everything
    • Names Matter–API is a Little Language
    • Documentation Matters
    • Document Religiously
    • Consider Performance Consequences of API Design Decisions
    • Effects of API Design Decisions on Performance are Real and Permanent
    • API Must Coexist Peacefully with Platform

    III. Class Design

    • Minimize Mutability
    • Subclass Only Where it Makes Sense
    • Design and Document for Inheritance or Else Prohibit it

    IV. Method Design

    • Don’t Make the Client Do Anything the Module Could Do
    • Don’t Violate the Principle of Least Astonishment
    • Fail Fast – Report Errors as Soon as Possible After They Occur
    • Provide Programmatic Access to All Data Available in String Form
    • Overload With Care
    • Use Appropriate Parameter and Return Types
    • Use Consistent Parameter Ordering Across Methods
    • Avoid Long Parameter Lists
    • Avoid Return Values that Demand Exceptional Processing
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

No related questions found

Ask A Question

Stats

  • Questions 58k
  • Answers 58k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • added an answer The Qt documentation has pages for that: Qt 5, Qt… May 11, 2026 at 8:51 am
  • added an answer I haven't been able to try either of these ideas,… May 11, 2026 at 8:51 am
  • added an answer If it truly takes that long to run, you could… May 11, 2026 at 8:51 am

Top Members

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.