Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

They make compilation of the macro's clients depend on the implementation of the macro, and therefore those clients must be recompiled when the macro changes. In Java, there's no expectation that changing the implementation of a method in one java file would cause another java file to be recompiled.


But if you add an parameter to a function then don't all the files that have calls to that function have to be recompiled (so that you can see the error)?

I don't know Java so I'm assuming it's similar to other compilers. Please correct me if I'm wrong.


Or how about changing types? Javas weak type system should make it necessary to re-compile (and even change the sources).


If you change a parameter, then you are changing the interface, and it makes sense that that affects recompilation.

Changing the type is an interesting one. If you change the backing class from one type to another, but you were using an interface to access it, then the Java compiler doesn't need to recompile that code -- the compiled InvokeInterface bytecode for that method invocation doesn't change. However -- I feel like I may have read this somewhere -- there are optimizations which might cause it to replace InvokeInterface with static invocations when it can determine at compile time what class is used. If that's the case, then it would have to recompile the client class too.


I was thinking about changing the type of a parameter and return type in parallel --- where the application only treats them as block boxes and just gives and takes those objects, but never looks at them.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: