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

Резултати

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

Търсене: #survival

当前筛选 #survival清除筛选

On what to save As times get interesting, we should consider what we should keep in the worst case: A good rule of thumb when it comes to saving something is will you be able to use it 10 years after a possible disaster. That's not to say all electronics should be forgotten or you shouldn't try to save anything. Batteries, small devices may be valuable in the intermediate aftermath. Hand driven or solar radios are a good choice, microwaves are not. #survival @EuropeanTribalism

Hashtags

On fire There is an easy way of making a quite effective camp fire: the Dacota Fire Hole. Dig a hole around 30cm deep and also dig an air hole connected to it. Place dry wood into the hole and start a fire with an approach of your choice. Matches and lighters are okay. The growing fire will pull needed oxygen through the secondary hole but will be resistant to wind. Place any pots or objects to heat above the hole with the fire. #survival @EuropeanTribalism

Hashtags

On growing plants In Nahuatl, the old language of the Quiche-Maya, there is the term 'milpa'. It defines an agricultural system, which uses the symbiosis of three plants: corn, beans and pumpkins. The corn plants support the beans growing up, the beans support the corn plants by supplying nitrogen and the pumpkin prevents the soil from drying out with its big leaves. This setup is also known as 'the Three Sisters'. We will try out this system this year and I will share the results with you. #survival @EuropeanTribalism

Hashtags

On gardening We are rapidly approaching spring, with only February ahead! I want to remind you that it is time to think about your gardening plans for the coming season! The first plants need to be sowed next month! This is going to be an essential year for us, so try to be as independent on food as possible! #survival @EuropeanTribalism

Hashtags

On the most basic survival rule Always remember, that you will survive: ~ 3 hours in extreme cold ~ 3 days without water ~ 3 weeks without food Prepare accordingly! Is your heating running and backed up? Do you have fresh water supplies? Do you have food supplies for some time? Something will come, be prepared! #survival @EuropeanTribalism

Hashtags

On preparations (2) You don't have to be completely self-sufficient. Almost no one truly is. However, having at least SOME food independence is hugely valuable, even if it's ONLY some carrots and tomatoes growing in your back garden. A huge amount of the government's power comes from controlling the food supply, which is why Communists always attack that first. If every individual could feed themselves and their family for a week, then the government is weak. If everyone could feed themselves for a month, then the government is afraid, because a month is more than enough time to annihilate a government in. If everyone can feed themselves indefinitely, the government is powerless and at your mercy. Again: you DON'T have to be completely independent or even come close to it. Just having enough growing in your garden to feed yourself for a week or two is already an advantage. So focus on that. One week. Then two. Take it easy and manage your energy but don't do nothing. #survival @EuropeanTribalism

Hashtags

On backups We live in a quite rural area. Around 6.00AM this morning there was a blackout which was fixed around 5.00PM. Luckily we have several combustion ovens in our house, which work quite decent for cooking. Combined with a Dutch Oven, we had a decent lunch: chicken and vegetables. What do I want to tell you is the following: do not take electricity for granted! Make backup plans or just think about what you need in case of a blackout. These three questions should be answered first: - Can I provide clean water without electricity? - Can I cook without electricity? - Can I heat my living space without electricity? If you answer any of those questions with 'no', be aware that you might be among the first to die in a real blackout scenario. #survival @EuropeanTribalism

Hashtags

Take a look at the recent statistics of sunspots! The implications are, that we will soon enter a period of cold. Draw your conclusions: the availability of food will decrease. Prepare yourselves with local projects, such as gardens with your own food, community gardens or cooperations with farmers! #survival

Hashtags

movies & series 🍿

@images · Post #1733 · 04.12.2024 г., 11:01

🍿 'Last Breath': The Underwater Thriller That Will Leave You Breathless in 2025 📆Release: February 28, 2025 🎭Genre: #Thriller · #Survival 🎟 If the Netflix documentary Last Breath left me in awe, its cinematic adaptation is set to bring this incredible true story to life once again. 😱 Finn Cole (Peaky Blinders) stars as Chris Lemons, a diver stranded in the depths of the North Sea with only minutes of oxygen. Meanwhile, Woody Harrelson (True Detective) and Simu Liu (Shang-Chi and the Legend of the Ten Rings) lead a nail-biting race against time to save him. ⏳ The most intriguing part? The documentary's (available on Netflix 📺) director, Alex Parkinson, helms the film, ensuring the authenticity and tension of the original story remain intact.

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