Redian新闻
>
有大侠讲讲RTTI和exception的问题么?
avatar
有大侠讲讲RTTI和exception的问题么?# Programming - 葵花宝典
g*n
1
我毕业的时间比开始工作的时间晚了一个月 (用的precompletion OPT),所以开始工
作的时候还是学士学位,一个月后拿到了硕士学位。公司本来帮我报的PERM要求硕士学
位,后来律师说要按照开始工作时候的学历来申请,所以公司只好改成了要求学士
学位,我也从EB2变成EB3。请问DOL有没有这个规定一定要按开始工作的时候算?我还
有办法申请EB2吗?谢谢!
avatar
f*y
2
为啥不建议使用呢?主要问题在哪里?
avatar
a*e
3
你的律师是对的。就像工作经验一样,你的工作经验只有在加入公司之前的才能算。你
的学位也一样。
avatar
X*r
4
谁不建议使用就问谁啊。
如果你这个是对于早先有人贴的Google Style Guide所问的,
你看了上面每条规定所对应的详细解释吗?
Google的理由并不是对所有人都成立的。
avatar
f*m
5
国内的硕士学位可以算数吗
avatar
z*i
6
Performance problem.
RTTI: dynamic cast is expensive
exception: extra codes are generated for stack unwinding. Even if they are
not used, extra code size means:
1. Load code from main memory to instruction cache. cache pollution.
2. CPU is pipe-lined, CPU still needs to decode the assembly codes.
3. In order to preserve stack, compiler might not be able to optimize the
local variables to register. Big performance hit.
avatar
a*e
7
悬。不过可能也是case by case。咨询一下律师吧。

【在 f*****m 的大作中提到】
: 国内的硕士学位可以算数吗
avatar
r*r
8
太复杂,属于让你 shoot your own foot 部分,禁了比较好,
程序出错少。尤其对于古狗那些比较傻的。
avatar
b*r
9
听说工作的时候是ABD(All but degree)就可以申请EB2,是真的吗?
avatar
r*r
10
i think exception has a more damaging problem.
that is, it will cause memory leak, when the exceptional path is taken.
especially when exceptions are thrown from constructors and destructors.
using RAII may solve the problem if the exception is thrown by constructor.
but the ones thrown by destructors are truly problematic.

【在 z******i 的大作中提到】
: Performance problem.
: RTTI: dynamic cast is expensive
: exception: extra codes are generated for stack unwinding. Even if they are
: not used, extra code size means:
: 1. Load code from main memory to instruction cache. cache pollution.
: 2. CPU is pipe-lined, CPU still needs to decode the assembly codes.
: 3. In order to preserve stack, compiler might not be able to optimize the
: local variables to register. Big performance hit.

avatar
g*y
11
I actually quite disagree this opinion. When discussing the good/bad of
exception. You have to think about when you should use it? If it is not good
, what are the alternatives? Do the alternatives solve the problem of
exception?
You should use exception when you have errors that cause the function cannot
finish its task. For example, you cannot get the memory you need from new/
malloc. If you do not use exception, you usually return error code. You
still have different excution path for errors

【在 r*********r 的大作中提到】
: i think exception has a more damaging problem.
: that is, it will cause memory leak, when the exceptional path is taken.
: especially when exceptions are thrown from constructors and destructors.
: using RAII may solve the problem if the exception is thrown by constructor.
: but the ones thrown by destructors are truly problematic.

相关阅读
logo
联系我们隐私协议©2024 redian.news
Redian新闻
Redian.news刊载任何文章,不代表同意其说法或描述,仅为提供更多信息,也不构成任何建议。文章信息的合法性及真实性由其作者负责,与Redian.news及其运营公司无关。欢迎投稿,如发现稿件侵权,或作者不愿在本网发表文章,请版权拥有者通知本网处理。