in most cases,People use the programming language is implicitly convert data types to determine whether a languageWeakly typedLanguage,For example, C。
In fact,For in addition to the more classic foreign language,Most other common languages Strong、Weak type could not tell - or,yesInconsistentof。So it will always be someone to argue。If we take as the basis for the concept of opening,Then the conflicts will appear:
Pascal had planned such as a strongly typed language,But on the whole gave the type of system introduces a vulnerability,So technically speaking it is weakly typed。
So in the end what is strongly typed,What is weakly typed it? ICan not answeryou,As the industry itselfNoWe carried out a complete definition。So if you use a strongly typed language or weak type of language to distinguish,is veryInaccurateof。- because you can not explain what is the strongly typed what is weak type。
in most cases,we useType safety、Memory Security、Dynamic type checkingandStatic type checkingTo define the language - so much more clearly。
In fact, under most circumstances,Our understanding of the strength of different types of,Most people will follow the concept begins to understand,But sometimes there are other ideas - this is normal,Because this definition itself is not a strict technical definition。Since the beginning so I did not get to the bottom of this problem,It led me to "weakly typed" to describe the Swift language,In fact according to our universal definition,It should be strongly typed language - because it does not implicitly convert data type。
But it is weakly typed certainly wrong with it? According to my definition of "small minority" of,It refers to the weak type when no explicit statement to write a value type,For example, in most cases,There may be dependent type inference Swift。So this empathy,I would think that the C language is a strongly typed language。
You may find it funny,But I still say I was right cheek,Because of the type defined only for the weak common understanding and no strict definition。
But again,I also describes the security of Swift is the type of language,This is correct。
Confusion
Speaking of type safety,You might see,Most people with a strong type to refer to the type of security,They said Swift is a strongly typed language when,In fact, that is to say:Swift is a type-safe language。- because in most cases,Type-safe performance and the strong performance of similar type - for example, can not be implicitly converted value type。
But here I would like to say,When we discuss a languageStatically typed languagestill isDynamically typed languagewhen,And there will be a lot of people sayStatically typed languages are strongly typed language,Because its behavior is also consistent with the definition of strongly typed。
You see,If we say that a language is a strongly typed language,Then it is safe to type it? Or it is a statically typed language? Or both?
Or typical C、C Lv,It is a strongly typed language,Because it is a static language,Some people say it is not,Because it is not type safe;For example, the popular Python,It is weakly typed language,Because it is not statically typed language, right? But some people will oppose the:Python does not allow the type of implicit conversion ah it is actually strongly typed!
So we should use to distinguish between strong and weak programming language to avoid behavior,You do,How much benefit does not give the audience the experience,I am afraid only role is even more confusing for beginners。
Further reading
What is the difference between a strongly typed language and a statically typed language?
Original article written by LogStudio:R0uter's Blog » Strongly typed programming language、Weakly typed
Reproduced Please keep the source and description link:https://www.logcg.com/archives/1630.html
I'll give you the brush-wave Comments,Do test it,Very pretty picture!
You can receive email? Le me how I rub myself still not received =。=
This brush is received, oh ~ If you can get this again,Then it all OK。How kind of three-way handshake catch the foot
Hastily grass,Perfect,It turned out to be thrown into the junk mail in the ......
Handshake success,Handshake success,No reset Congratulations?
People like me do not look at perennial spam ...... I actually really be it to the pit! Ok,I have to go looking through ...... It seems I later add a piece of code work,I will write an article to be Hey。
My favorites are ready…Toss wp experience is still relatively small?
Haha,I have not much experience,Hey are temporary google。
At least you play more than I have for a long time wp ~ hey do not say it,rest early,Send the push mark the R range!
Hey,To give you a pretty good night:) I easily also beautify the UI a bit -
Wow,UI This message is indeed very beautiful!
In fact, quite like this dynamic like python、Scripted OOP language -
Looks like AlphaGo is Golang of?
I say that so hard to accept the reality of the Python syntax,Up with good headache,But it really easy to use ah,,,And simple,Thought they would use the。 Dog, then look at the meaning or C and C Lv to the bar。
Well ...... I have to report a bug,No reply to e-mail alert。In addition, I is not gotta get hold of it ...... gravatar
Python book still eating ash,But tiobe statistics show ...... python very fierce momentum
real or fake! You see if it is in the trash =。= Every time you reply to my e-mail alert will have to die,I looked back and try them again。
I checked under,Really nope,You go check the records under letter,Comments to try their own way。PS my head is still very Meng ~
Avatar is quite adorable ......