You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We generally use upper case for constants that are "hard-coded". Or, in other words, when the value is known prior to execution and directly written into the code.
1
+
Mes dažniausiai naudojame didžiąsias raides konstantoms, kurios yra iš anksto užprogramuotos (angliškai vadinamos "hard-coded"). Arba kitaip sakant kai vertė yra žinoma prieš įvykdymą ir yra tiesiai įrašyta į kodą.
2
2
3
-
In this code, `birthday`is exactly like that. So we could use the upper case for it.
3
+
Šis kodas, `birthday`yra būtent toks. Tad mes galime jam naudoti didžiąsias raides.
4
4
5
-
In contrast, `age` is evaluated in run-time. Today we have one age, a year after we'll have another one. It is constant in a sense that it does not change through the code execution. But it is a bit "less of a constant" than`birthday`: it is calculated, so we should keep the lower case for it.
5
+
Tačiau priešingai yra su `age`, kuris yra įvertinamas vykdymo metu. Šiandien mes turime vienokį amžių, bet po metų jis jau bus kitoks. Jis yra konstanta tik dėl to, kad jis nesikeičia įvykdant kodą. Bet jis yra kiek "mažiau pastovus" negu`birthday`: jis yra suskaičiuojamas, dėl tos priežasties turėtume jam palikti mažąsias raides.
0 commit comments