zoukankan      html  css  js  c++  java
  • 命名困惑系列之一:关于state和status的粗浅研究

    牛津高阶词汇的解释

    state:

    CONDITION OF SB/STH  状态:the mental,emotional or physical condition that a person or thing is in.

    举了几个例子:a confused state of mind 思绪纷乱, a bad state of repair 年久失修, a state of shock 震惊 , not in a fit state to drive ,状态不好不宜开车

    status:

    the situation at a particular time during a process  (进展的)状况,情形

    至此,对于在定义变量的过程中,绝大多数的涉及到“状态”的变量名,都可以用status来定义了,比如 订单状态,处理状态,购买状态,发送状态等等。至于state,看释义主要是用于精神、情绪、物理条件上的这么一个状态,除非在特定的业务领域,一般基本可以不用。个人以为可以这么理解,status是用于记录一些离散的确定的状态,事物在一系列特定的操作之后在某个流程线上处的位置,比如,邮件发送状态:未发送、发送中、已发送成功等,state则是非离散的模糊的状态,属于事物固有的属性,可能由不同的条件变化来触发,比如情绪:高兴、悲伤、震惊等。

  • 相关阅读:
    electrica writeup
    C++ Tips and Tricks
    net-force.nl/steganography writeup
    3*n/2
    C++ 关键字浅谈
    MindMaster激活教程
    gitignre
    python pil 安装
    ubuntu 阿里云安全配置
    阿里云 centos 环境配置与 django 部署
  • 原文地址:https://www.cnblogs.com/julymaple/p/4321762.html
Copyright © 2011-2022 走看看