- 论坛徽章:
- 2
|
wwwsq 发表于 2012-09-29 13:34
对于晦涩的代码,不同的人会有不同的预期。比如“x = (++i = i++)”这种。
bool a();
void b();
void c();
a()?b():c()
即使是上面这样简单的代码,也会有人误解。
这样的误解会对项目造成伤害。
你可以说误解的人水平次,但你的能力仅此而已吗?如何规避对项目的伤害?
别再有意无意的歪曲到"x = (++i = i++)"上了就对了。
而对"a()?b():c()", 有人误解那真是活该。
顺带给你找几个:
- // glibc argp-help.c
- /* Iterator that returns true for the first short option. */
- static inline int
- until_short (const struct argp_option *opt, const struct argp_option *real,
- const char *domain, void *cookie)
- {
- return oshort (opt) ? opt->key : 0;
- }
复制代码
- // apr apr_md5.c apr_md5_final
- padLen = (idx < 56) ? (56 - idx) : (120 - idx);
复制代码
- // sgi stl stl_tree.h
- ::insert_equal(const _Value& __v)
- {
- _Link_type __y = _M_header;
- _Link_type __x = _M_root();
- while (__x != 0) {
- __y = __x;
- __x = _M_key_compare(_KeyOfValue()(__v), _S_key(__x)) ?
- _S_left(__x) : _S_right(__x);
- }
- return _M_insert(__x, __y, __v);
- }
复制代码 这些代码都别去看了,通篇都是误解。 |
|