Questions tagged [api-design]

16 questions
19
votes
3 answers

Is there a theory of exception hierarchies?

I'm familiar with a dozen of programming languages which have exceptions in some way, yet I came to witness two "pathological" tendencies. There doesn't seem to be a common pattern or hierarchy of exceptions. Every language basically rolls its own…
wvxvw
  • 1,388
  • 9
  • 13
4
votes
0 answers

"Programing in goals" as an alternative to defining APIs (from B. Victor's talk The Future of Programming )

In his talk The Future of Programming, in the third section of the talk about "programming using goals", Bret Victor says this: https://vimeo.com/71278954 [15:20] What won't work, what would be a total disaster, is---I'm gonna make up a term…
user7610
  • 143
  • 7
4
votes
2 answers

What's the difference between declarative syntax and encapsulation?

I had been first introduced to the idea of declarative syntax when using Angular JS. From what I understand, the idea is that you say, "do this" instead of "in order to do this, do this, this and this". You don't care how it's done, you just want it…
4
votes
1 answer

Operator overloading: Java vs. Python

Why operator overloading was included in Python and not in Java? How does one decide to include or exclude operator overloading in a programming language? It is said here that operator overloading is excluded from Java to make the language…
Zedaiq
  • 159
  • 4
2
votes
2 answers

How to structure device driver software?

I'm asking here for both the scientific, programmatic, and structural format of a device driver. What does that mean? Basically, I'm not asking how to write a driver in general ... I'm asking how to structure one to behave as software that can act…
2
votes
3 answers

Can comparison sorts be implemented with an opaque compare-and-swap operation?

The standard library sorting functions I'm familiar with in C and Java accept a user-defined comparator, which takes two elements a and b and returns a <=> b, their order with respect to each other. The subsequent swap operation for unordered…
Boann
  • 123
  • 3
1
vote
1 answer

On the fly manipulation of operators

Assume that you are writing sorting algorithms, and that you want the ability to select between ascending and descending order. The only change required to do this for comparison sorts is to use the inverse of the comparison operator (for example: >…
1
vote
0 answers

Variable argument placement in methods

Imagine that we have a base class number that has implemented a integer and floats, but not complex numbers and that we would like to extend it to also support complex numbers: ;; this is from the number implementation (defgeneric add ((a number) (b…
1
vote
1 answer

API - Design issues

I'm building a GUI Desktop application that will communicate with an API(http) in a webserver. In the client side I have a GUI Desktop application and a GSM Modem(hardware). The GUI Desktop application will make requests to the API in the webserver…
André
  • 113
  • 3
1
vote
1 answer

WebHook versus API

I've read many blogs about this but I still get somehow confused, specially why a webhook is a thing vs an API and not just a subset of API. The way I interpret from most places (and interpret is the key work here) is that a webhook is just a…
FEST
  • 113
  • 3
0
votes
1 answer

Can an operating system without api still work?

In theory operating system is a special program run by itself without help so that also mean normal program can still run by itself mean that the need for api is not must have so finally can we have an os without api ?
AlphaBetA
  • 13
  • 3
0
votes
0 answers

How to Think About Physical Design of Libraries in C++ When Considering the Deliverable's API?

Since design ideas, and even the concept of Physical Design (exactly where you put your files), are such a broad topic, may I give a definite example and ask for feedback on the example? Suppose you are tasked with making a C++ application that does…
tarstevs
  • 1
  • 1
0
votes
1 answer

What is an API, exactly

I’ve read the Wikipedia article and know it’s basic function but I don’t understand what it physically is. Like, is an api a text file that the main program reads from and you are just putting your text in that file to be read or is it an other…
user11937382
  • 137
  • 4
0
votes
1 answer

What does it mean to 'provide' an API call?

So I have a database pre-loaded with data related to food recipes and the assignment says: 'Provide an API call that allows us to specify an ingredient or set of ingredients and return full recipes containing those ingredients.' I am not sure if…
0
votes
0 answers

Socket API in TCP

According to me Statement S1 and S2 is True while S3 is False. The Solution says 'S3' is correct ? Am I Wrong ? Kindly help with explanation . I know Connect() in TCP is used by the client side for generating a request to server while it gets the…
1
2