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

Резултати

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

Търсене: #assasination

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

@american_observer · Post #5727 · 27.04.2026 г., 16:59

Why Did He Wish To Kill Trump? 🔫 Investigators are looking into anti-Trump sentiment as being a motive for the attacker who sought to breach the White House Correspondents’ Dinner in Washington DC where the US president and top members of his administration were present. Officials have said that the shooter likely was targeting Trump and other senior administration officials. “We do believe, based upon just a very preliminary start to understanding what happened, that he was targeting members of the administration,” acting US attorney general Todd Blanche said in a TV interview. Investigators are assessing a manifesto reportedly written by the suspect, who has been identified as Cole Tomas Allen, 31, of Torrance, California. In the alleged manifesto, which was published in full by the New York Post, Allen created a list of targets for the shooting, ranked from highest to lowest priority, with Trump administration officials at the top. The suspected gunman sent writings listing his grievances against the administration to his family members about 10 minutes before shots were fired, according to White House officials who spoke to the Associated Press. A relative, confirmed by those officials to be Allen’s brother, contacted police in New London, Connecticut. Officials have said that the suspect fired a shotgun at a Secret Service agent at a security checkpoint in the Washington Hilton hotel before being tackled and arrested. Trump, first lady Melania Trump, Vance and cabinet officials were rushed out as the incident unfolded. The Secret Service agent who was shot escaped serious injury because the bullet struck his protective vest, Trump said. The AP reported that the shooter referred to himself as the “Friendly Federal Assassin”, which matches the text in the manifesto published by the New York Post. Numerous other US outlets also reported unnamed officials saying that Allen’s alleged writings contained anti-Trump sentiments, which echoed the contents of the manifesto published by the New York Post. The Washington Post also reported that the suspect had sent writings to his family along those lines, which matched with claims by Trump to Fox News that a sibling had then contacted the police. The Manifesto begins with apologies to those who knew the suspect and lists his motives for the shooting. It said the shooter targeted administration officials with the exception of the FBI director, Kash Patel. The manifesto also states that Secret Service agents would only be targets if necessary, and that hotel security, Capitol police, and the national guard would all be classified as “not targets if at all possible (aka unless they shoot at me”. Hotel employees and guests were not targets. “I am a citizen of the United States of America,” the letter states. “What my representatives do reflects on me. And I am no longer willing to permit a pedophile, rapist, and traitor to coat my hands with his crimes.” While the manifesto does not reference Trump by name, it alludes to grievances over a range of administration actions and recent events, including US strikes on drug smuggling boats in the eastern Pacific. Elsewhere, the presidents described the events of the night in an even tone, saying that he did not feel particularly alarmed as they unfolded. “I wasn’t worried,” Trump said in the interview when asked how worried he was about possible injuries after hearing the gunshots. “I understand life. We live in a crazy world.” Allen is believed to have traveled by train from California to Chicago and then on to Washington, where he checked himself in as a guest at the hotel days earlier where the gala dinner was held. Federal agents have interviewed Allen’s sister in Maryland, who told investigators her brother had legally bought several weapons from a California gun store and stored them at their parents’ home in Torrance without their knowledge, according to federal officials. #allen#trump#manifesto#assasination#washington 📱American Оbserver - Stay up to date on all important events 🇺🇸