10

Operator overloading is an example of syntactic sugar — a notation that doesn't give any extra power but makes programming easier. I don't know the rationale for the decisions in Java and in Python, but see below. See also this answer on stackoverflow. First, I would like to critique the page you were linking. Let's consider the points raised there ...


8

There's a large number of publications on exceptions, with quite a few theoretical investigations. Here is an unstructured and far from complete list with some examples. Sorry, I don't have time at the moment for a more focussed reply. B. Randell, System Structure for Software Fault Tolerance. J. B. Goodenough. Exception handling: Issues and a proposed ...


6

I don't know whether or not there is a theory, but there may be an emerging pragmatic experimental science. The best source I can think of is Bjarne Stroustrup, The Design and Evolution of C++, Addison-Wesley, 1994. If I remember correctly (it's a very good book and people keep borrowing it from me and not returning it, so I don't have a copy at the moment)...


4

They're orthogonal. In declarative programming, you describe what would count as an acceptable solution, without necessarily describing how to find it. For instance, a declarative program might have rules like "if you want to install the package gcc, you must have first installed the binutils and cpp packages" and "if you want to install the binutils ...


3

Let me just point out that exceptions are a case of computational effect. Other computational effects are mutable state, I/O, non-determinism, continuations, and many others. So your question could be asked more generally: how do we form hierarchies of computational effects, how do we organize them, and why do we have the ones we have, and not others, etc.


2

You can't. This is not solvable. The user controls the client, so the user can always arrange to claim that the message was sent without actually sending it. If you want to verify that the client did not cheat, you'll need some separate way to verify that the SMS was sent. Maybe you can check with the recipient whether the SMS was actually received. ...


2

No, the other programs sit on top of the operating system(OS) and the OS runs on top of the hardware. The OS provides these programs with basic resources the programs will need to run like CPU, memory and input/output from for e.g. mouse and keyboard. The API is the only way they can get these resources, so normal programs will not be able to work on an OS ...


1

Yes, in some sense a webhook is an API. However... typically when we use the word "webhook", we are thinking of a particular kind of use. Normally, they are used as for notifying the server of an event that might be of interest to it. They're not an arbitrary API; they usually have a specific purpose. As far as I know, there is no formal definition of ...


1

Welcome to the wonderful world of functional programming and the lambda calculus! The answer is, there is no reason that you can't do this, and most sufficiently modern programming language (and some ancient ones i.e. LISP) will let you do this. In a language with first-class functions, functions are data. You can treat them as variables, pass them as ...


1

In a nutshell My first impulse was to agree with D.W.'s answer that the two concepts are orthogonal. On second thought, I think it is only partially true, and I will also try to argue that they are two sides of the same coin. In first approximation, declarative programming just specifies what you want and lets the system find how to get it, while ...


1

That very, very much depends on the kernel for which you are writing your driver. I'm (a bit) familiar with Linux. There are structures defined into which your drver has to hook. Those structures define most of the structure you are looking for, the driver itself just hooks into the kernel's structures on startup, gets its marching orders through a structure ...


Only top voted, non community-wiki answers of a minimum length are eligible