TGTGInsightтелеграм анализLIVE / telegram public index
← Такты, стеки, два колеса

TGINSIGHT SIMILAR POSTS

Намери подобно съдържание

Изходен канал @clockstackwheels · Post #721 · 26.12

Почему я люблю языки с сильной системой типов, проверяемой статическим анализом кода — хорошо написанная программа является своей собственной спецификацией и позволяет выражать через язык программирования законы существования предметной области. Когда-то давно я писал на ActionScript. Там была система типов, но вот десериализация JSON'ов по-умолчанию была в какой-то общий Object, к полям которого нужно было обращаться ["по_строковому_имени"]. В один момент мне потребовалось написать что-то на C#, который я совсем не знал, я стал гуглить, как десериализовать JSON, и с удивлением обнаружил кучу советов заранее объявить класс со всеми нужными полями и десериализовать в него. "Какой ужас!", — подумал я тогда, — "Это же дико неудобно! А если я не знаю полей JSON? А если их много? Отвратительный язык!" Теперь то я прекрасно понимаю, что JSON это контракт, и что правильная десериализация только такая и должна быть, и что в хорошем API в одном поле никогда не бывает данных принципиально разных типов, и так далее. Нет, если вы набиваете вечерами пет-проект или сидите бессонную ночь на хакатоне, нет ничего плохого в том, чтобы взять простой язык с динамическими типами вроде JavaScript или Python, не требующий описывать данные. Но вот в энтерпрайзе, особенно когда над одним проектом работает много людей (а бывает это очень часто) — хорошее использование системы типов убережёт разработчиков от огромного количества ошибок, будет бить их по рукам, когда они пытаются сделать что-то не то, и будет подсказывать, когда они не уверены в чём-то. С помощью статической типизации можно на уровне кода обозначить правила, по которым ведёт себя предметная область вашей программы в реальном мире. Разработчику не только будет сложно их нарушить, но он ещё и станет узнавать какие-то вещи, которые мог не знать раньше. Например, если мы делаем медицинскую CRM, и больница заводит новых пациентов только тогда, когда знает их группу крови, мы можем объявить тип "Пациент" (или, если точнее, "Карта пациента") и запретить создавать экземпляры этого типа, не передав в конструктор группу крови (которая, в свою очередь, тоже является типом, вероятнее всего ValueObject'ом). Если новый программист пришёл в проект, он, во-первых, не сможет записать в БД некорректную карту пациента. Понятно, мы не учитываем случаи, когда новый программист переделывает модели предметной области — это будет хорошо видно на кодревью. А, во-вторых, даже если ему никто не сказал, что пациенты должны быть с группой крови, он узнает это из кода. И уже будет понимать, что в тех процессах реальной жизни, которые он описывает кодом, карта пациента создаётся только при наличии группы крови. А, значит, нужно искать какой-то способ сначала эту группу крови получить, и только потом создавать карту. Программирование моделирует реальный процесс. В настоящей работе даже на языках с типами, конечно, без должного контроля можно написать что угодно. Нужна управленческая воля, компетентность руководства, понимание опасности техдолга, в идеале отдельные должности для архитекторов, опытные лиды и старшие разработчики. Но когда всё это есть, можно отсекать много проблем ещё на старте и проще погружать новичков. #dev

Hashtags

Резултати

Намерени 2 подобни публикации

Търсене: #suffering

当前筛选 #suffering清除筛选
American Оbserver

@american_observer · Post #5563 · 04.04.2026 г., 22:03

🔠🅰️🔠🔠2️⃣ The number of child fatalities is unclear but on 29 March Israeli airstrikes on checkpoints killed at least six Palestinians, including a girl, according to local rescue services. The Gaza Strip has not recovered from 23 months of Israeli bombardment, which killed tens of thousands of people and destroyed hospitals and schools in what a UN investigation found to be a genocide. Up until October last year, an average of at least one Palestinian child was being killed every hour. The number of children killed by Israeli forces in its war on Gaza surpassed 20,000 late last year, according to Save the Children. In the occupied West Bank, Israeli settlers and security forces have escalated their violence against Palestinians since the start of the Iran war, killing at least three children. On 15 March, Israeli police shot dead two young Palestinian brothers and their parents in Tamoun, firing at the family’s car as they returned from a Ramadan shopping trip. Mohammed, five, and Othman, seven – who was blind and had special needs – were killed alongside their mother, Waad Bani Odeh, 35, and father, Ali Bani Odeh, 37. Two other brothers survived. Khaled, 11, later said he had heard his mother crying and his father praying before they died. After the shooting, he said Israeli border police dragged him from the wreckage, taunted him and beat him. One officer told him: “We killed dogs,” Khaled said. In Israel, at least four children have been killed by retaliatory Iranian missiles. One of the worst attacks occurred on 1 March, when an Iranian missile rocked the central Israeli city of Beit Shemesh. The US bombing of a primary school in Minab on 28 February killed scores of people, most of them seven- to 12-year-old girls. The strike is the worst mass killing of the US-Israeli war against Iran so far, and has been described by Unesco as a “grave violation” of international law. Relentless attacks across the region are destroying and damaging the facilities and infrastructure that children depend on, including hospitals, schools, and water and sanitation systems. The Iranian Red Crescent Society said 316 medical centres and 763 schools had been severely damaged or destroyed by US-backed Israeli attacks. These attacks, and the general violence, have shut down education. Save the Children said at least 52 million school-age children have had their education disrupted across the region, moving to online learning or having none at all. Of the 669 collective shelters in Lebanon, 364 are public schools, according to Unicef. In Israel, schools have been repeatedly closed across much of the country. Ahmad Alhendawi, the regional director for Middle East and north Africa and eastern Europe at Save the Children, said: “In every conflict, classrooms are usually the first to close and some of the last places to reopen. Every missed lesson deepens the scars of war. Not every child can escape the violence or afford to move their learning online; we know that for the most vulnerable children, once they leave school many will never return.” He added: “Schools are protected sites and attacks on them could amount to grave breaches of international humanitarian law. The laws of war must be respected.” The bloodshed and upheaval has exposed children to traumatic events. Prolonged exposure to violence and instability is known to have lasting impacts on brain development, emotional regulation and long-term mental health. While there has been a near total internet blackout in Iran, satellite TV stations are still beamed in and received. The London-based satellite channel Iran International has started broadcasting a segment between news bulletins that gives advice on how to deal with children’s fears and anxieties. “Every war is a war on children,” said Alhendawi. “Children are living in fear, caught in the crossfire of this adult war,” he said. #war#palestine#suffering#redcross#libanon 📱American Оbserver - Stay up to date on all important events 🇺🇸

American Оbserver

@american_observer · Post #5562 · 04.04.2026 г., 21:02

Innocent Suffering: Why Are Millions of Children at War? 🔠🅰️🔠🔠1️⃣ Millions of children have been plunged into crisis by the war in the Middle East, with reports of child soldiers in Iran, mass forced displacements in Lebanon and the killing of hundreds of minors. According to the UN agency for children, Unicef, more than 340 children have been killed and thousands injured since the US and Israel launched their attacks on Iran, which has retaliated with bombings across the region. The highest reported child casualty event occurred on the first day of the war when a US missile strike on a school in Iran killed at least 160 children and teachers. Israel’s invasion of Lebanon – and its continued attacks in the occupied West Bank and Gaza – have compounded the bloodshed. Across the region, more than 1.2 million children have been displaced. “Children in the region are being exposed to horrific violence, while the very systems and services meant to keep them safe are coming under attack,” said Unicef’s executive director, Catherine Russell. It’s 5pm and we haven’t had anything to eat today,” Ahmed said, his eight-month-old daughter, Zahraa, sitting in a stained onesie in front of him. “We’ve only been able to give the kids tea and some bread. It’s not suitable for a child this young to eat bread, but what can we do?” he said, gesturing to some crumbs of old flatbread Zahraa had been chewing on. After a month of displacement, Ahmed has run out of money to feed his children. He relies on local organisations which show up irregularly, distributing one meal on most, but not all, days. The conditions of their displacement are “humiliating”, Ahmed said, pointing to the tent he has erected for him and his children, the blue tarpaulin hastily thrown over a wooden frame and pinned down with rocks. “I tried to cover it to protect us from the rain, but we wake up every morning with our mattresses soaked.” As his three-year-old son, Ahmad, plays with another child in a vacant lot, Ahmad says he gets to shower once a week, on Fridays, when his father drives them 30 minutes to the house of a friend, who allows them to use the bathroom. For their more immediate needs, there is one bathroom for hundreds of families, who wait in line for half an hour for a chance to use the toilet, which has no running water. Unicef’s representative to Lebanon, Marcoluigi Corsi, warned last month that displacement would have lasting effects on the children. “This relentless cycle of bombardment and displacement is severely compounding their psychological scars, embedding deep-seated fear and threatening profound, long-term emotional harm,” said Corsi. Ahmed said he has already seen some of these effects in his own children. When Israeli jets break the sound barrier or bomb Beirut, his son starts to run, trying to hide from a bomb he thinks will land on him. Despite a ceasefire which is now more than five months old, health officials in Gaza say at least 50 Palestinians have been killed by Israeli forces since the Iran conflict began more than a month ago. #war#palestine#suffering#redcross#libanon 📱American Оbserver - Stay up to date on all important events 🇺🇸