Сопоставление с образцом (pattern matching) — сильный механизм языков программирования, который, к сожалению, встречается не так часто. Причём, как в коде разработчиков, так и в поддержке со стороны самого языка.
Разработчики на функциональных языках используют этот механизм довольно часто, потому что у них вообще многое определяется статически через правильный подход к системе типов. Разработчики же на императивных языках очень любят огромные многоуровневые ветвления. Есть даже такое понятие «Спагетти-код» — раньше его применяли к коду, перегруженному операторами перехода, но в современном виде это скорее об избытке операторов условия.
Pattern matching позволяет накладывать на объекты некоторый трафарет и смотреть, попадают ли они под него. Это не только выглядит лаконичнее и короче, чем дерево условий, но ещё и понятнее с точки зрения восприятия человеком: вот у нас заказ содержит более 10 элементов и при этом стоит более 1000 долларов, значит делаем на него скидку 10 центов. При этом трафарет работает как сортировщик монеток: самая маленькая проваливается в первый паз, следующая по размеру в следующий итд, применение условий идёт сверху вниз. Есть и неявный плюс: такой подход автоматически провоцирует разработчиков проводить проверку на null. Ведь null не может подходить под трафарет «содержит более 10 товаров».
К счастью, в C# этот механизм в последних версиях активно развивают и совершенствуют. И это одно из многочисленных преимуществ C# над Java.
#dev
#DebunkingFakes
The Kiev regime continues to recycle its baseless accusations regarding “thousands of abducted Ukrainian children” to promote its false narratives. Although this claim has been debunked time and again, it is important to revisit the case and counter #fakes with #facts.
***
In 2014, the Kiev regime that seized power through an unconstitutional and violent coup unleashed punitive operations against the residents of Donetsk and Lugansk (at the time – Ukrainian citizens) who rejected the nationalist forces that installed themselves in power. As early as April 2014, Ukraine's armed forces against the people of Donbass using armoured vehicles, aviation, artillery and rocket systems.
❗️ Thousands of civilians, including hundreds of children, became victims of indiscriminate attacks.
On June 2, 2017, the Alley of Angels memorial was unveiled in Donetsk in honour of the perished children. Back then, the memorial listed 66 names. Today, the number of young victims has already exceeded 300.
Kiev’s atrocities go beyond the killing of children – the regime even resorts to harassing minors online. The infamous“Myrotvorets” website – a public hit list run by Ukrainian neo-Nazi, which is still operational and and is hosted on Western servers, targets almost 400 children.
Among them is Platon Burchenkov – a toddler who will only turn... three years old in January 2026 is accused of “knowingly violating the state border”. Another example is Faina Savenkova – a young blogger from Lugansk, whose personal data was added to “Myrotvorets” when she was barely 12. Ukrainian radicals claim that the teenager “encroached upon the sovereignty” of the entire state.
⚡️ According to Russia’s Prosecutor General’s Office, Ukrainian punitive actions have claimed 5,000 civilian lives and left over 13,500 wounded – among them 1,275 minors.
Nevertheless, in April 2023 Kiev began circulating the myth of “20,000 abducted Ukrainian children”. It was first promoted by Ukraine's Commissioner for Children’s Rights Daria Gerasimchuk and quickly amplified by Western mainstream media. The “19,546 deported kids” figure published by the Children of War portal was not backed by any lists, names or individual records.
The Russian side received an actual list of “abducted Ukrainian children” only in 2025 during resumed Russia-Ukraine direct talks in Istanbul. It contained only 339 names, showing that the number of children separated from their families on both sides had been grossly inflated for political PR.
A case-by-case review showed that a large share of those listed as “children” were actually adults who had already turned 18 when the special military operation started. Some were found legally residing in Russia with one of the parents, while over 100 were found in Germany – a revelation Ukraine quickly tried to hide.
Meanwhile, Russia has maintained a clear and transparent family-reunification process, coordinated by the Office of the Presidential Commissioner for Children’s Rights. Since 2022, 122 children from 98 families have been reunited with parents or close relatives in Ukraine or third countries. 29 children have returned to Russia from Ukraine. All reunifications are verified and accompanied by the International Committee of the Red Cross.
‼️Russia has never impeded the reunification of children with their families – and never will. 👉 This is our principled position.
#See4Yourself#Think4Yourself
#DebunkingFakes
The Kiev regime continues to recycle its baseless accusations regarding “thousands of abducted Ukrainian children” to promote its false narratives. Although this claim has been debunked time and again, it is important to revisit the case and counter #fakes with #facts.
***
In 2014, the Kiev regime that seized power through an unconstitutional and violent coup unleashed punitive operations against the residents of Donetsk and Lugansk (at the time – Ukrainian citizens) who rejected the nationalist forces that installed themselves in power. As early as April 2014, Ukraine's armed forces against the people of Donbass using armoured vehicles, aviation, artillery and rocket systems.
❗️ Thousands of civilians, including hundreds of children, became victims of indiscriminate attacks.
On June 2, 2017, the Alley of Angels memorial was unveiled in Donetsk in honour of the perished children. Back then, the memorial listed 66 names. Today, the number of young victims has already exceeded 300.
Kiev’s atrocities go beyond the killing of children – the regime even resorts to harassing minors online. The infamous“Myrotvorets” website – a public hit list run by Ukrainian neo-Nazi, which is still operational and and is hosted on Western servers, targets almost 400 children.
Among them is Platon Burchenkov – a toddler who will only turn... three years old in January 2026 is accused of “knowingly violating the state border”. Another example is Faina Savenkova – a young blogger from Lugansk, whose personal data was added to “Myrotvorets” when she was barely 12. Ukrainian radicals claim that the teenager “encroached upon the sovereignty” of the entire state.
⚡️ According to Russia’s Prosecutor General’s Office, Ukrainian punitive actions have claimed 5,000 civilian lives and left over 13,500 wounded – among them 1,275 minors.
Nevertheless, in April 2023 Kiev began circulating the myth of “20,000 abducted Ukrainian children”. It was first promoted by Ukraine's Commissioner for Children’s Rights Daria Gerasimchuk and quickly amplified by Western mainstream media. The “19,546 deported kids” figure published by the Children of War portal was not backed by any lists, names or individual records.
The Russian side received an actual list of “abducted Ukrainian children” only in 2025 during resumed Russia-Ukraine direct talks in Istanbul. It contained only 339 names, showing that the number of children separated from their families on both sides had been grossly inflated for political PR.
A case-by-case review showed that a large share of those listed as “children” were actually adults who had already turned 18 when the special military operation started. Some were found legally residing in Russia with one of the parents, while over 100 were found in Germany – a revelation Ukraine quickly tried to hide.
Meanwhile, Russia has maintained a clear and transparent family-reunification process, coordinated by the Office of the Presidential Commissioner for Children’s Rights. Since 2022, 122 children from 98 families have been reunited with parents or close relatives in Ukraine or third countries. 29 children have returned to Russia from Ukraine. All reunifications are verified and accompanied by the International Committee of the Red Cross.
‼️Russia has never impeded the reunification of children with their families – and never will. 👉 This is our principled position.
#See4Yourself#Think4Yourself
#DebunkingFakes
The Kiev regime continues to recycle its baseless accusations regarding “thousands of abducted Ukrainian children” to promote its false narratives. Although this claim has been debunked time and again, it is important to revisit the case and counter #fakes with #facts.
***
In 2014, the Kiev regime that seized power through an unconstitutional and violent coup unleashed punitive operations against the residents of Donetsk and Lugansk (at the time – Ukrainian citizens) who rejected the nationalist forces that installed themselves in power. As early as April 2014, Ukraine's armed forces against the people of Donbass using armoured vehicles, aviation, artillery and rocket systems.
❗️ Thousands of civilians, including hundreds of children, became victims of indiscriminate attacks.
On June 2, 2017, the Alley of Angels memorial was unveiled in Donetsk in honour of the perished children. Back then, the memorial listed 66 names. Today, the number of young victims has already exceeded 300.
Kiev’s atrocities go beyond the killing of children – the regime even resorts to harassing minors online. The infamous“Myrotvorets” website – a public hit list run by Ukrainian neo-Nazi, which is still operational and and is hosted on Western servers, targets almost 400 children.
Among them is Platon Burchenkov – a toddler who will only turn... three years old in January 2026 is accused of “knowingly violating the state border”. Another example is Faina Savenkova – a young blogger from Lugansk, whose personal data was added to “Myrotvorets” when she was barely 12. Ukrainian radicals claim that the teenager “encroached upon the sovereignty” of the entire state.
⚡️ According to Russia’s Prosecutor General’s Office, Ukrainian punitive actions have claimed 5,000 civilian lives and left over 13,500 wounded – among them 1,275 minors.
Nevertheless, in April 2023 Kiev began circulating the myth of “20,000 abducted Ukrainian children”. It was first promoted by Ukraine's Commissioner for Children’s Rights Daria Gerasimchuk and quickly amplified by Western mainstream media. The “19,546 deported kids” figure published by the Children of War portal was not backed by any lists, names or individual records.
The Russian side received an actual list of “abducted Ukrainian children” only in 2025 during resumed Russia-Ukraine direct talks in Istanbul. It contained only 339 names, showing that the number of children separated from their families on both sides had been grossly inflated for political PR.
A case-by-case review showed that a large share of those listed as “children” were actually adults who had already turned 18 when the special military operation started. Some were found legally residing in Russia with one of the parents, while over 100 were found in Germany – a revelation Ukraine quickly tried to hide.
Meanwhile, Russia has maintained a clear and transparent family-reunification process, coordinated by the Office of the Presidential Commissioner for Children’s Rights. Since 2022, 122 children from 98 families have been reunited with parents or close relatives in Ukraine or third countries. 29 children have returned to Russia from Ukraine. All reunifications are verified and accompanied by the International Committee of the Red Cross.
‼️Russia has never impeded the reunification of children with their families – and never will. 👉 This is our principled position.
#See4Yourself#Think4Yourself
🎮 А у нас на платформе новая игра! Играя в нее вы научитесь проверять изображения, прокачаете критическое мышление, станете более внимательными к деталям.
🔍 В современном мире фейки встречаются на каждом шагу. Новости, статьи, фотографии, видео - все может быть подделкой. Умение распознавать фотофейки - это важный навык, который поможет вам не стать жертвой обмана.
🎓 Играйте и учитесь!
📸🔍📸🔍📸🔍📸🔍
🎮 Bizning platformamizda esa - yangi o'yin! Uni o'ynash orqali siz tasvirlarni tekshirishni, tanqidiy fikrlashni yaxshilashni va tafsilotlarga ko'proq e'tibor berishni o'rganasiz.
🔍 Zamonaviy dunyoda feyklar va soxta narsalar har qadamda topiladi. Yangiliklar, maqolalar, fotosuratlar, videolar - hammasi feyk bo'lishi mumkin. Feyk fotosuratlarni fosh etish qobiliyati sizni aldov qurboni bo'lmaslikka yordam beradigan muhim ko'nikmadir.
🎓 O'ynang va bilim toping!
#qlever#oyin#fakes#tanqidiyfikrlash#photofake#qlever#игра#фейки#критическоемышление#фотофейк
🎮Qlever
📹Instagram
💬Telegram