zoukankan      html  css  js  c++  java
  • 命名规范 camel case, pascal case, hyphen 等等

    2020-08-02

    hyphen vs en dash vs em dash 

    hyphen 就是减, 用于把字连起来

    比如 back-up

    en dash 用于 x to y

    比如 10:00AM – 11:00AM

    em dash 很少用

    目前看到的是 google ads 用来表示 empty value

    常用 symbol

    - hyphen
    – en dash (alt + 0150)
    — em dash (alt+ 0151)
    ° degree (alt + 0176)
    ² power 2 (alt 0178)
    ³ power 3 (alt 0179)
    ® trademark (alt 0174)

    2020-07-13

    Capitalization part 2.0

    refer : 

    https://uxplanet.org/why-letter-casing-is-important-to-consider-during-design-decisions-50402acd0a4e

    花了多一点时间研究之后, 了解到了一些新的规则

    uppercase

    强项是突出,抓眼球,弱点就是不好读 (尤其多字, 长的时候, 因为人习惯看小写了)

    如果想突出,想做层次,可以用. 

    常用的地方是 tab, title, headline button  

    一般用 css 做管理

    title case 

    强项是突出,抓眼球 (但是没有输给 uppercase) 字多的时候也是不容易阅读

    再强调一次 title case 并不是第一个字大写, 有些时候是小写的,比如: King of the Ring, "of" 和 "the" 是小写

    常用的地方 tab, title, headline button

    sentence case

    这个就普通用咯. 记得 proper noun 在句子里是大写哦 (english grammer)

    常用的放 

    label, placeholder, error, hint

    2020-07-07

    Capitalization, title case, sentence case

    英语里面有很多 rule 关于 capitalization 的, 就是第一个字要大写.

    refer :

    https://developers.google.com/style/capitalization (google style guide)

    https://designguidelines.withgoogle.com/conversation/style-guide/capitalization-punctuation.html (google style guide)

    https://css-tricks.com/almanac/properties/t/text-transform/ (css text transform)

    https://github.com/gouch/to-title-case/blob/master/to-title-case.js (title case js code)

    https://www.herosmyth.com/article/headline-capitalization-ux-title-case-vs-sentence-case (title case vs sentence case)

    https://grammar.yourdictionary.com/capitalization/rules-for-capitalization-in-titles.html (capitalization rule)

    https://owl.purdue.edu/owl/general_writing/mechanics/help_with_capitals.html (capitalization rule)

    很难学,规则太多了

    记入一些就好了

    1. title case 

    在美国比较流行而已, 它的简单逻辑就是这个词,每一个字的第一个 character 要大写. 然后连词不要大写

    比如这个 : Top 7 Reasons Why a Blog is Essential for the Modern Business 

    a, is, for the 都没有大写. 然后 Why, Blog 大写

    css 是无法实现 title case 的, 它只能做到每一个字第一个 character 大写 但是不会处理 a, is, for, the 这些特色情况.

    2. MLA style 指的是写论文的格式. 不同国家其实还有更多的 style 哦...

    3. sentence case 就是一般 english 写句子的方式. 第一个字大写, 然后 proper noun 专属名词大写 

    比如 : What can the Presidential Primary teach you about your brand?

    Presidential Primary 就是 proper noun. 人名, product name 也是. iPhone 的话是 i 小写哦,要尊重取名的人. 

    在做项目的时候,系统用到的字 (title, label 等等)

    我都是避开 title case, 只用 sentence case. 没有 lowercase 和 uppercase 的. uppercase 就用 css 去调它.写字的话都是 sentence case.

     

    2020-02-17

    trailing comma 和 trailing semicolons

    for class 结尾只能是空或者 semicolons,逗号不行

    class A { 
        age: number, // error
        name: string = 'dada'
        test: any;
    }

    for interface 都可以

    interface A { 
        age: number,
        name: string,
        test: any; 
    }

    for enum 只可以放逗号

    enum C { 
        age
        name = 'dada',
        test
    }

    所以我的规范是 

    class 和 interface 放 semicolons 

    enum 放逗号 

    angular 也是这样

    2019-11-08 

    refer : https://ux.stackexchange.com/questions/43174/update-vs-modify-vs-change-create-vs-add-delete-vs-remove

    很多时候我们傻傻分不清 

    create, add, new

    -create 表示从没有到有, 产生了新的东西

    -add 通常是把某个东西添加进去某个东西,比如 add to cart, 通常产生的是一个关系,而不是一个具体的东西

    -new 通常是 ui 用的

    update, change, edit

    -update 是修改内容, 产生新的值

    -change 是替换,一个还一个

    -edit 通常用于 ui

    delete, remove

    -remove 是移走, 消失的往往是关系. 

    -delete 是删除,真的把东西给消失掉了。

    pascal case = PascalCase

    camel case = camelCase

    hyphen = blog-title

    upper case = UPPERCASE

    lower case = lower case

    title case = Blog Title

    backend c# 

    class = pascal case

    property = pascal case

    enum key =  pascal case

    variable = camelCase

    parameter = camelCase

    folder and file = pascal case

    frontend js/ts

    class = pascal case

    property = camelCase

    enum key =  pascal case

    variable = camelCase

    parameter = camelCase

    folder and file = hyphen

    url = hyphen and lowercase 

    当命名遇上 short form

    refer https://www.crownacademyenglish.com/types-english-abbreviations/

    这篇详细讲解了缩写.

    缩写有很多种,抽象都叫 abbreviation

    每种缩写都有几个 point 

    1. 怎样取字

    2. 怎样发音

    3. 要不要加符号 比如, dot (.) apostrophe (')

    4. 大小写

    1. Initialism

    取字: 多个 word, 每个 word 取第一个 character

    发音 : 一个一个字母读

    加符号 : 每个字母中间可以加 dot, 美国尤其喜欢加 dot 

    大小写, 全大写肯定可以, 如果原本字是小写则可以全小写. 但是不可以第一个字大写后面小写哦 Faq <-- 不好

    as soon as possible = ASAP or asap

    frequently asked questions = FAQ or faq

    Federal Bureau of Investigation = FBI or F.B.I

    2. Acronym

    取字: 多个 word, 每个 word 取第一个 character

    发音 : 几个字母拼起来读

    加符号: 不可以加

    大小写, 全大写肯定可以, 如果原本字是小写则可以全小写. 但是不可以第一个字大写后面小写哦 Faq <-- 不好

    National Aeronautical and Space Administration = NASA

    random access memory = RAM

    zone improvement plan = ZIP

    3. Shortenings (分 1, 2 两种)

    shortening 1 (treated as real words)

    取字: 对一个 word, 去掉前面,后者去掉后面,或者去掉前后

    发音 : 会有新读音

    加符号: 不可以加

    大小写, follow 原本的字

    advertisement = ad

    application = app

    influenza = flu

    shortening2 (not treated as real words)

    取字: 对一个 word, 去掉前面,后者去掉后面,或者去掉前后

    发音 : 读回原本 full word 的音

    加符号: 加 dot, 不加也是可以. prefer 加

    大小写, follow 原本的字

    February = Feb.

    et cetera = etc.

    4. Contractions (分 2 个 type)

    type 1: 

    取字: 对一个 word, 去掉中间. (shortning 是去掉前后,这个是中间)

    发音 : 读回原本 full word 的音

    加符号: 不可以加

    大小写, follow 原本的字

    Doctor = Dr

    government = govt

    type 2: 

    取字: 2 个 word, 中间去掉

    发音 : 读回原本 full word 的音

    加符号: 加 apostrophe (') 撇号, pie hao

    大小写, follow 原本的字

    he is = he's

    they would = they'd

    Shortening 就继续小写没事儿.

    acronym 就比较麻烦, 有时候全部大写会很乱

    有些人会把他变大小写,有写人不会...

    我认为最好是保持大写吧.

  • 相关阅读:
    自行车平衡原理
    自行车为什么前轮和后轮受到的摩擦力相反呢 自行车前轮后轮转动方向一样 自行车运动原理
    UltraCompare文件内容比较工具
    msvcp100d.dll文件丢失,解决找不到msvcp100d.dll的问题
    mfc对话框
    bzoj 2298: [HAOI2011]problem a
    9.2python操作redis
    9.1 mysql+centos7+主从复制
    9,Linux下的python3,virtualenv,Mysql、nginx、redis安装配置
    8,Linux系统基础优化及常用命令
  • 原文地址:https://www.cnblogs.com/keatkeat/p/10838051.html
Copyright © 2011-2022 走看看