Glossary entry (derived from question below)
Dec 28, 2022 08:07
1 yr ago
25 viewers *
English term
shadowing
English to Russian
Tech/Engineering
Computers: Software
Google Go
**Shadowing**
Note: This explanation uses two informal terms, stomping and **shadowing**. They are not official concepts in the Go language spec.
Like many programming languages, Go has mutable variables: assigning to a variable changes its value.
When using short variable declarations with the := operator, in some cases a new variable is not created. We can call this stomping. It’s OK to do this when the original value is no longer needed.
Be careful using short variable declarations in a new scope, though: that introduces a new variable. We can call this **shadowing** the original variable. Code after the end of the block refers to the original. Here is a buggy attempt to shorten the deadline conditionally:
Источник:
https://google.github.io/styleguide/go/best-practices
Note: This explanation uses two informal terms, stomping and **shadowing**. They are not official concepts in the Go language spec.
Like many programming languages, Go has mutable variables: assigning to a variable changes its value.
When using short variable declarations with the := operator, in some cases a new variable is not created. We can call this stomping. It’s OK to do this when the original value is no longer needed.
Be careful using short variable declarations in a new scope, though: that introduces a new variable. We can call this **shadowing** the original variable. Code after the end of the block refers to the original. Here is a buggy attempt to shorten the deadline conditionally:
Источник:
https://google.github.io/styleguide/go/best-practices
Proposed translations
(Russian)
4 +1 | Затенение |
Мария Корчмит
![]() |
3 | перекрывание |
Elena Blizhenskaya
![]() |
Proposed translations
+1
1 hr
Selected
Затенение
4 KudoZ points awarded for this answer.
Comment: "Спасибо!"
4 hrs
перекрывание
Это аналог overriding переопределения
https://www.geeksforgeeks.org/variable-shadowing-in-python/
https://www.geeksforgeeks.org/variable-shadowing-in-python/
Something went wrong...