All language subtitles for 007 Why Use Types_en

af Afrikaans
ak Akan
sq Albanian
am Amharic
ar Arabic
hy Armenian
az Azerbaijani
eu Basque
be Belarusian
bem Bemba
bn Bengali
bh Bihari
bs Bosnian
br Breton
bg Bulgarian
km Cambodian
ca Catalan
ceb Cebuano
chr Cherokee
ny Chichewa
zh-CN Chinese (Simplified)
zh-TW Chinese (Traditional)
co Corsican
hr Croatian
cs Czech
da Danish
nl Dutch
en English
eo Esperanto
et Estonian
ee Ewe
fo Faroese
tl Filipino
fi Finnish
fr French
fy Frisian
gaa Ga
gl Galician
ka Georgian
de German
el Greek
gn Guarani
gu Gujarati
ht Haitian Creole
ha Hausa
haw Hawaiian
iw Hebrew
hi Hindi
hmn Hmong
hu Hungarian
is Icelandic
ig Igbo
id Indonesian
ia Interlingua
ga Irish
it Italian
ja Japanese
jw Javanese
kn Kannada
kk Kazakh
rw Kinyarwanda
rn Kirundi
kg Kongo
ko Korean
kri Krio (Sierra Leone)
ku Kurdish
ckb Kurdish (Soranรฎ)
ky Kyrgyz
lo Laothian
la Latin
lv Latvian
ln Lingala
lt Lithuanian
loz Lozi
lg Luganda
ach Luo
lb Luxembourgish
mk Macedonian
mg Malagasy
ms Malay
ml Malayalam
mt Maltese
mi Maori
mr Marathi
mfe Mauritian Creole
mo Moldavian
mn Mongolian
my Myanmar (Burmese)
sr-ME Montenegrin
ne Nepali
pcm Nigerian Pidgin
nso Northern Sotho
no Norwegian
nn Norwegian (Nynorsk)
oc Occitan
or Oriya
om Oromo
ps Pashto
fa Persian
pl Polish
pt-BR Portuguese (Brazil)
pt Portuguese (Portugal)
pa Punjabi
qu Quechua
ro Romanian
rm Romansh
nyn Runyakitara
sm Samoan
gd Scots Gaelic
sr Serbian
sh Serbo-Croatian
st Sesotho
tn Setswana
crs Seychellois Creole
sn Shona
sd Sindhi
si Sinhalese
sk Slovak
sl Slovenian
so Somali
es Spanish
es-419 Spanish (Latin American)
su Sundanese
sw Swahili
sv Swedish
tg Tajik
ta Tamil
tt Tatar
te Telugu
th Thai
ti Tigrinya
to Tonga
lua Tshiluba
tum Tumbuka
tr Turkish
tk Turkmen
tw Twi
ug Uighur
uk Ukrainian
ur Urdu
uz Uzbek
vi Vietnamese
cy Welsh
wo Wolof
xh Xhosa
yi Yiddish
yo Yoruba
zu Zulu

Original subtitles

In the last section, we laid out a couple of different rules around Dart's type system in the section,

we're going to talk just a little bit more about types in particular.

We're going to look at some of the very basic types that are available to us in DART.

All right, here we go.

So on the left hand side of listed out a couple of very basic types and then on the right hand side,

we've got some example values of each one.

You and I have already taken a look at the string tight.

A string type is a series of characters that get put together into one value.

So an example of a string type would be, hi, how's it going?

And that's great.

One of the other very basic types that we're going to make use of in many of our programs is the int'l

type as well, which is short for integer and integer is any number negative, zero or positive that

does not have a decimal associated with it.

So an example of an inch would be zero negative nine nine nine or eight hundred and seventy six thousand.

One of the last very common types that we're going to work with quite a bit is the double type.

This is a number that has a decimal associated with it.

So the big difference between integer and double is the presence of some decimal.

Examples of doubles would be zero point zero zero one negative, ninety nine point eight one four.

And you get the idea.

Now, besides these very basic types, we also have this dynamic type, which we briefly discussed in

the last section, the dynamic type down here is still technically a type in dart.

The dynamic type means to say we have a variable that can hold any value that we wish.

So if we had a variable with a type of dynamic associated with it, that variable could reference any

type of value, like the string right here of high, the double negatives point zero zero zero four

or the integer 90.

Now, the last thing I want to mention very briefly about types before we move on to our next topic

is have a quick discussion about why we care about types at all.

This is probably one of the more important things to talk about, especially if you're coming from a

dynamic language like, say, JavaScript.

So let's very briefly talk about some of the benefits of using a type system.

One of the most market benefits is that whenever we use a type system, there is the possibility of

improving the performance of our application.

Even when you use JavaScript, which is a dynamic language when that JavaScript code is executed, the

interpreter that's executing that code is technically still doing some type, checking behind the scenes.

And so any time we use a dynamic, dynamic language, there is a performance penalty associated with

it.

By using a type system, we have the possibility of getting some improved performance.

Next up, it tends to be a little bit easier to work on large projects when they use a strong type system.

So if we're working on some very large project where we have to make use of some code written by another

engineer, it will be a lot easier if we could get a better idea of what the structure of data is that

comes back from some code.

There's whenever we execute it.

So if we're working on a large project with many engineers or even just a few, it tends to be a little

bit easier to work with a language that has strong typing.

Next, there tends to be slightly less of a need to write unit tests around any language that has strong

typing associated with it.

For example, if we're making use of Ruby or JavaScript, we might want to run a test that says that

any time we run some particular function, we always get back an array or a string or an integer.

So if we're using JavaScript, Ruby, we definitely would want to write a test like that to make sure

that in fact, yes, we get back an array or a string or whatever it is, but when we're making use

of a strongly typed language with Dart, we get a little bit more assurance that whenever we say that

some function is going to return, some specific value, chances are, yep.

In fact, it's going to return that type of value.

Finally and makes life a little bit easier for finding very simple errors, for example, if we go back

over to our dart pad project over here, let's say that right before we try to print up the string right

here, we tried to retrieve the length of this string that we return from the mining function.

So if I wanted to get the length of some particular string, I could write out name length like so.

Now, when I write this code out right here, Darte has the ability to look at the type of variable

that this very early in the type of value that this variable is referencing, DART knows that it is

of type string Daquan.

Then go check to see if String has a length property associated with it.

And in this case, yes, it does.

If we instead returned an integer from the mining function down here instead, like, say, INT.

And then returned the number one, two, three.

Now, the we're getting a nasty, nastier message from this line of code, because Dart is able to know

that name is now storing an integer and an integer does not have a length property associated with it.

So, again, by using a type system, we get a little bit better ability to find very simple errors

like that inside of our code.

Now, really quickly, back over here.

I am going to undo those changes I made.

Very good.

OK, so in this section, we spoke about some of the very basic types that are available to us inside

of DART, and we also spoke about why we care about using type systems at all.

So let's continue in the next section and we're going to take a look at the very last line of code inside

of our program, the print statement.

So quick break and we'll see you in just a minute.

Can't find what you're looking for?
Get subtitles in any language from opensubtitles.com, and translate them here.