What exactly is a first class programming construct?
Simple answer: it's something that supports all the standard operations the language provides. In an object-oriented language, the first class constructs are, as you might expect, the objects. It turns out that in such languages there are often, for efficiency or legacy reasons, second class citizens, typically the primitive data types, that aren't proper objects, and for which you can't do certain things with.
For example, in Java a Point is a full fledged object. You can declare a
List<Point> plist;
and then put points into it. An int is not a full fledged object. There are certain things you can't do with an int -- subclass from it, for example, or invoke methods on it aside from some predefined operators. Nor can you store it in a
List<int> intlist;
Java has an out for this problem in that there is a "boxed" type, Integer, which is a full fledged object. You can declare a List<Integer>
, for example. However, using an Integer is far less efficient than with an "int." Java provides automatic boxing and unboxing (that is to say, conversion) of the Integer type to int and back again in contexts where one or other is required, to help the programmer combine the best of both worlds.
Having two types -- Integer and int -- for an integer number is confusing, and something of a hack. An early version of Java, I am told, had no primitives and all its types were full-fledged objects. That turned out to be too slow for its intended use (early Java turned out to be slow anyway, of course!) so some primitives that did not support proper object semantics were added.
in .NET 1.1 delegates were not able to be passed into methods because they were not first class programming constructs (I read something along these lines).
I know nothing about .NET, but it seems like you have the idea. You're right -- if delegates can't be passed into methods like any other standard object, they aren't first class programming constructs.