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

Резултати

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

Търсене: #lensing

当前筛选 #lensing清除筛选
Universe Mysteries 🪐

@cosmomyst · Post #277 · 15.09.2025 г., 20:11

🪐 In the galaxy cluster MACS J1206.2-0847, astronomers have mapped dramatic distortions of space-time caused by the cluster's enormous mass. This real effect, called gravitational lensing, bends and magnifies the light from even more distant galaxies behind it, turning MACS J1206.2-0847 into a cosmic lens that reveals objects otherwise hidden from our view. ✨ #spacetime⚡#mysteries⚡#lensing⚡#nasa⚡#galaxy⚡#stars⚡#astronomy⚡#universe⚡#cosmos⚡#space 👉subscribe Universe Mysteries ​

Universe Mysteries 🪐

@cosmomyst · Post #220 · 04.09.2025 г., 13:11

🪐 The James Webb Space Telescope has revealed the most detailed images yet of the galaxy cluster SMACS 0723, showing thousands of galaxies and ancient starlight that traveled over 4.6 billion years to reach us. Webb’s infrared vision lets us peer through dust and see cosmic structures, such as warped arcs of light caused by gravitational lensing—where the cluster’s mass bends and magnifies even more distant galaxies hiding behind it. ✨ #galaxies⚡#infrared⚡#lensing⚡#nasa⚡#galaxy⚡#stars⚡#astronomy⚡#universe⚡#cosmos⚡#space 👉subscribe Universe Mysteries ​

Universe Mysteries 🪐

@cosmomyst · Post #660 · 04.02.2026 г., 22:21

🪐 In 2023, astronomers used the gravity of the massive galaxy cluster SMACS J0723.3–7327 to create a powerful "gravitational lens," sharply magnifying and stretching light from galaxies over 13 billion light-years away. This natural lens effect, where space-time bends around clusters and distorts the background like a cosmic funhouse mirror, provides one of the clearest real-world examples of how gravity can twist the fabric of the universe and reveal objects otherwise hidden from view. ✨ #wormholes⚡#spacetime⚡#lensing⚡#nasa⚡#galaxy⚡#stars⚡#astronomy⚡#universe⚡#cosmos⚡#space 👉subscribe Universe Mysteries 👉more Channels ​

Universe Mysteries 🪐

@cosmomyst · Post #478 · 04.11.2025 г., 22:21

🪐 In 2015, astronomers used data from the Atacama Large Millimeter/submillimeter Array (ALMA) to observe the gravitationally warped light from a distant galaxy called SDP.81. The galaxy's light was stretched and bent into a near-perfect ring by the immense mass of a foreground galaxy, creating a striking "Einstein ring"—a vivid demonstration of how gravity can distort space-time and transform a distant galaxy into a cosmic lens. ✨ #wormholes⚡#spacetime⚡#lensing⚡#nasa⚡#galaxy⚡#stars⚡#astronomy⚡#universe⚡#cosmos⚡#space 👉subscribe Universe Mysteries 👉more Channels ​

Universe Mysteries 🪐

@cosmomyst · Post #293 · 18.09.2025 г., 20:11

🪐 In the galaxy cluster SDSS J1004+4112, astronomers have observed the light from a single supernova appear in multiple places at different times due to a powerful space-time distortion called gravitational lensing. This real effect means the cluster's massive gravity bends and splits the supernova's light into separate images, allowing telescopes to witness the same stellar explosion replayed across the sky—a cosmic demonstration of how gravity can twist the very fabric of space and time. ✨ #wormholes⚡#spacetime⚡#lensing⚡#nasa⚡#galaxy⚡#stars⚡#astronomy⚡#universe⚡#cosmos⚡#space 👉subscribe Universe Mysteries ​

Universe Mysteries 🪐

@cosmomyst · Post #57 · 01.08.2025 г., 16:11

🪐 The massive galaxy cluster Abell 370, situated about 4 billion light-years away in the constellation Cetus, acts as a colossal cosmic lens. Its immense gravity bends and magnifies the light from galaxies far beyond, creating spectacular arcs and distorted images that unveil some of the most distant and faint structures ever seen in the universe. ✨ #lensing⚡#galaxies⚡#cluster⚡#nasa⚡#galaxy⚡#stars⚡#astronomy⚡#universe⚡#cosmos⚡#space 👉subscribe Universe Mysteries

Universe Mysteries 🪐

@cosmomyst · Post #302 · 20.09.2025 г., 15:21

🪐 In the galaxy cluster El Gordo, astronomers have observed evidence that most of its mass is not from visible matter but from dark matter—a mysterious, invisible substance that outweighs all the galaxies and gas combined. Detailed gravitational lensing (where gravity bends and magnifies the light from more distant galaxies) reveals vast, hidden regions in El Gordo, confirming that dark matter acts as a cosmic glue, binding this colossal cluster together and shaping its structure on a grand scale. ✨ #darkmatter⚡#lensing⚡#galaxycluster⚡#nasa⚡#galaxy⚡#stars⚡#astronomy⚡#universe⚡#cosmos⚡#space 👉subscribe Universe Mysteries ​

Universe Mysteries 🪐

@cosmomyst · Post #214 · 03.09.2025 г., 03:11

🪐 In the galaxy cluster Abell 1689, astronomers have observed light from distant galaxies being bent and stretched in strange ways—a real effect called "gravitational lensing." This phenomenon is caused when a huge mass, like the dense collection of galaxies in Abell 1689, distorts space-time itself—warping the paths of light and creating the illusion of arcs, rings, or even multiple images of the same object in the sky. ✨ #spacetime⚡#lensing⚡#clusters⚡#nasa⚡#galaxy⚡#stars⚡#astronomy⚡#universe⚡#cosmos⚡#space 👉subscribe Universe Mysteries ​

Universe Mysteries 🪐

@cosmomyst · Post #631 · 21.01.2026 г., 22:21

🪐 In the galaxy cluster Abell 1689, scientists have mapped how dark matter bends light from even more distant galaxies in a phenomenon called gravitational lensing. This cosmic "magnifying glass" effect lets astronomers trace the otherwise invisible dark matter—an unknown substance that reveals itself only through gravity, helping piece together how vast amounts of hidden mass shape entire clusters across the universe. ✨ #darkmatter⚡#abell1689⚡#lensing⚡#nasa⚡#galaxy⚡#stars⚡#astronomy⚡#universe⚡#cosmos⚡#space 👉subscribe Universe Mysteries 👉more Channels ​

Universe Mysteries 🪐

@cosmomyst · Post #260 · 12.09.2025 г., 03:11

🪐 Near the galaxy cluster Abell 370, astronomers have discovered evidence that space-time itself can be “distorted” on a huge scale, bending and stretching the paths of light from galaxies lying far behind the cluster. This real phenomenon, called gravitational lensing, reveals how massive objects can warp the very fabric of the universe and lets scientists study galaxies otherwise hidden from view—showing the true power of space-time distortions in action. ✨ #spacetime⚡#gravitational⚡#lensing⚡#abell370⚡#nasa⚡#galaxy⚡#stars⚡#astronomy⚡#universe⚡#cosmos⚡#space 👉subscribe Universe Mysteries ​