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

Търсене: #timedilation

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

@cosmomyst · Post #622 · 14.01.2026 г., 22:21

🪐 In the heart of our galaxy, the supermassive black hole Sagittarius A* creates such intense gravity that time itself slows down near its edge—a real effect called gravitational time dilation. If you could hover safely just outside the black hole’s event horizon, minutes near this immense object would pass as hours or days for someone far away in space, making Sagittarius A* a true cosmic time-bender. ✨ #timedilation⚡#blackholes⚡#milkyway⚡#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 #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 #268 · 14.09.2025 г., 00:11

🪐 On Jupiter, time actually ticks a little faster than on Earth! Because Jupiter is much less dense and has weaker gravity at its cloud tops, its gravitational pull slows time down less than Earth's gravity does—a real effect called gravitational time dilation, where clocks in stronger gravity run slower compared to those farther away from massive objects. ✨ #timedilation⚡#jupiter⚡#gravity⚡#nasa⚡#galaxy⚡#stars⚡#astronomy⚡#universe⚡#cosmos⚡#space 👉subscribe Universe Mysteries ​

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 ​

Universe Mysteries 🪐

@cosmomyst · Post #552 · 11.12.2025 г., 22:21

🪐 The twin pulsars PSR J0737−3039A and B, located about 2,400 light-years away in the constellation Puppis, are a real-world testing ground for time dilation in space. As these two ultra-dense neutron stars orbit each other at high speeds and within extremely strong gravitational fields, their clocks run at noticeably different rates than those on Earth—showcasing how both high speed and intense gravity stretch and slow down time, just as predicted by Einstein’s theory of relativity. ✨ #timedilation⚡#pulsars⚡#puppis⚡#nasa⚡#galaxy⚡#stars⚡#astronomy⚡#universe⚡#cosmos⚡#space 👉subscribe Universe Mysteries 👉more Channels ​

Universe Mysteries 🪐

@cosmomyst · Post #756 · 30.04.2026 г., 22:21

🪐 Inside the galaxy NGC 4995, astronomers have used its rapidly spinning star clusters to explore time dilation—where time actually passes more slowly the faster you move. According to Einstein’s relativity, this means stars racing around the galaxy’s center age just a tiny bit less than similar stars sitting still, a real effect measured with ultra-precise clocks and confirmed by observations of high-speed cosmic objects. ✨ #timedilation⚡#relativity⚡#NGC4995⚡#nasa⚡#galaxy⚡#stars⚡#astronomy⚡#universe⚡#cosmos⚡#space 👉subscribe Universe Mysteries 👉more Channels ​

Universe Mysteries 🪐

@cosmomyst · Post #535 · 03.12.2025 г., 12:21

🪐 In 1971, the astronauts of Apollo 15 left a small aluminum device called a retroreflector on the surface of the Moon, which allows scientists to precisely measure distance by bouncing laser beams from Earth. Over decades, these experiments have shown that time passes ever so slightly faster for the reflector on the Moon than for clocks on Earth, due to weaker lunar gravity—a subtle, real-world example of gravitational time dilation across the solar system. ✨ #timedilation⚡#moon⚡#apollo⚡#nasa⚡#galaxy⚡#stars⚡#astronomy⚡#universe⚡#cosmos⚡#space 👉subscribe Universe Mysteries 👉more Channels ​

Universe Mysteries 🪐

@cosmomyst · Post #337 · 27.09.2025 г., 15:21

🪐 When astronauts journeyed to the Moon aboard Apollo missions, their clocks actually ticked a tiny bit faster than those left on Earth, thanks to time dilation caused by weaker gravity. This real effect, predicted by Einstein’s theory of general relativity, means that even on the lunar surface—where gravity is only about one-sixth of Earth's—time stretches ever so slightly, making lunar explorers age just a bit more quickly during their stay than their counterparts on the ground. ✨ #timedilation⚡#apollo⚡#moon⚡#nasa⚡#galaxy⚡#stars⚡#astronomy⚡#universe⚡#cosmos⚡#space 👉subscribe Universe Mysteries 👉more Channels ​

Universe Mysteries 🪐

@cosmomyst · Post #372 · 04.10.2025 г., 15:21

🪐 Time dilation in space means that time can pass at different rates depending on speed or gravity. On the fast-moving Juno spacecraft orbiting Jupiter, the combination of high speed and weaker gravity actually causes time to move a tiny bit faster for the probe than for people on Earth—a real-life effect of Einstein’s theories now measured using atomic clocks on robotic explorers across the solar system. ✨ #timedilation⚡#relativity⚡#junomission⚡#nasa⚡#galaxy⚡#stars⚡#astronomy⚡#universe⚡#cosmos⚡#space 👉subscribe Universe Mysteries 👉more Channels ​

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