Почему я люблю языки с сильной системой типов, проверяемой статическим анализом кода — хорошо написанная программа является своей собственной спецификацией и позволяет выражать через язык программирования законы существования предметной области.
Когда-то давно я писал на ActionScript. Там была система типов, но вот десериализация JSON'ов по-умолчанию была в какой-то общий Object, к полям которого нужно было обращаться ["по_строковому_имени"]. В один момент мне потребовалось написать что-то на C#, который я совсем не знал, я стал гуглить, как десериализовать JSON, и с удивлением обнаружил кучу советов заранее объявить класс со всеми нужными полями и десериализовать в него.
"Какой ужас!", — подумал я тогда, — "Это же дико неудобно! А если я не знаю полей JSON? А если их много? Отвратительный язык!"
Теперь то я прекрасно понимаю, что JSON это контракт, и что правильная десериализация только такая и должна быть, и что в хорошем API в одном поле никогда не бывает данных принципиально разных типов, и так далее.
Нет, если вы набиваете вечерами пет-проект или сидите бессонную ночь на хакатоне, нет ничего плохого в том, чтобы взять простой язык с динамическими типами вроде JavaScript или Python, не требующий описывать данные. Но вот в энтерпрайзе, особенно когда над одним проектом работает много людей (а бывает это очень часто) — хорошее использование системы типов убережёт разработчиков от огромного количества ошибок, будет бить их по рукам, когда они пытаются сделать что-то не то, и будет подсказывать, когда они не уверены в чём-то.
С помощью статической типизации можно на уровне кода обозначить правила, по которым ведёт себя предметная область вашей программы в реальном мире. Разработчику не только будет сложно их нарушить, но он ещё и станет узнавать какие-то вещи, которые мог не знать раньше.
Например, если мы делаем медицинскую CRM, и больница заводит новых пациентов только тогда, когда знает их группу крови, мы можем объявить тип "Пациент" (или, если точнее, "Карта пациента") и запретить создавать экземпляры этого типа, не передав в конструктор группу крови (которая, в свою очередь, тоже является типом, вероятнее всего ValueObject'ом). Если новый программист пришёл в проект, он, во-первых, не сможет записать в БД некорректную карту пациента. Понятно, мы не учитываем случаи, когда новый программист переделывает модели предметной области — это будет хорошо видно на кодревью. А, во-вторых, даже если ему никто не сказал, что пациенты должны быть с группой крови, он узнает это из кода. И уже будет понимать, что в тех процессах реальной жизни, которые он описывает кодом, карта пациента создаётся только при наличии группы крови. А, значит, нужно искать какой-то способ сначала эту группу крови получить, и только потом создавать карту. Программирование моделирует реальный процесс.
В настоящей работе даже на языках с типами, конечно, без должного контроля можно написать что угодно. Нужна управленческая воля, компетентность руководства, понимание опасности техдолга, в идеале отдельные должности для архитекторов, опытные лиды и старшие разработчики. Но когда всё это есть, можно отсекать много проблем ещё на старте и проще погружать новичков.
#dev
⚡️
🇷🇺
🇺🇦⚔️ Ukraine Fronts on the Morning of 21 March⚡️
🔴#Sumy Direction:
🔴In #Sudzha Sector, to the west near #Zhuravka the RFAF are around 2 km deep in Ukrainian lands. The village itself, is ca. 50% under Russian control.
🟡#Basovka, to the southeast, is about 70% seized.
🟡#Novenkoye, further north, is Russian controlled. The AFU have abandoned the settlement.
🟡 The border zone to the east is grey zone.
🟡#Rubanshchina in #Kursk region, is Russian controlled.
🟡#Gogolevka to its east is still under AFU control.
🟡 Southeast of #Gogolevka, the RFAF expanded their zone of control. The wedge is also north #Melovoy, the control of which is unclear (AFU or Grey Zone).
🟡#Oleshnyaremains safe under AFU control.
🟡#Guyevo is likely still AFU controlled, the RFAF expanded their zone and have advanced close to its northern edge.
🟡#Gornal remains safe under AFU control.
📌 As a Result, there no cauldron for now. UAV and artillery are working on both sides. In fact, the AFU losses are far higher than the RFAF's, which is well documented by objective evidence. This, due to the AFU Command's decision to hold the remaining villages at any costs.
🔴 In #KrasnayaYaruga Sector, south of #Sudhza in Russian #Belgorod region, the AFU assaults continue with focus on #Demidovka, where AFU infantry could entrench at its southern edge. Shooting battles have been reported. According to unconfirmed reports, the village ruins are still Russian controlled.
🟡#Grafovka to its southeast remains under firm Russian control.
🟡#Prilesye also further south.
🗺 All on Map 1
📌 The AFU Command, following significant losses of tanks and armoured vehicles, has changed its tactics. Attacks are now only carried out by infantry groups with drone and artillery support.
🔴 In #Kharkov Direction and at #Svatovo Front, there are no major changes.
🔴#ChasovYar Direction:
🔴In #ChasovYar Sector, no changes.
🔴In #Toretsk Sector, northeast of the city, the reported RFAF advance towards #Ozeryanovka has been confirmed by footage.
🟡 At #Druzhba, the RFAF expanded the zone of control north of the village by around 600m.
🟡 In #Toretsk, the RFAF had tactical successes.
🔴#Pokrovsk Direction:
🔴 On the right Flank, the AFU counterattack and managed to push back Russian units in the area of the 'Malinovskaya junction.'
🟡#Tarasovka has been entered by Russian assault groups, which managed to expand the control zone in the village by 400m.
🗺 Map 2
🎬 Video
🟡 In #Yelizavetovka, there are heavy counterbattles.
🔴 South of the City, contrary to earlier reports, #Shevchenko village is still embattled. Russian troops expanded their zone of control.
🗺 Map 3
🔴 On the left Flank, heavy fighting without significant changes.
🔴#Komar Direction:
🔴In #Konstantinopol Sector, the battles incl. for #Konstantinopol itself continue, no major changes.
🔴 In #Komar Sector, heavy fighting continues. According to field reports, the Russian troops have entered the southern outskirts of #Vesyoloye.
🔴#Zaporozhye Direction:
🔴In the #Orekhov Section, bloody battles for #Shcherbaki and #MalyeShcherbaki, as well as on the approaches to #Lobkovoye continue.
🔴 In #Kherson Direction, the AFU struck civil targets.
💥#OldRussia:
🔵In #Kursk Region, the AFU struck and destroyed the 'Sudzha Gas Transmission System,' through which gas from #Russia was supplied to the #EU. In #Rostov region, a UAV attack was repelled at night. In the #DPR, 1 civilian was killed and 4 wounded by AFU attacks on civilian targets.
💥#RestUkraine:
🔵 In #Odessa Region, several Geranium UAV hits have been reported, incl. at the 'Telekart-Pribor Plant' in #Odessa. Explosions occurred also in #Zatoka, #Kiev, #Poltava, #Zaporozhye, and #Cherkassy regions.
🎞 Video Source
🗺 Maps @olegtsarov; @creamy_caprice
📋 Sources: CC; Tsarov; ⚡️2M;
🇺🇦Fiend;😼Kotenok
🕰As of 21 Mar 2025; 06:42 GMT+3;📃20 Mar
📱 Join GLOBAL DEPTH to boost your TG Feed
💬Join Military Chat for Comments & Discussions
🇺🇦On Ukraine Observer you will find your daily independent Ukraine War Battle Update
⚡️
🇷🇺
🇺🇦⚔️ Ukraine Fronts on the Morning of 19 March⚡️
🔴#Sumy Direction:
🔴In #Sudzha Sector, to the west in #Ukraine, fights in and around #Zhuravka. To the southeast...
🟡 In #Basovka, the RFAF have advanced and the battle has shifted to the southern settlement part.
🟡 In #Kursk region, the battles for the villages of #Gogolevka and #Guyevo continue.
🟡#Oleshnya and #Gornal remain under AFU control.
🗺 Map 1; added arrows show the mentioned locations, black contested
🔴 In #KrasnayaYaruga Sector, the AFU crossed the border in the area of the #Demidovka, #Grafovka and #Prilesye villages south of #Sudhza in #Belgorod region. Several attack waves have been stopped by destroying armoured vehicles. The AFU remnants tried to get a foothold. Fights on Russian territory, especially towards #Demidovka with tank support continued. According to the latest unconfirmed report, the invaders have withdrawn to their initial positions in #Sumy region.
🎬 Video 1
🗺 Map 2
🔴#Kharkov Direction:
🔴In #Liptsy Section, the AFU counterattacked unsuccessfully in the settlement area of #Glubokoye.
🔴 In #Volchansk Section, the battle for the city continues.
🔴#Svatovo Front:
🔴 In #Kupyansk Sector, to the north, the RFAF are advancing from #Topoli southwestwards towards #Kamenka, the eastern approaches of which are also attacked. Furthermore Russian troops advance from the south on the village.
🟡 Near #Krasnoye1st(Pervoye), to the southwest, Russin units are advancing on the settlement.
🟡#Figolevka, located further southwest, has been recaptured by the AFU.
🟡 North of #Kupyansk, Russian units are expanding the bridgehead northeast of #Kondrashovka.
🟡 Northeast of #Kupyansk, the AFU counterattacks in the area of #Petropavlovka.
🔴 In #Borovaya Sector, fierce fighting in the northern outskirts of #Boguslavka continues.
🔴In #Liman Sector, Russian troops have advanced to #BalkaZhuravka's northern settlement outskirts and continue to attack in the westerly direction.
🟡 North of #Torskoye, positional battles are taking place.
🔴In #Seversk Sector, fights in the area of #Bologorofka (#LPR) continue. The AFU still hold positions on the Chalk Quarry (White Mountain) south of the village.
🟡 In #Verkhnekamenskoye, fights for the centre.
🔴#ChasovYar Direction:
🔴In #ChasovYar Sector, fierce battles continue. The AFU counterattacks.
🔴In #Toretsk Sector, the situation is unchanged.
🔴#Pokrovsk Direction:
🔴 South of the City, heavy battles and counterattacks continue. The situation is dynamic.
🟡#Shevchenko has been recaptured by Russian forces. The AFU counterattacks.
🟡 In #Peschanoye, the same situation as for #Shevchenko.
🟡 In #Kotlino, the northwestern outskirts and the cemetery area are embattled.
🔴 On the left Flank, the battle for #Udachnoye continues.
🔴#Komar Direction:
🔴In #Konstantinopol Sector, west of #Andreyevka, the AFU have pushed back Russian assault groups, which attacked towards #Alekseyevka.
🟡 In #Konstantinopol, the RFAF lost control over the village. The AFU have advanced into its centre.
🎬 Video 2
🟡 South of #Konstantinopol, the RFAF expanded their control zone by more than 1 km. The battle for the village continues.
🟡 From #Razdolnoye, Russian units advanced northwards towards #Razliv and #Bogatyr.
🔴 In #Komar Sector, northwest of #VelikayaNovosyolka, the RFAF are building on their success at #Burlatskoye.
🔴#Zaporozhye Direction:
🔴In the #Orekhov Section, we have to clarify that according to objective evidence data, #Shcherbaki, #MalyeShcherbaki and #Stepovoye are still contested.
🔴 In #Kherson Direction, no changes.
💥#OldRussia:
🔵 In #Krasnodar Territory, the AFU struck the 'Kavkazskaya Oil Transshipment Point.' This, after the Trump - Putin call.
🎞 Video 1 Source; 🎞 Video 2 Source
🗺 Maps @olegtsarov
📋 Sources: CC; Tsarov; ⚡️2M;
🇺🇦Fiend; 😼Kotenok
🕰19 Mar 2025; 06:43 GMT+3; #smo
📱 Join GLOBAL DEPTH to boost your TG Feed
💬Welcome to Military Chat & Ukraine Observer
🇺🇦On Ukraine Observer you will find your daily independent Ukraine War Battle Update
⚡️
🇷🇺
🇺🇦⚔️ Ukraine Fronts on the Morning of 20 March⚡️
🔴#Sumy Direction:
🔴In #Sudzha Sector, in the west, fighting continues in and near #Zhuravka, as well as southeast of it in #Basovka on Ukrainian territory.
🟡 In #Kursk region, fierce battles in the areas of the #Gogolevka and #Guyevo villages continue.
📌 Referring to Previous Reports, doubts have arisen as to whether fights are already taking place in the villages. There is still no objective control footage. We have corrected our arrows on map accordingly, which show the control and mentioned locations.
🟡#Oleshnya and #Gornal remain safe under AFU control.
🔴 In #KrasnayaYaruga Sector, south of #Sudhza in Russian #Belgorod region, further massive AFU assaults especially on #Demidovka, as well as in the areas of #Grafovka and #Prilesye have been foiled. The search for the remnants is ongoing.
🗺 All on Map 1
✈️An AFU F16 was downed.
📌 The AFU Command is reportedly reinforcing all areas and intends to continue also the attacks on #Belgorod region.
🔴 In #Kharkov Direction, without significant changes.
🔴#Svatovo Front:
🔴 In #Kupyansk Sector, fierce fighting along the LoC continues, but without changes.
🔴 In #Borovaya Sector, the battle for #Boguslavka continues.
🔴In #Liman Sector, the RFAF advanced west of the #BalkaZhuravka settlement.
🔴In #Seversk Sector, fights in the area of #Bologorovka (#LPR) and in #Verkhnekamenskoye continue.
🔴#ChasovYar Direction:
🔴In #ChasovYar Sector, the northwestern part of the city is almost completely under Russian control. The battle for the centre southwest of the 'Refractory Plant' continues. Russian troops attacked from the east with armoured vehicles. The result of the battle is disputed.
🗺 Map 2
🎬 Video 1
🔴In #Toretsk Sector, northeast of the city, RFAF units attacked northeast of the #Druzhba settlement towards positions taken by Russian assaults beyond the canal near #Ozeryanovka.
🟡 In #Toretsk itself, the RFAF expanded their zone of control.
🔴#Pokrovsk Direction:
🔴 On the right Flank and south of the city, without significant changes.
🔴 On the left Flank, the battle for #Udachnoye continues as usual.
🟡 In #Uspenovka, the fierce battle continues and towards #Novoalexandrovka southwest of it.
🟡 In #Preobrazhenka, fighting for the eastern settlement part continues. To the south, the Russian troops are attacking towards #Troitskoye and #Bogdanovka.
🔴#Komar Direction:
🔴In #Konstantinopol Sector, the RFAF advanced west of #Slavyanka and north of #Andreyevka, but were driven out of a stronghold northwest of the latter.
🟡 In #Konstantinopol, the battle continues.
🔴 In #Komar Sector, the yesterday reported Russian advance south of #Privolnoye has been confirmed, the fights for the village itself continue.
🔴#Zaporozhye Direction:
🔴In the #Orekhov Section, north of #Rabotino the RFAF attack towards #Novodanilovka and further west in the direction of #Novoandreyevka.
🟡 For #Shcherbaki and #MalyeShcherbaki, the battle continues.
🟡#Stepovoye came, according to unconfirmed reports, under Russian control, as well as heights north of it.
🟡 For #Lobkovoye, the battle has begun with fights in the village (unconfirmed), alternate on its approaches.
🔴 In #Kherson Direction, without significant changes.
💥#OldRussia:
🔵In #Voronezh Region, ca. 40 AFU UAVs were downed overnight. In the #Saratov region, Zelensky tried to raid the Oil Refinery in #Engels, as a result of which the 'City Clinical Hospital No. 1' has been damaged. In the #Rostov region, another UAV attack was repelled. In #Gorlovka (#DPR), 11 civilians were wounded yesterday by Zelensky's morning shelling of the city centre.
💥#RestUkraine:
🔵 In #Kirovograd Region, in turn, after a massive Geranium UAV attack, more than 30 explosions occurred in the town of #Kropyvnytsky.
🎬 Video 2
🎞 Vids Source 1; Source 2;
🗺 Maps @olegtsarov; @creamy_caprice
📋 Sources: CC; Tsarov; ⚡️2M;
🇺🇦Fiend; 😼Kotenok
🕰20 Mar 2025; 06:44 GMT+3; #smo
📱 Join GLOBAL DEPTH to boost your TG Feed
💬Welcome to Military Chat & Ukraine Observer