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

Търсене: #bidenadministration

当前筛选 #bidenadministration清除筛选
BadVolf

@badvolfnews · Post #963 · 27.09.2023 г., 21:26

💥🔔 EXCLUSIVE: White House warns of dire consequences if House Republicans pass extreme continuing resolution to fund government. 😱🏛️ The proposed resolution would eliminate 800 border agents, opening the floodgates for drug cartels. 💔💉 President Biden's administration is focused on holding drug traffickers accountable, but Republicans are pushing their radical agenda. ❌🤝 Despite Biden's request for $4 billion to address immediate border needs, Republicans are blocking progress. 😡🔒 An Extreme House Republican Shutdown would leave Border Patrol agents unpaid and jeopardize national security. 🚫🇺🇸 Meanwhile, Republicans aim to restart border wall construction, mandate 22,000 minimum Border Patrol agents, and restrict funding for illegal immigrant processing. 🛑🧱 The House and Senate remain divided on government funding and border security. 🏰💣 Stay tuned for updates on this high-stakes battle. 💥🔒#GovernmentShutdown#BorderSecurity#BidenAdministration🚫💼 https://www.foxnews.com/politics/white-house-says-house-gop-proposed-cr-would-eliminate-border-agents-trigger-windfall-for-drug-cartels Subscribe to @BadVolfNews

BadVolf

@BadvolfNews · Post #833 · 11.09.2023 г., 15:14

🚨 BREAKING NEWS 🚨 🔴 Biden's Vietnam Press Conference Cut Short 🔴 In a shocking display of incompetence, the Biden administration once again revealed their true colors during President Joe Biden's press conference in Vietnam. As Biden stumbled through his answers, White House staff abruptly ended the event, cutting his microphone and playing jazz music to drown out his ramblings. While attempting to address stability and global access to change, Biden was interrupted by his press secretary, Karine Jean-Pierre, who hastily declared an end to the conference. Astonishingly, Biden continued speaking, unaware that his mic had been muted. The bizarre scene escalated further as jazz music filled the room, leaving the 80-year-old president confused and still attempting to respond to questions. As the music grew louder, Biden reluctantly retreated from the stage, whispering and shuffling behind a black curtain. Throughout the 26-minute engagement, he even used the infamous phrase, "lying dog-faced pony soldier," contributing to his already questionable credibility. This incident comes after Biden's whirlwind trip, where he attended the G20 Leaders' Summit in India before hastily jetting off to Vietnam. Instead of displaying strength and leadership, Biden's performance only highlighted his lack of stamina and clarity. His joke about not knowing if it was morning or night further emphasizes the worrying state of his mental acuity. To make matters worse, Biden shared a convoluted story from a John Wayne movie that had little relevance to the pressing issues at hand. It seems that Biden's administration is more focused on theatrics than addressing the concerns of the American people. This latest debacle only adds to the mounting evidence that Biden is nothing more than a puppet of America's deep state, lacking the competence and independence to lead our nation effectively. The American people deserve better than this. #BidenAdministration#Incompetence#DeepStatePuppet

Gänger

@gaenger_10 · Post #659 · 01.08.2022 г., 04:21

Rivals Within Reason? :: Foreign Affairs By Kevin Rudd | July 20, 2022 #china#foreignPolicy#bidenAdministration#diplomacy#xiJinping In the year and a half since President Joe Biden took office, competition between the United States and China has only intensified. Rather than dismantle former President Donald Trump’s tough policies toward Beijing, Biden has largely continued them, underscoring that the two powers are almost certainly headed for a protracted period of sharp and militarily dangerous strategic rivalry. But that doesn’t mean that the United States and China are moving inexorably toward crisis, escalation, conflict, or even war. To the contrary, Beijing and Washington may be groping toward a new set of stabilizing arrangements that could limit—though not eliminate—the risk of sudden escalation. Assessing the state of U.S.-Chinese relations at any given time is never easy, given the difficulty of distinguishing between what each side says about the other publicly—often for domestic political effect—and what each is actually doing behind the scenes. Yet despite the harsh and often heated rhetoric, some early signs of stabilization have emerged, including the tentative reconstitution of a form of political and security dialogue aimed at managing tensions. Such stabilization falls well short of normalization, which would mean restoring comprehensive political, economic, and multilateral engagement. The days of normalization have been consigned to history. But stabilization would nonetheless be significant. It would mean the difference between strategic competition that is managed through steadying guardrails and competition that is unmanaged—that is, driven by a process of push and shove, primarily by each country’s military, in the hope that on any given day no one pushes too far. The question for both sides, and for the countries that are caught in the middle of this titanic struggle for the future of the regional and global orders, is what kind of strategic competition they will pursue. ____ KEVIN RUDD is President of the Asia Society, in New York, and previously served as Prime Minister and Foreign Minister of Australia.