EMACSWAY_LOG Telegram 389
emacsway-log: Software Design, Clean Architecture, DDD, Microservice Architecture, Distributed Systems, XP, Agile, etc.
Коллеги обратили мое внимание на статью "Радикальный перфекционизм в коде" https://habr.com/ru/post/543490 У меня появилось несколько мыслей, которыми можно поделиться. Будет несколько постов. Стоит отметить, что хотя автор старался отделить моментами Code…
> переименовывающим getJson в getJSON

Очень тонкий вопрос. Правило getJSON не универсально, и не будет работать для snake_case (get_j_s_o_n). Т.е. общее количество правил растет для каждого частного случая. А базовый критерий хороших правил - минимализм. Хороший пример - объем документация к языку Оберон стал в 3 раза меньше, чем к языку Паскаль. При этом автор обоих языков один и тот же. Т.е. эволюционирование заключается в поиске форм упрощения. Как не вспомнить тут не вспомнить Дейкстру:

📝 "Simplicity is a great virtue but it requires hard work to achieve it and education to appreciate it. And to make matters worse: complexity sells better."
- Edsger W. Dijkstra, 1984 On the nature of Computing Science (EWD896)

Запись вида get_j_s_o_n() затрудняет восприятие. Если стремиться минимизировать подмножество правил, тогда getJson() или get_json(). Одно и то же правило и для CamelCase и для snake_case.

Но однообразие принятого стиля важней. Битву выигрывает строй, и при этом не важно, кто из бойцов лучше маршрует индивидуально. Главное, чтоб одинаково.

#SoftwareDesign



tgoop.com/emacsway_log/389
Create:
Last Update:

> переименовывающим getJson в getJSON

Очень тонкий вопрос. Правило getJSON не универсально, и не будет работать для snake_case (get_j_s_o_n). Т.е. общее количество правил растет для каждого частного случая. А базовый критерий хороших правил - минимализм. Хороший пример - объем документация к языку Оберон стал в 3 раза меньше, чем к языку Паскаль. При этом автор обоих языков один и тот же. Т.е. эволюционирование заключается в поиске форм упрощения. Как не вспомнить тут не вспомнить Дейкстру:

📝 "Simplicity is a great virtue but it requires hard work to achieve it and education to appreciate it. And to make matters worse: complexity sells better."
- Edsger W. Dijkstra, 1984 On the nature of Computing Science (EWD896)

Запись вида get_j_s_o_n() затрудняет восприятие. Если стремиться минимизировать подмножество правил, тогда getJson() или get_json(). Одно и то же правило и для CamelCase и для snake_case.

Но однообразие принятого стиля важней. Битву выигрывает строй, и при этом не важно, кто из бойцов лучше маршрует индивидуально. Главное, чтоб одинаково.

#SoftwareDesign

BY emacsway-log: Software Design, Clean Architecture, DDD, Microservice Architecture, Distributed Systems, XP, Agile, etc.


Share with your friend now:
tgoop.com/emacsway_log/389

View MORE
Open in Telegram


Telegram News

Date: |

Read now Clear During a meeting with the president of the Supreme Electoral Court (TSE) on June 6, Telegram's Vice President Ilya Perekopsky announced the initiatives. According to the executive, Brazil is the first country in the world where Telegram is introducing the features, which could be expanded to other countries facing threats to democracy through the dissemination of false content. During the meeting with TSE Minister Edson Fachin, Perekopsky also mentioned the TSE channel on the platform as one of the firm's key success stories. Launched as part of the company's commitments to tackle the spread of fake news in Brazil, the verified channel has attracted more than 184,000 members in less than a month. Over 33,000 people sent out over 1,000 doxxing messages in the group. Although the administrators tried to delete all of the messages, the posting speed was far too much for them to keep up.
from us


Telegram emacsway-log: Software Design, Clean Architecture, DDD, Microservice Architecture, Distributed Systems, XP, Agile, etc.
FROM American