代码中易混单词的区分

代码中易混单词的区分

Satus Vs State

state:

the mental, emotional or physical condition that a person or thing is in 状态;状况;情况(CONDITION OF SB/STH 状态)

  • state倾向于condition,一般都是有限的、可列举的,「状态」的有效值之间可以类似状态迁移的用state,没有互相迁移的关系用status。
    • state machine
    • state transition diagram
    • solid state
    • in a state of
    • steady state

status:

the situation at a particular time during a process (进展的)状况,情形
the social or professional position of sb/sth in relation to others 地位;身份;职位

  • status则是不可确定的状态,statusText,一部分类似postion,status bar,status code
    • present/current status
    • running status
    • system status
    • exit status

handle vs handler

A handle is an abstract reference to a resource. Handle是对某个资源的抽象引用。
A handler is an asynchronous callback subroutine. Handler则是一个异步的回调函数(子程序)。
其他:Handler 封装了消息的发送,也负责接收消。内部会跟Looper关联。Looper 消息封装的载,内部包含了MessageQueue,负责从MessageQueue取出消息,然后交给Handler处理。MessageQueue 就是一个消息队列,负责存储消息,有消息过来就存储起来,Looper会循环的从MessageQueue读取消息。

参考:
程序代码中,怎么区分status和state?

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值