I keep hearing that Ada is a “strongly typed language”, but it seems different from whats meant in C++. Are they different?
(Tucker Taft responds) I certainly agree that ANSI C and C++ are statically typed languages, but I would debate the “strength” of their typing. Essentially any support for implicit conversion (implicit “casting,” “promotion”, “usual” arithmetic conversions, etc.) “weakens” a type system (but also makes it “friendlier” in some ways). C allows implicit conversion between all integer types and all enumeration types. C++ at least cuts off implicit conversion to enumeration types, but retains implicit conversion among all integer (and floating-point) types. Also, in both C and C++, typedefs for pointer/array types are essentially “macros”; all pointer types with the same target type are implicitly interconvertible. Finally C++ allows the user to define a number of their own implicit conversion operators, which basically allows the user to “weaken” the type system as they see fit. Of course, all of this implicit conversion serves a purpose, but it does tend to move C/C++ toward the “weaker”
Related Questions
- I keep hearing that Ada is a "strongly typed language", but it seems different from whats meant in C++. Are they different?
- What is meant by different kinds of research, such as "clinical versus basic" and other types of research?
- What is meant by "dragging the shutter"? Is that anything different than using a slow shutter speed?