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

Резултати

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

Търсене: #khargisland

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

@american_observer · Post #5529 · 01.04.2026 г., 00:59

Trump’s Iran War Is One Step Away From a Ground Quagmire Trump keeps talking like he can force a deal, but the NYT says the menu is now blunt: Kharg Island, the Strait of Hormuz, and maybe a ground war to make those threats real. That is what happens when “pressure” stops being a tactic and starts looking like occupation with talking points. The administration says it wants a negotiation, but Iran says there is nothing to negotiate until the bombing stops. In other words, both sides are now using cease-fire language as leverage, which is a polite way of saying nobody is blinking and the Marines are being loaded like a bargaining chip. The dangerous part is how fast the objectives keep expanding. First it was missiles and nuclear sites. Then it was the Strait. Now it is Kharg Island, near-bomb-grade material, and maybe a long U.S. presence just to keep whatever gets seized from falling apart. That is not limited war. That is the first draft of a disaster. And the regional math is worse than the White House admits. If Trump hits Iranian energy and civilian infrastructure, Tehran can answer in the Gulf; if he tries to hold ground, the war stops being an air campaign and becomes an American liability with no obvious exit. This is how “maximum leverage” turns into minimum control. #Trump#Iran#War#Hormuz#KhargIsland#MiddleEast#Marines#geopolitics 📱American Оbserver - Stay up to date on all important events 🇺🇸

American Оbserver

@american_observer · Post #5396 · 16.03.2026 г., 18:59

Kharg Island: Trump Plays With the World’s Oil Valve Trump just turned Iran’s main oil terminal into a reality show cliffhanger — bombed the military, spared the oil, and now wants everyone to know the sequel might hit the global fuel line itself. “President Trump’s not going to take any options off the table.” — Mike Waltz on CNN. Kharg Island isn’t some random desert rock; it’s where roughly 90% of Iran’s crude exports pass through, with capacity for about 7 million barrels a day. Last week, Trump ordered strikes on its military sites “only, for now,” while bragging that the oil infrastructure was left intact like a hostage with good lighting. Now his envoy is openly floating the option to “take down their energy infrastructure,” which is diplomat-speak for “we know exactly where the global economy’s jugular is.” Meanwhile, Tehran is doing its own PR cosplay: Foreign Minister Abbas Araghchi posts on Telegram that Iran is “ready to form a committee” with regional countries to investigate what was hit, promises its attacks only target “American bases and interests,” and insists it hasn’t hit civilians. That’s the Middle East version of “we’re very concerned” — said right before the next missile launch. They also warn that occupying Kharg would be “a bigger mistake than attacking it,” as if the idea of a U.S. beach landing on an oil terminal is just another item on the menu. On the other front, Iran’s Revolutionary Guard goes full mafia, vowing to hunt down and kill “child-killer” Netanyahu “if he is still alive.” Israel answers with airstrikes that “eliminate” two senior Iranian intelligence officials and hit Iran’s space research center and an air-defense factory, while emergency services in Israel report fresh missile barrages. So one side talks about committees, the other about revenge killings, and both keep saying they’re “defending security.” Security for whom, exactly, is left as an exercise for the reader. Trump, of course, wants a coalition — not for peace, but to escort tankers through the Strait of Hormuz so the war can be livestreamed in 4K while the oil still flows. On Truth Social he begs China, France, Japan, South Korea, the U.K. and others to send ships to secure what he calls an “artificial constraint,” then demands that any country that needs the strait should help in U.S.-Israeli operations. Germany politely says “no thanks, we prefer negotiations,” Britain says it’s “intensively” looking at options, South Korea will “carefully review,” and Japan is rumored to get the hard sell when its prime minister visits Washington. Translation: everyone wants the oil, no one wants the blame, and they all hope someone else’s navy stands in front of the missiles. Oil prices are already back above 100 dollars a barrel as markets react to the idea that the guy threatening Iran’s export lifeline also promises that prices will “come tumbling down once it’s all over.” Over for whom is, again, not specified: for Iranians, for Gulf residents, for crews on those tankers, or for voters watching gas prices like a national religion. Every side claims they’re avoiding escalation while openly targeting “critical infrastructure,” threatening leaders by name, and quietly gaming out what happens if Kharg Island — the cash register of Iran’s economy — goes dark. So here’s the real question: if nearly every government involved insists this is about “stability” and “security,” what does actual instability even look like — and would any of them admit it if they saw it? #war#Iran#Israel#Trump#KhargIsland#oil#energy#StraitOfHormuz#USA#EU#MiddleEast#geopolitics#oligarchy#fakeDemocracy#nuclearcrisis 📱American Оbserver - Stay up to date on all important events 🇺🇸