Colon class § 5.2: Data types

Source: Internet
Author: User

Lesson five language Small Talk (2)

5.2 Data types--rules and workarounds

Manipulated in the rules, the gods are outside the rules--"Huzhen, ancient and modern medical case Press"

Keywords: data type, static type, dynamic type, duck type, strong type, weak type, type safety

Summary: Discussion of data types

! Preview

· The philosophy of the duck type is: What is not important, what is important is what can be done

• It may not seem like a bad idea to put a guy who's going to swim in a pond, but if a ship comes in with the opportunity to rumble in, it's not going to be that nice.

• Static type check similar to "suspect crime from have" the guilty push customization, dynamic type check similar to "suspect from none" of the Innocence push customization

• Keep the rules as closely as possible and make modifications if necessary

• Rules such as belts, too loose and too restrictive are not good

? Questions

• Dynamic language and dynamic type language is it the same thing?

• What are the two elements of a data type? What is the point?

• What are dynamic types and static types? What is the difference between them? What are the pros and cons?

• What is a duck type (duck typing)? What are the pros and cons of it?

• What are strong types and weak types? What is type-safe?

: Explain

When the classroom calms down, the colon again says: "Before talking about dynamic languages, it's best to clarify the difference between it and the dynamic type language." ”

Exclamation ya way: "They are not the same thing?" Always thought that dynamic language is the abbreviation of dynamic type language. ”

"In the name of a relative, there is no kinship." Similar names, coupled with dynamic language is the vast majority of the dynamic type of language, causing confusion is inevitable, but there is no inevitable link-dynamic language is not necessarily dynamic type language [1], dynamic type language is not necessarily a dynamic language [2]. A colon-porridge tongue almost stumbled over the garlic, and the minds of the people were stirred up.

Jianshibumiao, the colon instead of circuitous tactics: "We might as well talk about some of the data type is how to understand?" ”

The comma casually says: "Data type is not the kind of data?" ”

The crowd laughed and said, almost as if he hadn't said anything.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.