Printer Friendly
Dictionary, Encyclopedia and Thesaurus - The Free Dictionary
1,803,536,278 visitors served.
forum mailing list For webmasters
?
New: Language forums
Dictionary/
thesaurus
Medical
dictionary
Legal
dictionary
Financial
dictionary
Acronyms
 
Idioms
Encyclopedia
Wikipedia
encyclopedia
?

weak typing

   Also found in: Wikipedia 0.03 sec.

weak typing

A programming language characteristic that allows different types of data to be moved freely among data structures, as is found in Smalltalk and other earlier object-oriented languages. Contrast with strong typing.


(programming)weak typing - Strict enforcement of type rules but with well-defined exceptions or an explicit type-violation mechanism.

Weak typing is "friendlier" to the programmer than strong typing, but catches fewer errors at compile time.

C and C++ are weakly typed, as they automatically coerce many types e.g. ints and floats. E.g.

int a = 5; float b = a;

They also allow ignore typedefs for the purposes of type comparison; for example the following is allowed, which would probably be disallowed in a strongly typed language:

typedef int Date; /* Type to represent a date */ Date a = 12345; int b = a; /* What does the coder intend? */

C++ is stricter than C in its handling of enumerated types:

enum animal CAT=0,DOG=2,ANT=3; enum animal a = CAT; /* NB The enum is optional in C++ */ enum animal b = 1; /* This is a warning or error in C++ */


How to thank TFD for its existence? Tell a friend about us, add a link to this page, add the site to iGoogle, or visit webmaster's page for free fun content.
?Page tools
Printer friendly
Cite / link
Email
Feedback
? Mentioned in
 
Encyclopedia browser? ? Full browser
 
 
Encyclopedia
?

Disclaimer | Privacy policy | Feedback | Copyright © 2009 Farlex, Inc.
All content on this website, including dictionary, thesaurus, literature, geography, and other reference data is for informational purposes only. This information should not be considered complete, up to date, and is not intended to be used in place of a visit, consultation, or advice of a legal, medical, or any other professional. Terms of Use.