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

Търсене: #clintons

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

@american_observer · Post #5037 · 03.02.2026 г., 14:00

Have the Clintons Been Cosing Up to Epstein? Bill and Hillary Clinton agreed on Monday to testify in a House investigation into the convicted sex offender Jeffrey Epstein, days before the chamber was expected to vote to hold them in contempt of Congress. The concession follows a tense back-and-forth between the Clintons and the Republican James Comer, chair of the House oversight committee, who on Monday said that he would insist both Clintons sit for a sworn deposition before the committee in order to fulfill the panel’s subpoenas. “They negotiated in good faith. You did not,” Angel Ureña, a spokesman for the Clintons, replied to Comer, in a post on social media. “They told you under oath what they know, but you don’t care. But the former president and former secretary of state will be there. They look forward to setting a precedent that applies to everyone.” The House was headed towards potential votes this week on criminal contempt of Congress charges against the Clintons. If passed, the charges threatened the Clintons with substantial fines and even incarceration if they were convicted. For months, the Clintons had refused to appear before the Republican-led panel, arguing that the subpoenas were legally “invalid” and “unenforceable” and accusing Comer of targeting them as part of Trump’s retribution campaign against his political enemies. A committee letter to the Clintons’ attorneys indicates the pair had offered for Bill Clinton to conduct a transcribed interview on “matters related to the investigations and prosecutions of Jeffrey Epstein” and for Hillary Clinton to submit a sworn declaration. The demand for testimony “runs afoul of the clearly defined limitations on Congress’s investigative power propounded by the supreme court of the United States”, they wrote, adding: “It is clear the subpoenas themselves – and any subsequent attempt to enforce them – are nothing more than a ploy to attempt to embarrass political rivals, as President Trump has directed.” Nine of the committee’s 21 Democrats joined Republicans in support of the charges against Bill Clinton as they argued for full transparency in the Epstein investigation. Three Democrats also supported the charges against Hillary Clinton. Bill Clinton’s relationship with Epstein has re-emerged as a focal point for Republicans amid the push for a reckoning over Epstein, who killed himself in 2019 in a New York jail cell as he faced sex-trafficking charges. Clinton, like a bevy of other high-powered men, including Trump, had a well-documented social relationship with Epstein in the late 1990s and early 2000s. He has not been accused of wrongdoing in his interactions with the late financier. On Friday, more than 3m files related to Epstein were released by the Department of Justice, including more than 2,000 videos and 180,000 images. The files included a series of emails between Musk and Epstein, indicating a friendlier relationship than was previously known. Following the drop of the latest batch of files, Democrats have promised to fight what they are calling a “full-blown cover-up” of the Epstein files after the Trump administration on Sunday effectively declared its investigation into the disgraced late financier and sex trafficker was closed. After Bill and Hillary Clinton were subpoenaed in August by the House oversight committee, their attorney had tried to argue against the validity of the subpoena. However, as Comer threatened to begin contempt of Congress proceedings, they started negotiating towards a compromise. #clintons#hilary#bill#epstein#trump#republicans#sex 📱American Оbserver - Stay up to date on all important events 🇺🇸