answersLogoWhite

0

Strong-typing vs Weak-typing

Weak typing is where a language allows you to treat blocks of memory defined as one type as another (casting). Languages like C and C++, although statically typed, are weakly typed.

Languages like Perl and PHP are weakly typed because you can do things like adding numbers to strings and the language will do an implicit coercion for you.

Languages like Java, C# and Python are strongly typed - there is no way you can add a number to a string without doing an explicit conversion.

In addition, there are many large systems that have been created with dynamic type systems. Catching type errors (typos) at compile time only catches a very small proportion of errors and a strong testing strategy produces much more reliable systems irrespective of the type system in use.

Strong type is checking the types of variables at compile time. weak typing is checking the types of the system at run-time. For scripts & quick stuff we'll use weak typing, In big programs, strong typing can reduce errors at compile time

The above answer is not 100% correct. C++ doesn't allow for an integer (int) to be added to a string, unless you mean appending. In which case, C# and Java behave in similar fashion by doing an implicit conversion. For a better answer see the answer to "Strongly typed programming language" in this site.

Juan R

--------------------------------------------------------------------------------------------------------------

Strong typing provides greater type safety. You might have specially heard it about DataSets being strongly typed, where instead of referring columns as datacolumns(index).value, you create an XML schema from which you make a dataset derived class. Strong typing is preferred as there remains no type ambiguity. Another example is, turning on Option strict in VB, where you have to do explicit type casts.Instead of running into situation where you get a type that you did not expect and try performing an operation on it, you go for strong typing so that such errors are caught during compile time itself.

--------------------------------------------------------------------------------------------------------------

strong typelanguage specication requires its typing rules strongly (i.e. more or less allowing only those automatic type conversions which do not lose information),

one can refer to the process as strongly typed, if not, as weakly typed.

example in c language

int a;

float b, c;

b=2.2;

c=3.3;

a=b+c;// here we are losing data result is 5 instead of 5.5 because a is an integer

cout<

here ouptput 5.

if language do not allow to automatic type conversion then it should be strongly type otherwise it is weakly typed.

dynamic type:- if compiler know information about the type of variable or data at run time then it is called dynamic type.

static type:- if complier get information about type of variable or data at compile time then it is called static type.

User Avatar

Wiki User

10y ago

What else can I help you with?

Related Questions

What is the future tense of versus?

The word versus is a preposition; therefore, it doesn't have tense.


What does the name Versus mean?

To me 'Versus' means 'against' as in 'Portsmouth versus Manchester United'.


What is the ISBN of Aliens versus Predator versus The Terminator?

The ISBN of Aliens versus Predator versus The Terminator is 1-56971-568-8.


What is the difference between the first and second phases of the prewritingprocessO A. Outlining versus writingB. Brainstorming versus editingO C. Organizing versus writingD. Generating versus organizing?

What is the difference between the first and second phases of the prewriting process? O A. Outlining versus writing B. Brainstorming versus editing O C. Organizing versus writing D. Generating versus organizing


What best describes the tensions within England at the time Elizabeth I took the throne A.King versus queen B.Ruling class versus proletariat C.Immigrant versus native D.Protestant versus Catholic?

Protestant versus Catholic.


Who versus who?

Versus is owned be Comcast. Who owns Comcast


What conflicts have divided Vietnam?

Catholic versus Buddhist, Communist versus Democracy and the constants of poor versus rich, haves versus have nots, land owner versus peasant.


What is the conflict of the film and the book for The Lightning Thief Percy Jackson and the Olympians?

The conflicts in Percy Jackson and the Olympians: The Lightning Thief areMan vs Man:Percy versus his stepfather, GabePercy versus LukePercy versus AresPercy versus ClarissePercy versus Hades


What are the classification schemes for antibiotics based on?

bacterial spectrum (broad versus narrow), route of administration (injectable versus oral versus topical), or type of activity (bactericidal versus bacteriostatic)


How can you abbreviate versus as in Teachers versus students?

The abbreviation for "versus" is vs.Be careful not to confuse versus with verses, a noun referring to related lines of poetry, song lyrics, or religious writing.


Who would be the last one standing in a Sephiroth versus Kefka versus Ultimecia versus Seymour fight?

probably sephiroth.


When was Versus None created?

Versus None was created in 2004.