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

Търсене: #yourreview

当前筛选 #yourreview清除筛选
Pensive|

@PensivePost · Post #5105 · 15.04.2021 г., 11:34

#review #yourreview #thoughts Indeed the water rises, indeed the rivers flow, Beneath them mighty waves, Pondering and degrading the earth that knits their path. I see a gash, like a mighty wind, A tide too unbreakable by the screams of fear. And as it all comes to a still, The earth smelling fresh again, The frogs croaking, The crickets tuning a melody. And like the old grandma's hut, A smoke rises on the moist tatched kitchen, A meal, God has provided, The land will bear fruit, The children will have something, Cause the owner of the land, Has commanded it to yield. I see the villagers smile, A tune and a libation, For a cry is heard, A perfect gift of a son, I hear the drummers play the tom toms, I feel the harmony of the ululation, Tomorrow the women will gather together, To welcome and teach the young mother, How to love and to hold her little one. It is beautiful, the heart cannot contempt. Surely, tomorrow, the sun will rise again and we will smile. We will allow every rhythm and melodies made by life to flow to our hearts through the ears, We will love, we will rejoice and we will call it a blessed land

Pensive|

@PensivePost · Post #5170 · 06.05.2021 г., 06:10

I knew a girl who liked to draw, Pictures for only her eyes. She was more artistic late at night. Her drawings were different, No paper, No pen. But she needed a bandage, And wore long sleeves twenty-four/seven. We stood by the river, Under the stars, When she rolled up her sleeves And showed me her scars. She felt embarrassed and stared at her shoe. Then I rolled up my sleeves and whispered, "I draw too." #review#yourreview#noob

Pensive|

@PensivePost · Post #5007 · 18.03.2021 г., 09:30

My tears,Your tears. Our face grew hot as the fire. This mood can strike . Erupting in loud shouts, Like an extra. Wondering why we're here. Our mouth leaks with affection. My words,Your intention. Let us know our feelings. Electricity runs through our veins Shadows seem to follow. Snacking on sweet and sour lollies Nobody understands Defeated like deflated balloons Cowering in the corner at night. Our pains , we've future buzzing. I find a smile, It appears on your face. But it only widens When our heart flops together. #review #love #yourreview

Pensive|

@PensivePost · Post #5704 · 03.05.2022 г., 18:13

#iam#Rocky#yourreview#review Love the way you are Hey buddy, yes you, one who is reading this, you may be alone, not having many friends unlike others, not having enough money to live up to your dreams, may be to even fulfil your small and cutest wishes, you might be tied up all day with your course books, stressful office work, those computers and the hectic tasks, you might be feeling like running away from all your problems and just forget about all your worries, those stressful tasks and from toxic people and enjoy the beauty of the wonderful life. Buddy, you are not alone, me, you, all the top CEO’S, the world politicians, world class celebrities, sportsmen and many real life heroes were been in the same stressful situations, Just stay calm, just feel the beauty of nature, love yourself, love the way you are, the way you are living your life. Have some inner peace, don’t be very harsh on yourselves, just believe in your dreams ,focus on your goals, your passion and nothing else. Don’t give a f* about all these f* things, the girl who rejected you, the friend who betrayed you, the relative who keeps judging you, the society which is putting you shame all the time. Just Focus on your dreams, which is going to bring a grand new reality to new. Remember, no matter where you are and what you are, how worse the situation is, always have that smile on your face, which is going to make all the difference. Bye Bye. (Rocky)

Pensive|

@PensivePost · Post #4841 · 30.01.2021 г., 06:20

#review#yourreview#sm#i’mABrokenMan I’m a broken man don’t know who to trust. Being a broken man allows you not to trust. I’m a broken man with lots of blood, bleeding from the heart like a river. Being a broken man helps people raft on the red stream And they don’t give a damn, whether you die in shiver The moon is the only friend who acknowledges my tears. Stars, like a bodyguard help me fight out my fears. But sun, sometimes behaves as a foe for his rays of light, focuses me to reach my actual height. Nevertheless, I’m a broken man. Broken down piece by piece by the sword, of the goddess of beauty sharpened up with innocence, cunning ferocity. Never even cared, if I’m happy or sad, wouldn’t even matter if I’m alive or dead. I’m a broken man, who knows how to fix the glasses. But, being a broken man, There comes a why. Why even bother , rebuilding it. Everything broken down into bits and pieces. And so am I.