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

Резултати

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

Търсене: #didyouknow

当前筛选 #didyouknow清除筛选
MyGov Newsdesk

@mygovcoronanewsdesk · Post #11421 · 21.11.2022 г., 05:59

#DidYouKnow❓ Relying on the healing power of nature, Naturopathy stimulates the human body's ability to heal itself! Test your knowledge about Naturopathy. Take the quick quiz today! Visit: https://quiz.mygov.in/quiz/naturopathy-quiz/

Hashtags

gov.sg

@Govsg · Post #3013 · 16.05.2025 г., 09:33

📢 The Weekly Wrap – 16 May 2025 1) #DidYouKnow Today is Drug Victims Remembrance Day? An annual observance to rally together on the harms and trauma of drug abuse. Visit the “Museum of Us” exhibition from 16 to 18 May at Suntec City, 10am to 8pm, to get an insider perspective on the impact of drug abuse and offer support in the healing process. 🔗 Show your support at: go.gov.sg/rday2025. 2) The Together, for Better roadshows: Back in your ‘hood! Our roadshows are back, and we’re making our way to Bukit Panjang and Hougang this weekend! What’s in store for you: ✅ Interactive exhibits 💼 Professional advice on jobs and upskilling 🎁 Join quizzes and win prizes 🔗 More details: togetherforbetter.gov.sg/events-and-roadshows/ See you at Hillion Mall and Hougang Mall on 17 & 18 May, from 11am to 8pm!

Hashtags

Ask Me

@askmenow · Post #2848 · 29.01.2021 г., 19:31

Daily Questions and Answers 1. The ‘Roof’ of the world is referred to which place? Answer: Pamir knot 2. What is the currency in Cambodia? Answer: Riel 3. What is dew point? Answer: The temperature at which dew begins to evaporate 4. How do you measure the speed of wind? Answer: Anemometer 5. Name the river that is not crossed by any bridges. Answer: Amazon #DidYouKnow One million Earths could fit inside the sun! Via @askmenow News headlines: read here Try: Quiz MCQ For Fun: Be Like Bro , sarcasticLOL

Hashtags

Ask Me

@askmenow · Post #2846 · 29.01.2021 г., 09:22

1. How many countries are present in Africa? Answer: 54 countries 2. Which planet is closest to Planet Earth? Answer: Venus 3. What erupts from a volcano? Answer: Lava, steam, ash, pieces of rock, and gaseous sulfur compounds 4. What is the name of the strait that separates the north and south islands of New Zealand? Answer: Cook strait 5. Which is the direction at which wind blows? Answer: Leeward direction #DidYouKnow At over 2,000 kilometers long, The Great Barrier Reef is the largest living structure on Earth Via @askmenow Know more about: 1- Venezuela Oil Crisis 2. Rohingya Refugee Crisis News headlines(29.01.2021): read here Try: Quiz MCQ For Fun:Be Like Bro , sarcasticLOL

Hashtags

Ask Me

@askmenow · Post #2845 · 27.01.2021 г., 10:04

Today's Questions and Answers 1. Which is the coldest continent in the world? Answer: Antarctica 2. Which is the world’s smallest country? Answer: Vatican City 3. Where is the Colloseum located? Answer: Rome, Italy 4. Where is the Tower Bridge located? Answer: London, UK 5. Where is the Leaning Tower of Pisa located? Answer: Pisa, Italy #DidYouKnow There is enough DNA in the average person’s body to stretch from the sun to Pluto and back — 17 times. Via @askmenow Today's news headlines: read here Try: Quiz MCQ For Fun: Be Like Bro , sarcasticLOL

Hashtags

Ask Me

@askmenow · Post #2844 · 25.01.2021 г., 12:22

Today's Questions and Answers 1. Which is the largest waterfall in the world? Answer: Victoria Falls 2. Which is the largest desert in the world? Answer: Sahara Desert 3. What are the branches of a river called? Answer: Tributaries 4. Which is the largest island in the world? Answer: Greenland 5. What heats the water in a hot spring? Answer: Magma #DidYouKnow In a glass of water when you pour a handful of salt, the level of water does down Via @askmenow Today's news headlines: read here Try: Quiz MCQ For Fun: Be Like Bro , sarcasticLOL

Hashtags

Ask Me

@askmenow · Post #2843 · 24.01.2021 г., 06:32

Today's Questions and Answers 1. Which is the tallest mountain in the world? Answer: Mount Everest 2. Which is the latitude that runs through the centre of the Earth? Answer: Equator 3. What are the names of the 5 oceans of the world? Answer: Indian Ocean, Southern Ocean, Atlantic Ocean, Pacific Ocean, and Arctic Ocean 4. Which country has the highest population? Answer: China 5. Which is the longest river in the world? Answer: The Nile, Africa #DidYouKnow The Paris Agreement on climate change was signed by the largest number of countries ever in one day. Via @askmenow Today's news headlines: read here For fun visit : Be Like Bro , sarcasticLOL Try : Quiz MCQ

Hashtags

Ask Me

@askmenow · Post #2841 · 18.01.2021 г., 12:48

Daily Questions and Answers 1. Aurora Borealis are created in which layer of atmosphere? Ans. Thermosphere 2. What is the instrument used to measure wind speed? Ans. Anemometer 3. Eiffel Tower is six inches taller in summer due to- Ans. Thermal Expansion 4. Eiffel Tower is taller in which season- Ans. Summer Season 5. Who was the first person to win the Nobel prize in physics? Ans. Wilhelm Conrad Röntgen (1901) #DidYouKnow The reason the ocean has waves and has tides that switch from high to low is that the gravitational pull from the moon and the sun keep changing. Via @askmenow Know more about: 1- Aurora Borealis vs Aurora Australis Today's headlines: read here For fun: Visit @sarcasticLOL & @updateee

Hashtags

Ask Me

@askmenow · Post #2840 · 16.01.2021 г., 16:45

Daily Questions and Answers 1. Seasons on the Earth occur due to? Ans. Tilt of the Earth 2. Which scientist invented dynamite? Ans. Alfred Nobel 3. What is the full form of ISRO? Ans. Indian Space Research Organization 4. What is the speed of light? Ans. 300,000 kilometer per second or 3×108m/s 5. When the moon comes in between Earth and the Sun, it is called as? Ans. Solar eclipse #DidYouKnow No life form can survive if they were to enter a black hole, like the one at the centre of our galaxy, the Milky Way. Even light can’t survive in a black hole. Via@askmenow© For more Visit: Word Coach, News Clips, SarcasticLOL & Be Like Bro

Hashtags

Ask Me

@askmenow · Post #2839 · 15.01.2021 г., 10:12

Daily Questions and Answers 1. Sleeping under the tree at night time is dangerous because trees produce some gas, what is the gas? Ans. Carbon Dioxide 2. Sound waves cannot travel in? Ans. Space or Vacuum 3. What is the full form of NASA? Ans. National Aeronautics and Space Administration 4. What is the atomic number of sodium? Ans. 11 5. What are the three subatomic particles in an atom? Ans. Eelectrons, protons and neutrons #DidYouKnow The decimal number system we use today was invented in India. Via @askmenow Latest news: Hong Kong internet provider admits blocking pro-democracy website Have fun with @sarcasticLOL

Hashtags

Ask Me

@askmenow · Post #2837 · 14.01.2021 г., 07:12

Daily Questions and Answers 1. We live in which layer of atmosphere? Ans. Troposphere 2. 1 Nanometer is equals to how many meters? Ans. 10 power minus 9 meters 3. Sun appears red at morning and evening because of? Ans. Scattering of light 4. Which Scientist named the words positive and negative in electrical charges? Ans. Benjamin Franklin 5. A Reusable space rocket is called as? Ans. Space shuttle #DidYouKnow Dogs have an amazing sense of hearing and can hear sounds at four times the distance than humans can. Via @askmenow Latest news:Yellow mealworms become first insect approved in EU as human food Know more about:Mealworm

Hashtags

123•••10•••1617
ПредишнаСтр. 1 от 17Следваща