Important Notice: Our web hosting provider recently started charging us for additional visits, which was unexpected. In response, we're seeking donations. Depending on the situation, we may explore different monetization options for our Community and Expert Contributors. It's crucial to provide more returns for their expertise and offer more Expert Validated Answers or AI Validated Answers. Learn more about our hosting issue here.

I keep hearing that Ada is a “strongly typed language”, but it seems different from whats meant in C++. Are they different?

ADA different hearing meant
0
Posted

I keep hearing that Ada is a “strongly typed language”, but it seems different from whats meant in C++. Are they different?

0

(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

What is your question?

*Sadly, we had to bring back ads too. Hopefully more targeted.