There is a lot of discussion about the lack of macros in some languages, and the inefficiencies that can arise. Perhaps the most common example is the guard before a log statement.
To what extent can current & future optimisation be relied upon to do the right thing and obviate the need for a macro. In this example and in general?
// shorter
log.debug("Foo: "+ bar);
// faster?
if(log.isDebug()){
log.debug("Foo: "+ bar);
}
// best or unnecessary?
LOG_DEBUG("Foo: "+bar)
A similar argument exists for stack allocation. For 'normal' programming, does the programmer need to have the option to be explicit about this kind of thing is a more automatic approach the way forward?