我怎么能更好地学会“不支付你不使用”? [英] How can I better learn to "not pay for what you don't use"?

查看:107
本文介绍了我怎么能更好地学会“不支付你不使用”?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我刚刚收到了这个问题的答案,在底部,告诉我:Doing X doesn 因为它会让你支付你可能不使用的东西。

I've just gotten answers to this question which, at the bottom line, tell me: "Doing X doesn't make sense since it would make you pay for things you might not use."

我觉得这很难跟上;我的本能更倾向于看到我认为清晰的语义,用在他们的地方定义的东西。更一般来说,我不了解隐性成本和秘密关税是为了特定的设计选择?。

I find this maxim difficult to follow; my instincts lean more towards seeing what I consider clear semantics, with things defined "in their place". More generally, it's not immediate for me to realize what the hidden costs and secret tariffs would be for a particular design choice?.

这是由C ++的(非参考)书?有没有在线的相关内容,以更好地启发自己遵循这个原则?

Is this covered by (non-reference) books on C++? Is there someplace relevant online to better enlighten myself on following this principle?

推荐答案

一个语句似乎。


做X没有意义,因为它会让你支付你
可能不使用的东西。

Doing X doesn't make sense since it would make you pay for things you might not use.

这只是一个语句,如果可以,避免使用虚函数。它们增加了函数调用的开销。

This is merely a statement that if you can, avoid using virtual functions. They add overhead to the function call.

通常可以使用模板和常规函数调用来重新设计虚函数。一个std :: example是 std :: vector 。在Java中,例如Vector实现在算法中可用的接口。由虚函数调用完成。 std :: vector 使用迭代器。

Virtual functions can often be redesigned by using templates and regular function calls. One std:: example is std::vector. In Java for instance a Vector implements interfaces to be usable in algorithms. Accomplished by virtual function calls. std::vector uses iterators.

这篇关于我怎么能更好地学会“不支付你不使用”?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆