Skip to main content
62 votes
Accepted

What is the earliest use of the "this" keyword in any programming language?

Simula 67 is generally considered the first object-oriented language and predates Smalltalk by a number of years. It also used the this keyword for the same ...
Brian Tompsett - 汤莱恩's user avatar
45 votes
Accepted

Is there any reason why the modulo operator is denoted as %?

The earliest known use of % for modulo was in B, which was the progenitor of C, which was the ancestor (or at least godparent) of most languages that do the same, ...
Foo Bar's user avatar
  • 536
13 votes

Is there any reason why the modulo operator is denoted as %?

This is very likely a historical development. Looking at this table, we see that C was likely the first language to use % for modulo. Its predecesor BCPL used ...
Andrej Bauer's user avatar
  • 31.8k
12 votes

Why the 127 encodings of ASCII needed to be extended to 256?

ASCII has 128 characters. Many countries had similar encodings for 128 characters. That is all history. Nobody uses ASCII anymore. There was a phase with lots of different encodings for more than 128 ...
gnasher729's user avatar
  • 32.6k
12 votes

What was Robert Floyd's algorithm for inserting brackets?

The seminal paper referred to is "Syntactic Analysis and Operator Precedence" (1963), which describes the operator precedence algorithm still used by many simple expression parsers today. ...
rici's user avatar
  • 12.2k
12 votes

Which Turing Award winners have supervised the PhDs of other Turing Award winners?

Consulting with the Mathematics Genealogy Project, I was able to find the following thesis advisor relationships: John Hopcroft (1986) advised Alfred Aho (2020) Martin Hellman (2015) advised ...
mhum's user avatar
  • 2,350
11 votes
Accepted

Why call it 'Time Complexity'?

Perhaps the earliest place in which time complexity appears is On the computational complexity of algorithms by Hartmanis and Stearns. Their goal is to study computation complexity, which they define ...
Yuval Filmus's user avatar
11 votes

Mathematical benefit to use CPU/memory that increases by powers of 2 as 8-bit, 16-bit, 32-bit, 64-bit, etc?

Multiplying and dividing binary integers by powers of 2 is very cheap, like multiplying and dividing by 10 for decimal numbers. It's qualitatively different from other factors because the other bits ...
Peter Cordes's user avatar
  • 1,125
10 votes
Accepted

What is the origin of dot notation?

In [1] (authored by one of the co-creators of Simula), there is a suggestion that Simula 67 may have been the first to use this dot notation. Given that Simula is widely credited for being the first ...
mhum's user avatar
  • 2,350
10 votes
Accepted

Lambda Calculus as a branch of set theory

It's false. The $\lambda$-calculus arose through efforts to understand foundations of mathematics. Nowadays some people mistakenly equate foundations with set theory. The Stanford Encyclopaedia of ...
Andrej Bauer's user avatar
  • 31.8k
9 votes
Accepted

Why are struct and class essentially the same in C++?

Bjarne Stroustrup writes in his The Design and Evolution of C++ book (item 3.5.1): At this point, the object model becomes real in the sense that an object is more than the simple aggregation of ...
HEKTO's user avatar
  • 3,183
7 votes
Accepted

Did Date and Darwen's "Third Manifesto" have a lasting impact?

You need to consider whether the first two manifestos (to which TTM was a response) had any impact. I'd say little or no: there were a few OODB ideas that made it into the SQL standard (but were ...
AntC's user avatar
  • 535
7 votes

Why the 127 encodings of ASCII needed to be extended to 256?

There are a few other good reasons to expand from 7-bit ASCII, but since you ask specifically about foreign languages, I want to tell you about that angle. English has words with diacritical marks, ...
kviiri's user avatar
  • 1,248
7 votes

Why do combinators look this way?

The combinators $K$ and $S$ first appear in Moses Schönfinkel, Über die Bausteine der mathematischen Logik, though he calls them $C$ and $S$. He actually defines five combinators, $I,C,T,Z,S$, and ...
Yuval Filmus's user avatar
5 votes

Who first introduced the pushdown automaton?

Ginsburg (in his book The Mathematical Theory of Context-Free Languages, McGraw-Hill, 1966) states in the Historical References (Section 2.7, page 81): Pushdown acceptors were first formalized by ...
Hendrik Jan's user avatar
  • 31.6k
5 votes

Why the 127 encodings of ASCII needed to be extended to 256?

The question of how foreign languages justifies expanding the encoding in actual usage is well explained by earlier answers. The question of why foreign languages would affect the American Standard ...
Yufan Lou's user avatar
  • 138
5 votes

Why is the address-of operator in C/C++ represented with the "&" symbol?

Because B did! A user on software engineering.sx contacted Ken Thompson: From: Ken Thompson c copied from b so & and * are same there. b got * from earlier languages - some assembly, bcpl and i ...
Ainsley H.'s user avatar
  • 18.1k
5 votes
Accepted

Why is C still the fastest? Critique my take

C is fastest because there is nothing preventing it from being the fastest. A CPU always runs machine language. When writing a "fast" program, your goal is to give the CPU the fastest ...
Stack Exchange Broke The Law's user avatar
5 votes

Is the reason for a stack to decrease the size of a program (by adding the use of subroutines)?

The reason for having a stack is recursion. You don’t need a stack if you don’t have recursion. CDC super computers in the 70s worked just fine without a stack - until they implemented Pascal. On ...
gnasher729's user avatar
  • 32.6k
4 votes
Accepted

Machine code and punched cards

You normally started by entering a little loader program one word at a time by setting the bits with a line of toggle switches on the front panel, like this: Wikipedia has a bit of explanation of the ...
rici's user avatar
  • 12.2k
4 votes

Are there any languages without tokens?

I agree with the commenters that your question is either ill-defined or nonsensical. It all hinges on what you mean by "tokens", and what it would mean to "not have tokens." If you mean multi-...
Quuxplusone's user avatar
4 votes

liskov substitution principle seems to have two conventional meanings

I don't think either of these is the Liskov substitution principle. My understanding of the principle is that for $S$ to be a subtype of $T$, it must be the case that we can substitute a value of type ...
Dan Doel's user avatar
  • 2,985
4 votes

Why is C still the fastest? Critique my take

The OS has virtually nothing to do with the relative performance of languages on benchmarks. You wrote “your code —(system calls) —> the OS —(instruction set) —> the hardware” suggesting you ...
benrg's user avatar
  • 2,631
4 votes

Mathematical benefit to use CPU/memory that increases by powers of 2 as 8-bit, 16-bit, 32-bit, 64-bit, etc?

On top of what everyone else has said, bit shift circuits are easier to design if the "shift amount" is a whole number of bits in size.
Pseudonym's user avatar
  • 25k
4 votes

Mathematical benefit to use CPU/memory that increases by powers of 2 as 8-bit, 16-bit, 32-bit, 64-bit, etc?

The fast Fourier transform and its relatives, such as the discrete Fourier transform used in JPEG compression, work best with data sizes that are powers of two. So, if you were to implement the FFT on,...
Steve-OH's user avatar
3 votes
Accepted

Reason programming language B was named "B"?

B was designed by Dennis Ritchie and Ken Thompson, as a cut-down version of BCPL, the Basic Combined Programming Language. Ritchie [1] says, [B's] name most probably represents a contraction of ...
David Richerby's user avatar
3 votes

Why call it 'Time Complexity'?

I think, though I don't have any references to back this up, that it's just a convenient name that has a ring of truth to it. If you imagine implementing a standard Turing machine, it does seem ...
David Richerby's user avatar
3 votes

Does the concept of "side-effect" predate functional programming?

The earliest usages of the term that I'm aware of are in regard to Algol 60, one of the first languages to be (or attempted to be) defined by a specification. When people started implementing it, they ...
texdr.aft's user avatar
  • 139
3 votes

Why do combinators look this way?

This is so because $K$ and $S$ can be used to generate all other $\lambda$-terms (up to extensional equality), refer to this proof for the details.
Andrej Bauer's user avatar
  • 31.8k
3 votes

Mathematical benefit to use CPU/memory that increases by powers of 2 as 8-bit, 16-bit, 32-bit, 64-bit, etc?

It’s beneficial if you can combine smaller units into a larger unit. Imagine you had 12 bit and 20 bit numbers. 20 bits could hold one 12 bit number and waste 8 bit. 24 bits could hold one twenty bit ...
gnasher729's user avatar
  • 32.6k

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