answersLogoWhite

0


Best Answer
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

8y ago
This answer is:
User Avatar
More answers
User Avatar

Wiki User

15y ago

A strong-typed programming language is one in which: * All variables (or data types) are known at compile time * There is strict enforcement of typing rules (a String can't be used where an Integer would be expected) * All exceptions to typing rules results in a compile time error A "weak-typed" programming language is simply one which is not strong-typed.

This answer is:
User Avatar

User Avatar

Wiki User

14y ago

How many words you can type a min. Vs you looking at the keyboard and chop sticking it ...

This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: What is strong-typing versus weak-typing?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

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 is life versus death in latin?

Versus vitam mortem


When was Versus - EP - created?

Versus - EP - was created in 2008.


When was We Versus the Shark created?

We Versus the Shark was created in 2003.


When did We Versus the Shark end?

We Versus the Shark ended in 2009.


When was Versus - journal - created?

Versus - journal - was created in 1971.


When was Versus None created?

Versus None was created in 2004.


When was NHL on Versus created?

NHL on Versus was created in 2005.