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

Резултати

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

Търсене: #hadeeth

当前筛选 #hadeeth清除筛选
We want you

@we_want_youu · Post #4764 · 17.09.2024 г., 09:35

According to Al-Quran, Surah Ar-Rahman (55:19-23), Allah Almighty presents a powerful and miraculous sign of His creation: He released two seas, meeting side by side. Between them is a barrier, so they do not mix. So which of the favors of your Lord will you deny? In these verses, Allah highlights His supreme authority and wisdom. The reference is to two bodies of water — saltwater and freshwater — that meet but do not mix, remaining separate due to a divine barrier. This natural phenomenon, which scientists have now confirmed, is a profound example of Allah’s control over the natural world. Despite their proximity, the two waters retain their distinct properties, showcasing the perfect balance and system designed by the Creator. #Miracle of the #Quran The Quran was revealed over 1400 years ago, long before modern science understood this phenomenon. The concept of two seas meeting without mixing is something that early humans would have had no scientific means to explain. However, this fact has been witnessed in places like the Mediterranean Sea and the Atlantic Ocean, as well as at river mouths where freshwater meets saltwater. These verses from Surah Ar-Rahman serve as a miraculous scientific truth that confirms the divine knowledge in the Quran, as such occurrences were unknown to humans at the time of revelation. This miracle demonstrates that the Quran is not just a religious text, but also a source of knowledge beyond human capacity. It contains signs that have been confirmed by modern scientific discoveries, proving its authenticity for generations. #Hadeeth and the Understanding of Nature The Quran’s miraculous signs are supported by several teachings in the Hadith (the sayings and actions of the Prophet Muhammad, peace be upon him). The Prophet (PBUH) emphasized reflection on the natural world as a way to understand the power and wisdom of Allah. He encouraged believers to observe the universe as a sign of Allah’s existence, greatness, and mercy. For instance, in one hadith, the Prophet (PBUH) said : "Verily, in the creation of the heavens and the earth, and in the alternation of the night and the day, there are indeed signs for men of understanding. (Sahih Muslim) This emphasizes that everything in the natural world — from the vastness of the cosmos to the interaction of rivers and seas — is a sign of #Allah’s greatness. The separation of the seas is not just a scientific reality, but a reflection of Allah’s control over every element of creation. #Challenging Other #Religions #Islam, through the Quran and Hadith, presents a clear and rational understanding of the world that aligns with both spiritual insight and scientific discovery. Other religions, such as Hinduism, Christianity, and Judaism, do not offer such precise and scientifically verifiable details in their scriptures. While they contain teachings about faith and morality, no other religious scripture provides such detailed descriptions of natural phenomena that can be later confirmed by science, as is the case with the Quran. Why Deny the Truth? The repeated question, "So which of the favors of your Lord will you deny?" is a reminder to humanity that all the signs of Allah’s existence and mercy are evident, yet many people continue to deny or ignore them. These verses challenge the deniers of faith by presenting clear, undeniable evidence of Allah’s creation and control over the universe. In conclusion, this verse from Surah Ar-Rahman, alongside many other Quranic miracles, serves as a testament to the truth of Islam and the divine nature of the Quran. It stands as a proof for both believers and skeptics, showing that no other religion can provide such clear and scientifically proven signs of divine wisdom and knowledge. The separation of the seas is just one of many miracles in the Quran that continue to be confirmed by modern discoveries, making it clear that the Quran is the ultimate source of truth. Thanks for your kindly time