tags:

views:

290

answers:

4

How did these keywords and concepts come to life? What were the forces and problems that made them appear? What was the first language to have them?

Actually, it's not just about public/private/protected, but rather the whole range of keywords that enforce some rules (abstract, final, internal).

But, please, do not assume things. Answer if you know at least part of the answer or answer if you lived those moments. References are greatly appreciated.

A: 

this sort of thing starts out with multiple language designers asking 'what's a simple, logical name for this concept'? then, over time certain names become popular (sometimes because they're good names, sometimes just because). add 20 years, and most people end up picking the same names, based on what they've seen.

a similar question, perhaps, to asking how new words get added to (say) the English language.

Peter
I'm actually interested more in the process that led to that concept than the choice of names. Names matter, but it's interesting to see what problems they have at that time that made them feel a need for this concepts. Maybe there was a great project that was forgotten in the meantime. Who knows.
Ionuț G. Stan
Simula, as the name implies, was a language designed for simulation of processes - originally (Simula I) it was centered around "actors", but then the designers felt that concept could be generalized further, and thus classes/objects were born in Simula 67.
Pavel Minaev
+1  A: 

public, private and protected access modifiers come from C++. It seems that public and private already existed in "C with classes", short lived precursor of C++. This is probably detailed in The design and Evolution of C++.

I think abstract and final come from Java and internal from C#.

philippe
Thanks for the link. Although not entirely complete, it offers some background.
Ionuț G. Stan
A: 

For C++, the origins of private and public protection come from before Stroustrup's experiments with C With Classes, but from an even older system - the Cambridge CAP computer. This is described in section 2.10 of "The Design & Evolution of C++".

As for protected, that has had a murkier past & I don't have a good reference for it.

anon
+6  A: 

Simula (1967), considered to be the first OO language, has modifiers called protected and hidden. I assume that public is the default, I can't remember. It also uses virtual.

And, with thanks to Pavel, Simula introduced the most important keywords (and concepts) of class, this, new, downcasting and reference types.

SmallTalk (1980), a later but much more fundamental OO language, gave us Methods responding to Messages. This basically is the same functionality as virtual functions. Messages and Classes were later imitated in C (non-OO) to give the Windows API polymorphic behavior. But still needing ugly switch-statements and function pointers to replace inheritance.

The first use of Properties was, as far as I know, in Delphi (Object Pascal, < 1994).

Henk Holterman
That's the true origin. Simula's `hidden` was what we call `private` today, `protected` is what it is, and the default was indeed public. Simula also introduced the terms "class" and "object" in the meaning they are used in today's OOP/OOD, single inheritance for classes, both the term for and concept of `virtual` methods, dot-notation for field access and method calls, the idea of checked downcasts and typeswitch, and the notion that classes are "reference types" with inherent referential identity (as opposed to other types which are "value types").
Pavel Minaev
Oh, I forgot about the idea of generalized I/O streams as objects, too, and the idea that streams don't have to be just files - in Simula, strings themselves are streams (so they're kinda like `StringBuilder` in C#).
Pavel Minaev
... and also `new` keyword to instantiate objects, and `this` to refer to object itself from within a method.
Pavel Minaev
This paper has a lot of information on the design process that brought those things: http://portal.acm.org/citation.cfm?id=800025.1198392 - I'm not sure if the PDF is open for everyone to access or it requires subscription, however.
Pavel Minaev
Pavel, thanks for the additions. I integrated most of it.
Henk Holterman
Wow, great info. Thank you both. Pavel, I can only +1 your comments, sorry. I'm really glad that I asked this question.
Ionuț G. Stan
Pavel, you could still start your own answer, and integrate your comments to Peters answer as well.
Henk Holterman