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

Резултати

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

Търсене: #ppod

当前筛选 #ppod清除筛选
EverythingScience

@EverythingScience · Post #4991 · 11.12.2025 г., 21:06

#PPOD: Titan's Surface 🌕 The atmosphere of Titan, one of Saturn’s moons, appears similar to that on Earth about 3.5 billion years ago, before life appeared. After a seven-year journey on board the Cassini spacecraft, ESA’s Huygens probe reached Titan’s surface, marking the most distant landing ever achieved by a spacecraft. During the descent, its cameras collected data on the dense atmosphere and took the first-ever images of the surface. These revealed an extraordinary world with lakes, islands, and erosion features similar to those that shape our planet, confirming that liquid methane once flowed there. Methane on Titan is found in liquid form, not as a gas, due to the intense pressure and cold temperatures, about –180° C. Credit: esaNASA Source: @SETIInstitute @EverythingScience

Hashtags

EverythingScience

@EverythingScience · Post #4944 · 02.12.2025 г., 22:00

#PPOD: Deimos Before Sunrise 🌄 NASAPersevere captured this view of Deimos, the smaller of Mars' two moons, shining in the sky at 4:27 a.m. local time on March 1, 2025, the 1,433rd Martian day, or sol, of the mission. In the dark before dawn, the rover's left navigation camera used its maximum long-exposure time of 3.28 seconds to capture 16 individual shots, which were combined into a single image that was later sent to Earth. In total, the image represents an exposure time of about 52 seconds. The low light and long exposures add digital noise, making the image hazy. Many of the white specks seen in the sky are likely noise; some may be cosmic rays. Two of the brightest white specks are Regulus and Algieba, stars that are part of the constellation Leo. "Woodstock Crater," at center right, is roughly a half-mile (750 meters) away from the rover. At the time, Perseverance was en route to "Witch Hazel Hill." Credit: NASANASAJPLCaltech Source: @SETIInstitute @EverythingScience

Hashtags

EverythingScience

@EverythingScience · Post #4877 · 23.11.2025 г., 06:55

#PPOD: The Eye of the Crater 👁️ A vast cavity on the Red Planet looks back at ESA TGO with an icy stare. The crater is located in Utopia Planitia, the largest known impact basin in the Solar System, with a diameter of roughly 3,300 km, or twice the size of Earth’s Sahara Desert from north to south. This remnant of an ancient impact is just one of the many scars asteroids have inflicted upon the Red Planet. Water, volcanoes, and impacts from asteroids shaped the Martian surface in the ancient past. Mars is currently a cold, dry desert. This view from CaSSIS shows a crater approximately eight kilometres in diameter with material ejected in a manner that scientists believe suggests the presence of water ice. When the asteroid hit this region of Mars, the water ice melted, and a mix of liquid water and dust rock was propelled from the top layers. The smooth appearance of the crater is consistent with other features in the region, which have evidence of a water-ice history. Zooming into the crater, it is possible to see streaks on the walls of the crater, showing evidence of landslides, and ripples sculpted by the wind. Credit: ESA/ TGO/CaSSIS Source: @SETIInstitute @EverythingScience

Hashtags

EverythingScience

@EverythingScience · Post #4724 · 30.10.2025 г., 00:40

#PPOD: Mar­tian Win­ter Won­der­land ❄️ This sweeping view along a rusty red ridge and into a crater showcases the exquisite beauty of icy, layered terrain in the south polar region on Mars. The High Resolution Stereo Imaging camera onboard ESA’s Mars Express captured this frosty scene in the Ultimi Scopuli region near the south pole of Mars on 19 May 2022. At this time, it was southern hemisphere spring, and ice was starting to retreat. Dark dunes began to peak through the frost, and the elevated terrain appears ice-free. Credit: esaDLR enFU Berlin Source: @SETIInstitute @EverythingScience

Hashtags

EverythingScience

@EverythingScience · Post #5111 · 16.01.2026 г., 03:10

#PPOD: Neptune 🔵 NASAVoyager 2 made its closest approach to #Neptune in 1989, flying by 4,950 km above its cloud tops. It is still the only spacecraft to have visited the planet! The mission revealed 6 new moons, rings, and geysers erupting from the moon Triton. This Voyager 2 image of Neptune, processed by Kevin Gill, was captured on Aug. 31, 1989. Credit: NASANASAJPLCaltech / Kevin M. Gill Source: @SETIInstitute @EverythingScience

EverythingScience

@EverythingScience · Post #5078 · 06.01.2026 г., 19:10

#PPOD: Curiosity Sends Holiday Postcard from #Mars🌄 Team members working with NASA’s MarsCuriosity created this “postcard” by commanding the rover to take images at two times of day on Nov. 18, 2025, spanning the 4,722nd and 4,723rd Martian days, or sols, of the mission. The panoramas were captured at 4:15 p.m. on Sol 4,722 and 8:20 a.m. on Sol 4,723 (both at local Mars time), then merged together. Color was later added for an artistic interpretation of the scene, with blue representing the morning panorama and yellow representing the afternoon one. The resulting “postcard” is similar to ones the rover took in June 2023 and November 2021. Adding color to these kinds of merged images helps different details stand out in the landscape. Credit: NASANASAJPLCaltech Source: @SETIInstitute @EverythingScience

Hashtags