4 ms·
Python has the additional problem of being highly dynamic, though! In C++'s case, the transformation tool has much more information, so more things are possibl
by faho 8y ago
Python has the additional problem of being highly dynamic, though!
In C++'s case, the transformation tool has much more information, so more things are possible to do.
E.g. let's take the ".erase" case from the article. In python, a method
def foo(bar):
bar.remove(baz)
can't simply change "remove" to "erase", because it has no idea what type "bar" has.
A C++ tool sees
void foo(std::list<sometype>& baz)
and can then safely change "remove" to "erase".
- wbkang 8y agoI think that breaks down as soon as templates are involved, which is very pervasive in C++ codebase. Given template<typename T, typename sometype> void foo(T<sometype>& baz) It's not so straightforward anymore.
- jgtrosh 8y agoIt can still apply the operation anytime a specialized object is defined. (This is how templates are compiled, right?)
- int0x80 8y agoBig problem here is the preprocessor as mentioned in the article.