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

Резултати

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

Търсене: #btn

当前筛选 #btn清除筛选
PT风向旗

@Ptfxq · Post #195 · 03.05.2021 г., 12:04

#BTN BTN 正在举办他们的第一个拯救动物 (SaveTheAnimals) 活动,截止日期到 2021 年 6 月份。 排名奖励: • 第一名:250,000,000 BP(2.5 亿积分),三个邀请和一个漂亮的徽章。 • 第二名:150,000,000 BP(1.5 亿积分),两个邀请和一个漂亮的徽章。 • 第三名:50,000,000 BP(5000 万积分),一个邀请和一个漂亮的徽章。 其他奖项: • 每个食品10,000积分。 • 每个玩具50,000积分。 • 每个床上用品100,000积分。 • 每向动物收容所捐赠 50 美元 / 250,000 BP。(必须是公认的非营利性组织) • 向动物收容所捐赠 100 美元可以得到一个邀请。(必须是公认的非营利组织) • 不在此列表中的项目将获得由员工决定的一定数量的奖励积分。

Hashtags

PT风向旗

@Ptfxq · Post #203 · 18.05.2021 г., 08:53

#BTN#PTP 继 BTN 开启了拯救动物捐赠活动后(见前文: https://t.me/Ptfxq/195 )PTP 和 HDB 管理 Musicalmind 在 BTN 论坛表示向指定慈善机构捐赠一百美元即可 PM 获得 PTP 邀请。

Hashtags

PT风向旗

@Ptfxq · Post #396 · 20.11.2022 г., 12:47

#BTN#公告#世界杯 省流:BTN 的因为世界杯重新开放了赌场。以下为公告原文: oh god noHEY GUYS IT'S WORLD CUP TIME Yes it's classic World Cup time: the arse-end of November!!!! Thanksgiving, Christmas, Hanukah, Kwanzaa, the 2022 FIFA© World Cup® in Qatar™. All festive favourites. And at the chilly auld temperature of *checks notes* 24*C/76*F at 0200 in Doha as I write this. Ideal playing conditions. To celebrate, we're running the auld betting system again! Come one, come all, and spaff all your wealth up the wall for the chance to make bank on a truly worthless currency: the British pound BTN BPs!!!! I feel happy, I feel great, I feel content. If you're on IRC, go to #btn-sport to shitpost about the World Cup, or anything else sport related. Yes it's quiet but it's also there. You can do this by ticking #btn-sport on your IRC page. T&Cs: 1. As is tradition, we (the house) take 10% for all bets. This is non-refundable; if you cancel your bet, you will be refunded 90% of your bet, the house keeps the 10% take. 2. House takes are put into the request pool, and are applied to requests using whatever black magick powers it. 3. I will be paying out bets. This is done manually because automation is nice, but it's better to have someone who can be shouted at for doing something wrong (I did this last year, was lols). I will try to pay them out within 15 min of the ref blowing up for FT. 4. You are betting on the result at FULL TIME after 90 (NINETY) MINUTES (plus injury time). In the knockout rounds, this is not the same thing as who goes through. If a game goes to extra time, this is considered a draw for the sake of this betting system.

PT风向旗

@Ptfxq · Post #458 · 05.10.2023 г., 08:30

#BroadcasTheNet#BTN#活动 Pumpking Carving Competition 2023 October is getting on and Halloween is come way too quickly (I don't have a costume ready at ALL), so BTN members, it's time to show off your pumpkin carving skills again! There's no limit to what your carving can be themed, though there are special prizes for scariest and favorite BTN/TV-themed carvings. To enter, simply post a picture of your creation with your username and the date visible in the picture in this thread and staff will pick their favorites! If your entry does not have the date and your username in the picture, it will not be eligible for prizes. Rules 1) All entries must be posted in this thread and a piece of paper with your BTN username and the date must be visible in your entry. If your entry does not have the date and your username in the picture, it will not be eligible for prizes. 2) You can submit as many entries as you like, but each user can only win one prize. 3) You cannot win any prize if you are warned. 4) Winners will be chosen by staff vote. 5) Staff cannot win prizes. 6) Entries will be accepted until the end of October, 2020 (GMT). Prizes Main Prizes • 1st place receives a 30 day Seedbox, 5,000,000 bonus points, and a pumpkin badge. • 2nd place receives a 30 day Seedbox, 3,000,000 bonus points, and a pumpkin badge. • 3rd place receives a 30 day Seedbox, 1,000,000 bonus points, and a pumpkin badge. Category Prizes • The scariest pumpkin will receive a 30 day Seedbox, 1,000,000 bonus points, and a pumpkin badge. • Our favorite BTN or TV-themed pumpkin will receive a 30 day Seedbox, 1,000,000 bonus points, and a pumpkin badge. • All other entrants will receive 100,000 BP for entering.

PT风向旗

@Ptfxq · Post #786 · 02.12.2024 г., 01:59

#BroadcasTheNet#BTN#站点活动 BTN 圣诞送魔力! BTN 每日左下角的蓝色礼盒能开出如下内容: 普通奖品:Up to 30,000 Bonus Points or 30GB Upload Credit 罕见奖品:Up to 100GB Upload Credit, or 250 Lumens 倒霉徽章:We've also added a special badge for those unlucky few... but the details about how to get it will be hush hush. Best of unluck to those who want it! 金星: 一枚金星 - 250k BP and 150GB Upload Credit 两枚金星 - Random Special Advent Themed Badge 三枚金星 - An exclusive badge for this year's advent! 四枚金星 - 24 hours of 2x upload, for everyone This year we're changing a few things up. We've gone through and updated the prizes that you can win to bring them in line with how the economy on the site has changed: • You can receive the following normal prizes: Up to 30,000 Bonus Points or 30GB Upload Credit. • You can receive the following rare prizes: Up to 100GB Upload Credit, or 250 Lumens. • We've also added a special badge for those unlucky few... but the details about how to get it will be hush hush. Best of unluck to those who want it! The most important change is the rewards for the Golden Stars: • 1 Gold Star - 250k BP and 150GB Upload Credit • 2 Gold Stars - Random Special Advent Themed Badge • 3 Gold Stars - An exclusive badge for this year's advent! • 4 Gold Stars - 24 hours of 2x upload, for everyone 2024 慈善募捐活动 主要奖品: • 1st place receives a spiffy badge, and your choice of 50,000,000 BP or one invite (provided your invites are not disabled). • 2nd place receives 35,000,000 bonus points, and a spiffy badge. • 3rd place receives 25,000,000 bonus points, and a spiffy badge. 其他奖品: Every user will receive bonus points for each item they donate, as follows: • 3,000 bonus points per food item. • 5,000 bonus points per toy. • 5,000 bonus points per book. • 10,000 bonus points per article of clothing. • 20,000 bonus points per blanket. • 30,000 bonus points per coat. • 80,000 bonus points per large appliance. • 100,000 bonus points per large furniture item. • Items not on this list will be awarded an amount of bonus points determined by staff. 详细规则见首页通知。

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