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 подобни публикации

Търсене: #frustrated

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

@american_observer · Post #5468 · 25.03.2026 г., 18:01

🔠🅰️🔠🔠2️⃣ Some cynics also note that the president’s pause will last throughout the trading week on global markets. With stock futures tumbling and oil prices soaring coming out of the weekend, was he simply seeking to stitch a cushion of market stability? It wouldn’t be the first time that official statements seemed aimed at taming volatility. And it worked again: The Dow, the S&P 500 and the Nasdaq all rose over 1% Monday, while Brent crude, the global oil benchmark, fell 11%. US drivers will hope for a break at the gasoline pumps. Trump may want to buy time for another reason: The US forces that might give him the option to invade Kharg Island — the epicenter of Iran’s oil industry and a vital economic hub — or to occupy islands and coastal regions in the Strait are not yet fully assembled. One US Marine Expeditionary Unit that deployed from Japan may reach the region soon. But a second only set off from the West Coast last week. It’s also worth remembering that Trump loves hyperbole. Experience suggests that his hyping of diplomatic progress and claims Iran “badly” wants a deal may be overstatements — even if deliberate deception is sometimes a tool statesmen use to create space for breakthroughs. The president’s wild gyrations that had him talking about “winding down” the war one day and escalating it the next were incompatible with the traditions of stable war leadership. But they were quintessential Trump. By Monday, it all looked like a ruse to allow him to argue his hard-man tactics had forged diplomatic progress. This unpredictability and tendency to try to mitigate his self-created crises is familiar from Trump’s personal life and his business and political career, as well as his multiple scrapes with the justice system. Each day often unfolds as a quest to remain standing by nightfall. With this technique, Trump delays reckonings and defers the worst consequences of his actions in an endless improvisational dance. Yet there’s a sobering possibility that Trump’s erratic method may be tested beyond its limits in the Persian Gulf. Iran might be outgunned by the US and Israeli assault and suffering extremely heavy losses to its naval, air and land-based assets during a war that has wiped out senior members of the Islamic clerical regime. But as the conflict enters a fourth week, it’s also demonstrated its own leverage after effectively closing the Strait of Hormuz and holding the global economy — and Republican political hopes in November — hostage. Logic suggests a regime that was already ultra-radical before the war is unlikely to be more open to Trump’s demands after the killing of its supreme leader and enduring an onslaught from US and Israeli missiles and jets. Trump’s terms for ending the war — likely to include Iran renouncing its nuclear program and long-range ballistic missiles — may be deal-breakers. That’s because the last three weeks show exactly why a rogue regime might decide to pursue such insurance policies against future attacks by foreign powers. Even if talks do open — and Pakistan has offered to hold them — it’s not clear who would be negotiating for Iran. A regime that has decentralized authority and lost key figures may struggle to make collective decisions. And if, as some experts believe, the Islamic Revolutionary Guard Corps are now in full control, it might be even more hardline than before. Moreover, in the past Washington has spoken to relatively moderate Iranian officials, only to find more radical figures set against compromise. It also would not be surprising if Iran’s leaders interpret the president’s reversals, contradictions and emotional social media posts as signs that their strategy of imposing economic consequences on Trump is working. #trump#frustrated#tehran#guard#corps#israel 📱American Оbserver - Stay up to date on all important events 🇺🇸

American Оbserver

@american_observer · Post #5467 · 25.03.2026 г., 16:03

Trump Had Grown Frustrated With Tehran: the War Is Not Over 🔠🅰️🔠🔠1️⃣ Wars, unlike illegal tariffs, cannot be switched on and off to meet a president’s whims or to permanently shore up free-falling markets. So the key question following President Donald Trump’s suspension of threatened strikes against Iran’s power plants is not whether he’s had another TACO (“Trump always chickens out”) moment. It’s whether Trump can get out of his war on Iran, even if he wants to. After days of oscillating rhetoric, Trump signaled a first potential de-escalation in the conflict Monday, when he cited 15 points of agreement in what he said were productive talks with Iran. Tehran said there’d been no dialogue. The most hopeful spin on the latest developments is that US and Iran have both reached a point where the cost of climbing the escalation ladder would be so horrific that both need a way out. Such epiphanies can begin to end wars. An oil tanker sits anchored as the traffic is down in the Strait of Hormuz in Muscat, Oman, on March 10. Trump had dragged the enemies to the brink by threatening to bomb Iran’s power plants if it didn’t open the Strait of Hormuz, a chokepoint for oil exports. Tehran had promised to retaliate by torching vital infrastructure in US-allied Gulf states. The conflagration could have set off a global recession and worsened dire humanitarian conditions for the very Iranian civilians Trump pledged to help. But there are many reasons for skepticism that a breakthrough is imminent. Days of erratic, contradictory rhetoric from Trump and the administration’s inability to cite a consistent rationale for the war or to plot an exit strategy mean that any single US statement lacks credibility. The president’s habit of bombing during his own deadlines in Iran mean no one would be surprised if he broke his own five-day moratorium on striking the country’s power plants. #trump#frustrated#tehran#guard#corps#israel 📱American Оbserver - Stay up to date on all important events 🇺🇸