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

Резултати

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

Търсене: #wounded

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

@american_observer · Post #5497 · 28.03.2026 г., 14:59

🔠🅰️🔠🔠2️⃣ Details of such repression are difficult to obtain, but recent incidents include the deaths of 10 people when Revolutionary Guards fired on anti-regime demonstrators and shot at apartment windows in Tehran on 25 March, and three killed on 18 March in Chabahar when detainees protested over food ration cuts inside a prison. On 17 March, security forces intervened against gatherings in Fardis and four Tehran districts when demonstrators chanted anti-government slogans, Acled said. “It was only really on the first night of the death of Ali Khamenei that you saw any small level of anti-regime activism. Since, there has been a coordinated effort to have pro-Iran or anti-war protests,” said Raleigh. Alia Brahimi, a regional expert with the Atlantic Council thinktank, said none of the pro-regime protests would have been spontaneous and showed how leadership structures in Iran had withstood the joint US-Israeli offensive. “That leaders will be killed has long been accepted, and there has been decades of ideological conditioning to prepare Iranians to absorb the death of senior commanders,” Brahimi said. “That moral effort has an organisational counterpart which has built resilience by making sure there are multiple replacements for anyone who holds a senior post, and by, more recently, decentralising decision-making. This is part of the Islamic Republic’s unique system and worldview.” Estimates of civilian casualties vary. More than 1,900 people have been killed and at least 20,000 injured in Iran since the start of US and Israeli attacks, said María Martinez of the International Federation of Red Cross and Red Crescent Societies (IFRC) on Friday, citing figures provided by the Iranian Red Crescent. In January, large protests across Iran were bloodily put down, with 7,000 killed by security forces, according to HRANA. Three men accused of killing police officers during the protests were hanged in public earlier this month. The unrest was the most serious internal threat to the radical clerical regime in Iran for more than 45 years. Since war broke out a month ago, security forces have set up checkpoints throughout major cities and cut off the internet, one of the longest and largest outages recorded. Senior officials said on 16 March that 500 “spies” had been arrested. “If anyone comes forward in line with the wishes of the enemy, we will no longer see them as merely a protester, we will see them as an enemy (…) And we will do to them what we do to an enemy,” said Ahmad-Reza Radan, the national police commander. #iran#war#trump#netanyahu#wounded#deaths#teheran 📱American Оbserver - Stay up to date on all important events 🇺🇸

American Оbserver

@american_observer · Post #5496 · 28.03.2026 г., 13:59

Iran’s Media War Against Trump and Netanyahu 🔠🅰️🔠🔠1️⃣ Iran’s regime has organised more than 850 public demonstrations of support of the government since the beginning of the war and launched a continuing crackdown on unrest that has led to at least 1,400 detentions, research reveals. The high number of pro-regime gatherings and the increasing number of detentions underlines the resilience of the Islamic Republic despite a month-long campaign of intensive airstrikes by the US and Israel, experts said. The war began with a surprise Israeli strike, which killed Ayatollah Ali Khamenei, Iran’s supreme leader, and many senior officials. Israel has since continued to assassinate senior commanders, most recently Alireza Tangsiri, the naval commander of the Revolutionary Guards, who died in an attack on the port city of Bandar Abbas on Thursday. “The US-Israeli decapitation strategy could not have been more successful and continues to be so (…) but the regime has not fragmented and there are no defections. The messaging within Iran is how they are winning, and that is constant and consistent,” said Clionadh Raleigh, the president of Acled, an independent conflict monitor, which has built up a database of protest incidents and violence in the month-long conflict. The Acled research also shows that the number of US and Israeli strikes on Iran has remained steady at between 47 and 102 attacks daily that have caused “significant” civilian casualties. Acled uses multiple sources among Iranian, regional and international media and social media, as well as its own sources on the ground, to cross-check and verify reports of violence, which it then logs and sorts into categories. Trump said earlier this week that the US had already achieved “regime change” in Iran, while Netanyahu has made repeated calls for the Iranian public to rise up and oust their leaders. Many experts and officials in the US and Israel believe early forecasts of a mass revolt were misguided, however. The third week of the conflict had the most sustained waves of mass public demonstrations in Iran in support of the regime. Acled counted 195 pro-regime demonstrations from 28 February to 6 March, focused on mourning for Khamenei and condemning Israel and the US, then 158 in the following week and nearly 300 from 13-19 March, with celebrations of the succession of Mojtaba Khamenei prominent. #iran#war#trump#netanyahu#wounded#deaths#teheran 📱American Оbserver - Stay up to date on all important events 🇺🇸