top button
Flag Notify
    Connect to us
      Facebook Login
      Site Registration Why to Join

Facebook Login
Site Registration
Print Preview

What is strong-typing versus weak-typing? Which is preferred? Why?

0 votes
4 views
posted 6 days ago by Amit Sharma
Share this question
Facebook Share Button Twitter Share Button Google+ Share Button LinkedIn Share Button Multiple Social Share Button

1 Answer

0 votes

Strong typing: It checks the type of variables as soon as possible, usually at compile time. It prevents mixing operations between mismatched types.

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

Weak Typing: While weak typing is delaying checking the types of the system as late as possible, usually to run-time. In this you can mix types without an explicit conversion.

A "weak-typed" programming language is simply one which is not strong-typed.

which is preferred depends on what you want. for scripts and good stuff you will usually want weak typing, because you want to write as much less code as possible. in big programs, strong typing can reduce errors at compile time.

answer 1 day ago by Shweta Singh

Your answer

Preview

Privacy: Your email address will only be used for sending these notifications.
Anti-spam verification:
To avoid this verification in future, please log in or register.
Similar Questions
+2 votes

Why is it preferred to not use finalize for clean up?

+3 votes

How to Sign an Assembly with a Strong Name?

0 votes

How to implement an Object Pool in C#.NET.


Useful Links with Similar Problem
Contact Us
+91 9880187415
sales@queryhome.net
support@queryhome.net
#470/147, 3rd Floor, 5th Main,
HSR Layout Sector 7,
Bangalore - 560102,
Karnataka INDIA.
QUERY HOME
...