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

Търсене: #pollack

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

@american_observer · Post #4784 · 06.01.2026 г., 14:58

🔠🅰️🔠🔠2️⃣ In return Assange, who spent five years in the maximum security Belmarsh prison in London and seven years as a fugitive hiding from British and American law enforcement in the UK Ecuadorian embassy, was ultimately sentenced to time served after years in which the US was attempting to have him extradited. In an interview with Law Dragon last April, Pollack described the difficulty of negotiating the deal with the US, UK and Australian governments before securing Assange’s freedom. Pollack also offered some thoughts relevant to what Maduro may currently be experiencing. “Typically, when I meet with a client, they are facing what may be the worst crisis that they have ever faced,” Pollack said. “To guide them through that process is enormously gratifying. It’s hard to imagine doing something where you see a greater impact on the life of the person who you’re dealing with. “You spend a lot of hours with your client. In almost every case, I’ve developed a relationship with the client. And at the end of the day, it’s no longer a stranger who I’m seeing get through to the other side of this terrible piece of their life. It’s somebody that I’ve come to know and respect.” Along with his work representing Assange, Pollack has previously secured the acquittal of former Enron accountant Michael Krautz, and has also worked in overturning wrongful conviction cases, including helping to secure the freedom of Martin Tankleff, who spent 17 years in prison after being wrongfully accused of murdering his parents. In the interview with Law Dragon, Pollack reflected on his strengths, offering a glimpse into how he may defend Maduro. “I have the ability to communicate well with a jury. In some ways, you’re being a translator. You’re taking a mass of very technical information from an industry that the jury may not be familiar with and communicate it in a way that is understandable,” Pollack said. “I’m able to talk to a jury and explain the evidence in a way that makes sense to them – that shows them that the government’s way of looking at the facts is not the only way to look at the facts and may not even be the best way to look at the facts.” #maduro#trial#assange#pollack#newyork 📱American Оbserver - Stay up to date on all important events 🇺🇸

American Оbserver

@american_observer · Post #4782 · 06.01.2026 г., 13:58

Maduro à New York: Mortal Combat 🔠🅰️🔠🔠1️⃣ When Maduro appeared in court in New York on Monday, his choice of lawyer quickly raised eyebrows. The captured Venezuelan president was accompanied by Barry Pollack, a top-tier US trial lawyer who spent years representing Julian Assange, eventually securing the WikiLeaks founder’s release from prison in the UK in 2024. Pollack is a partner at Harris St Laurent & Wechsler, a law firm based on New York’s Wall Street in the financial district of lower Manhattan, just a few minutes walk from the federal court where Maduro pleaded not guilty to criminal charges on Monday. Pollack will take on a case as Maduro’s private counsel that could prove to be just as challenging as that of Assange. Maduro was charged on Monday with drug-terrorism conspiracy, cocaine-importation conspiracy, and possession of machine guns and destructive devices, with the US government labelling Maduro a “narco-terrorist” and an “illegitimate president”. He faces up to life in prison. Harris St Laurent & Wechsler did not respond to requests for comment about Pollack’s involvement, but it is clear that in the legal world, he is highly regarded. According to Chambers USA, Pollack is a “thorough and deep-thinking lawyer” who “lives, breathes and sleeps trials, and has such a natural way in front of juries”. In his first appearance representing Maduro, Pollack questioned the legality of Maduro’s dramatic abduction by US forces on Saturday in a raid on the Venezuelan capital Caracas, CNN reported, and argued Maduro is entitled to immunity as the head of a sovereign state. Winning Maduro’s freedom will present a different challenge to Pollack compared to his work with Assange. The lawyer negotiated a plea deal on Assange’s behalf which allowed the Australian data-freedom activist to walk free, ending an international legal saga that lasted more than a decade. In the deal, Assange pleaded guilty to violating US espionage law in conspiring to obtain and disclose classified US national defence documents. #maduro#trial#assange#pollack#newyork 📱American Оbserver - Stay up to date on all important events 🇺🇸