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

Резултати

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

Търсене: #vlv

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

@PensivePost · Post #5221 · 24.05.2021 г., 12:21

The ring of love#1 How far it is? Where are we leading to? What are we? Why we cry? Why we become happy? These thoughts been running in my mind while I am watching the waves on the sea shore. The pleasant music of the waves diverted me from those unanswered questions. The cool breeze touched my hot skin and I just shivered for a moment and smiled with a pleasant face. Through this long journey human race struggled a lot to be here what we are now is a long way journey that the human race has come to. Everyone are different in their own aspects of life. If a man/women is rough, then he might have faced more in his/her life and that's why he/she looks rough and tough to handle. And in other hand if a man or a women is cool and soft, then it means they had built their life in a completely different manner. Everyone has their own way of sculpting their own life. Every one has to face both types of characters in their life and should learn to face all these people. We can't use any filters and neglect them. Because it is a real life where only unexpected things happens. But we dream many things we expect many things in our life and we have the freedom to do so. No one could tell us not to dream and making it true is not in our hand. This doesn't meant that we should not dream we have to dream to move on in our life, so don't stop dreaming... "There can't....." "Hey Aashiv come here man see what we found" a voice interrupted my conversation with my "inner me". I turned towards her and waved my hands and signalled them that I am coming. I got up from the sand and ran towards them. My team found some oldest ring while excavating inside the sand. The ring looked gorgeous and I ran towards the sea and washed the ring with the water. And I just observed something written on the ring it said "Samuthra kumaari", which means "The Princess of Ocean". Suddenly a fictional character came to my mind which I studied in the novel called "Ponniyin selvan". With the sudden reminder of that character I put that ring in my pocket and ran from that place. I reached my bike and I went to kushi beach which is situated near Rameswaram. I consider that place as my soulful site and whenever I feel low I will go to that sea shore and stay there until I feel good. I went there and sat there for a moment and cried hard. I don't know why I am crying like this. But I cried without any thoughts and after a moment everything in my mind settled and I became clear enough to think deep in to my past. A name suddenly came to my mind and I spelled "Riya". Suddenly a single drop of tear came out of my left eye and it fell on the sand. It's been ten years... I didn't even spell her name. When I saw the name in the ring, the dark side of my mind came out and it took me to the darkest part of my life. With this I fainted in the sand and I heard the sound of my friends saying "Aashiv get up man what happened to you?" When I opened my eyes I was going in the car with my "Riya". And... To be continued... Dm me to know more about Aahsiv #review#share#VLV

Pensive|

@PensivePost · Post #5202 · 13.05.2021 г., 12:05

Lost her in the dark sky I lost her in the dark sky, Thought she is hiding behind the stars, It costs my life to find her, I risked my lifetime to search her, Weeks and years passed by, Can't able to find her. At the beginning, I thought, I lost her in the dark sky, But she is purposefully hiding, She knows where I am but I don't Even after knowing this I searched, I didn't stop even after becoming mad. A past reminded me a conversation Her words, "What will you do if you lost me?" I replied I will become mad Those words haunted me deep. Those true words proves my loyalty But more of the past reminded me, My bag full of mistakes... My fate cursed me more and said you deserve it for what you did to her.... #review #poetry #share #VLV

Pensive|

@PensivePost · Post #5203 · 13.05.2021 г., 12:12

Still haunting... Somewhere in the edge of my destiny, I lost myself in the world of memories.. Somewhere in the zenith of the mountain I disappeared in the mist of snow.. Somewhere in the darkest part of my life, I have been left to suffer alone.... #review #share #poet #VLV