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

Резултати

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

Търсене: #relativity

当前筛选 #relativity清除筛选
Interesting Planet 🌍

@interesting_planet_facts · Post #1297 · 17.02.2026 г., 12:11

🌎 Unexpected time anomalies have been observed near strong gravitational fields, like black holes, due to "gravitational time dilation." This effect was confirmed by astronauts using precise atomic clocks, which run slower closer to massive objects compared to those farther away. In 2010, scientists measured time literally ticking faster by 33 microseconds per kilometer higher in altitude on Earth. ✨ #time⚡#physics⚡#relativity 👉subscribe Interesting Planet 👉more Channels ​

Interesting Planet 🌍

@interesting_planet_facts · Post #1168 · 27.12.2025 г., 12:11

🌎 Time perception can change when moving at high speeds or near strong gravity, as predicted by Einstein's theory of relativity. Atomic clock experiments prove that time really passes more slowly for fast-moving objects or those closer to massive bodies like Earth—astronauts on the International Space Station age about 0.01 seconds less per six months compared to people on the ground. ✨ #time⚡#relativity⚡#physics 👉subscribe Interesting Planet 👉more Channels ​

Interesting Planet 🌍

@interesting_planet_facts · Post #705 · 07.09.2025 г., 16:22

🌎 Einstein's theory of relativity reveals that time can actually move slower or faster depending on gravity and speed. For example, atomic clocks on fast-moving satellites tick slightly slower than those on Earth’s surface—a phenomenon confirmed by GPS systems needing corrections due to these time differences. ✨ #time⚡#relativity⚡#physics 👉subscribe Interesting Planet ​

Universe Mysteries 🪐

@cosmomyst · Post #727 · 30.03.2026 г., 22:21

🪐 In the center of the galaxy ESO 325-G004, astronomers have observed a dramatic example of space-time distortion called gravitational lensing, where the gravity from this massive galaxy bends and magnifies the light of more distant galaxies behind it. This real effect makes background galaxies appear as stretched arcs or multiple images, showing how the fabric of space can be warped by the presence of enormous masses, just as predicted by Einstein’s theory of general relativity. ✨ #wormholes⚡#relativity⚡#galaxies⚡#nasa⚡#galaxy⚡#stars⚡#astronomy⚡#universe⚡#cosmos⚡#space 👉subscribe Universe Mysteries 👉more Channels ​

Universe Mysteries 🪐

@cosmomyst · Post #464 · 29.10.2025 г., 12:21

🪐 Just outside the event horizon of the supermassive black hole in galaxy NGC 1365, time slows significantly due to the black hole’s intense gravitational pull—a phenomenon called gravitational time dilation. For an observer far from NGC 1365, minutes near the black hole’s edge could translate into hours or even days in regular space, showing how extreme environments can dramatically stretch the flow of time itself. ✨ #blackholes⚡#spacetime⚡#relativity⚡#nasa⚡#galaxy⚡#stars⚡#astronomy⚡#universe⚡#cosmos⚡#space 👉subscribe Universe Mysteries 👉more Channels ​

Universe Mysteries 🪐

@cosmomyst · Post #245 · 09.09.2025 г., 03:11

🪐 In the galaxy M87, where astronomers captured the first-ever image of a black hole, time dilation is so intense near its event horizon (the boundary around a black hole from which nothing—even light—can escape) that an outside observer would see time appear to nearly stop for anything close to the edge. This real effect, predicted by Einstein’s theory of general relativity, means a clock near the event horizon would tick dramatically slower compared to one far away from the black hole. ✨ #timedilation⚡#blackholes⚡#relativity⚡#nasa⚡#galaxy⚡#stars⚡#astronomy⚡#universe⚡#cosmos⚡#space 👉subscribe Universe Mysteries ​

Universe Mysteries 🪐

@cosmomyst · Post #205 · 01.09.2025 г., 13:11

🪐 Time flows differently near massive cosmic objects like black holes—an effect known as time dilation. For example, close to the supermassive black hole Sagittarius A* at the center of our galaxy, clocks would tick slower than on Earth due to its intense gravity; astronauts orbiting just outside its event horizon would age less quickly than those far away, making time itself stretch in extreme environments. ✨ #timedilation⚡#relativity⚡#blackholes⚡#nasa⚡#galaxy⚡#stars⚡#astronomy⚡#universe⚡#cosmos⚡#space 👉subscribe Universe Mysteries ​

Universe Mysteries 🪐

@cosmomyst · Post #567 · 19.12.2025 г., 12:21

🪐 Deep space travelers will experience time differently than people on Earth—a mysterious effect called time dilation. If astronauts took a fast journey to the star Sirius (8.6 light-years away) on a spaceship moving near the speed of light, their onboard clocks would run much slower than those back home, so they would age less during the trip—even while years passed on Earth. This real phenomenon comes straight from Einstein’s theory of relativity and shows how speed itself can turn space voyages into journeys through time. ✨ #timedilation⚡#relativity⚡#spaceships⚡#nasa⚡#galaxy⚡#stars⚡#astronomy⚡#universe⚡#cosmos⚡#space 👉subscribe Universe Mysteries 👉more Channels ​

Universe Mysteries 🪐

@cosmomyst · Post #711 · 14.03.2026 г., 22:21

🪐 Einstein’s theory of relativity predicts dramatic space-time distortions in the violent heart of the galaxy M87, where its supermassive black hole bends not just light, but alters the very flow of time itself. As matter spirals inward, space-time warps so much that signals escaping from near the event horizon—the point of no return—are stretched and delayed, making M87’s core a real example of nature’s most extreme distortions. ✨ #wormholes⚡#spacetime⚡#relativity⚡#nasa⚡#galaxy⚡#stars⚡#astronomy⚡#universe⚡#cosmos⚡#space 👉subscribe Universe Mysteries 👉more Channels ​

Universe Mysteries 🪐

@cosmomyst · Post #607 · 07.01.2026 г., 12:21

🪐 Space-time, the "fabric" that weaves together space and time, is not always smooth—giant objects like the supermassive black hole at the center of our galaxy, Sagittarius A*, warp and stretch it so much that both light and time bend around them. These real cosmic distortions, predicted by Einstein’s theory of general relativity, are seen as stars orbit that black hole on paths twisted by its immense gravity, giving us direct evidence that space itself can be bent and curved by massive objects in the universe. ✨ #wormholes⚡#spacetime⚡#relativity⚡#nasa⚡#galaxy⚡#stars⚡#astronomy⚡#universe⚡#cosmos⚡#space 👉subscribe Universe Mysteries 👉more Channels ​

Universe Mysteries 🪐

@cosmomyst · Post #676 · 12.02.2026 г., 22:21

🪐 In 1977, the Voyager 1 spacecraft passed near Jupiter, and its onboard clocks experienced a tiny but measurable time dilation due to the planet's gravity. This real effect, predicted by Einstein's theory of general relativity, means time ticked just a little slower for Voyager as it flew close to massive Jupiter than it did for clocks far from the giant planet—showing that even in our own solar system, gravity can subtly warp the flow of time. ✨ #timedilation⚡#Jupiter⚡#relativity⚡#nasa⚡#galaxy⚡#stars⚡#astronomy⚡#universe⚡#cosmos⚡#space 👉subscribe Universe Mysteries 👉more Channels ​

Universe Mysteries 🪐

@cosmomyst · Post #489 · 10.11.2025 г., 12:21

🪐 On Mercury, time passes at a different rate than on Earth because the planet orbits much closer to the Sun and feels stronger gravity—a real effect called time dilation. According to Einstein's theory of relativity, stronger gravity slows down the flow of time, so a clock sitting on Mercury's surface would actually run slightly slower than an identical clock on Earth, making time itself stretch differently across the solar system. ✨ #timedilation⚡#relativity⚡#mercury⚡#nasa⚡#galaxy⚡#stars⚡#astronomy⚡#universe⚡#cosmos⚡#space 👉subscribe Universe Mysteries 👉more Channels ​

12
ПредишнаСтр. 1 от 2Следваща