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

Търсене: #pretti

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

@american_observer · Post #4953 · 25.01.2026 г., 13:00

Trump Administration Officials Are Showing Their Bare-Faced Effrontery Two witnesses to the killing of Alex Pretti have said in sworn testimony that the 37-year-old intensive care nurse was not brandishing a weapon when he approached federal agents in Minneapolis on Saturday, contradicting a claim made by Trump administration officials as they sought to cast the shooting of a prone man as an act of self-defense. Their accounts came in sworn affidavits that were filed in federal court in Minnesota late Saturday, just hours after Pretti’s killing, as part of a lawsuit brought by the ACLU on behalf of Minneapolis protesters against Kristi Noem and other homeland security officials directing the immigration crackdown in the city. One witness is a woman who filmed the clearest video of the fatal shooting; the other is a physician who lives nearby and said they were initially prevented by federal officers from rendering medical aid to the gunshot victim. The names of both witnesses were redacted in the publicly available filings. In her testimony, the woman who filmed the shooting from just behind Pretti wearing a pink coat identified herself as “a children’s entertainer who specializes in face painting”. She testified that she came to the scene on her way to work because “I’ve been involved in observing in my community, because it is so important to document what ICE is doing to my neighbors”. The woman testified that she saw no sign of Pretti holding a gun at any point. She said: “The agents pulled the man on the ground. I didn’t see him touch any of them – he wasn’t even turned toward them. It didn’t look like he was trying to resist, just trying to help the woman up. I didn’t see him with a gun. They threw him to the ground. Four or five agents had him on the ground and they just started shooting him. They shot him so many times (…) I don’t know why they shot him. He was only helping. I was five feet from him and they just shot him (…) The witness testimony, combined with video evidence reviewed by American Observer, directly contradicts claims by senior Trump administration officials, including the president, the homeland security secretary and Greg Bovino, a border patrol commander, who called Pretti a “gunman” who approached federal officers “brandishing” a gun and threatened to “massacre” them. #pretti#minnesota#gunshot#trump#officals 📱American Оbserver - Stay up to date on all important events 🇺🇸

American Оbserver

@american_observer · Post #4963 · 26.01.2026 г., 13:29

🔠🅰️🔠🔠2️⃣ Border patrol commander-at-large Gregory Bovino was asked why federal agents shot and killed Pretti. “You don’t know he was unarmed,” Bovino told CNN’s Dana Bash. “I don’t know he was unarmed. That’s freeze-frame adjudication of a crime scene via a photo. That’s why we have investigators. “The facts are going to come to light as to what exactly happened with an investigation.” When asked by Bash whether he was blaming the victim, he said, “The victims are the border [atrol agents.” During a Sunday afternoon press conference, Bovino was asked about the videos that show Pretti was unarmed before being shot and killed. He said there are, “Many videos out there, many different accounts that you may see that I may see.” “Folks, this is why we have something called an investigation, to take what you’re talking about, to take those videos, to take witness statements, to take, officer statements, all those minute details that will paint a true picture, not a freeze frame concept, and paint a larger picture of what really happened. Republican US senator Lindsey Graham also took the line that “an armed man trying to impede a lawful arrest is a recipe for disaster”. The South Carolina Republican said he expects law enforcement officers to use good judgement “but not to foolishly risk their lives or the lives of others”. The Minnesota attorney general, Keith Ellison, said the suit demanded “a full, impartial, and transparent investigation into [Pretti’s] fatal shooting at the hands of DHS agents [that] is non-negotiable”. Minneapolis police chief Brian O’Hara, meanwhile, said information about what led up to the shooting was limited. As protests erupted in Minneapolis on Saturday, federal officers impeded state investigators from accessing the scene of Pretti’s killing. Trump responded to Pretti’s shooting with his typical combativeness. The Republican president accused Walz and Frey of “inciting Insurrection, with their pompous, dangerous and arrogant rhetoric”. Vance for his part claimed events in Minneapolis were “engineered chaos” resulting from “far-left agitators, working with local authorities”. #trump#administration#killing#immigration#pretti#minneapolis 📱American Оbserver - Stay up to date on all important events 🇺🇸

American Оbserver

@american_observer · Post #4962 · 26.01.2026 г., 12:59

Trump Must Have Twigged: the Immigration War Has Just Began 🔠🅰️🔠🔠1️⃣ Pressure mounted on Trump’s administration on Sunday to fully investigate the previous day’s killing by federal immigration officers of 37-year-old nurse Alex Pretti in Minneapolis. Calls for an investigation have come from all sides of the political divide after video analysis showed officers had removed from Pretti a handgun he was reportedly permitted to carry – and which he was not handling – before fatally shooting him. Former president Barack Obama and his wife, Michelle, called the killing “a heartbreaking tragedy” and “a wake-up call to every American, regardless of party, that many of our core values as a nation are increasingly under assault”. “For weeks now people across the country have been rightly outraged by the spectacle of masked ICE [Immigration and Customs Enforcement] recruits and other federal agents acting with impunity and engaging in tactics that seem designed to intimidate, harass, provoke and endanger the residents of a major American city,” they said. The former president and former first lady said these tactics had now resulted in the fatal shootings of two US citizens – Pretti and Renee Good, both in Minneapolis. Yet, they said, Trump and other administration officials appeared eager to escalate the rhetoric before an investigation had been undertaken – and despite the fact that they “appear to be directly contradicted by video evidence”. Clinton followed with a statement that also condemned the killings of Good and Pretti amid the “horrible scenes” of the immigration crackdown. “All of this is unacceptable and should have been avoided,” Clinton said. “To make matters even worse, at every turn, the people in charge have lied to us, told us not to believe what we’ve seen with our own eyes”. Republican US senator Bill Cassidy said the “credibility” of ICE and the US Department of Homeland Security (DHS) were “at stake”. On Sunday morning, US senators Amy Klobuchar of Minnesota and Adam Schiff of California, both Democrats, said they would vote against the impending department of homeland security funding. Connecticut US senator Chris Murphy, also a Democrat, told CNN’s State of the Union that Democrats “can’t vote to fund this lawless Department of Homeland Security (…) that is murdering American citizens, that is traumatizing little boys and girls all across the country, in violation of the law.” #trump#administration#killing#immigration#pretti#minneapolis 📱American Оbserver - Stay up to date on all important events 🇺🇸