4 ms·
This is the one thing I miss from working with Java in Eclipse. There, you're always in a built state so every time you save the file you're working on, you ins
by henrikschroder 17y ago
This is the one thing I miss from working with Java in Eclipse. There, you're always in a built state so every time you save the file you're working on, you instantly get all the compiler errors if any. There's also a large amount of errors the editor can detect without invoking the compiler, and you get constant feedback about those as well.
My current main environment is Visual Studio for C#, and there you get a lot of errors detected while editing, but not all of them, so you have to continually press the rebuild button, and the time of that rebuild just keeps growing...
Then again, I recently bought a SSD, that helps a bit with build times. :-)
- ajross 17y agoIf only there were some sort of tool you could use which would automatically detect which dependencies have changed and compile only those files... I swear, I read "press the rebuild button" and wanted to cry. Edit: the sarcasm-free version of the above amounts to this: there was a time when the idea of "writing software to help you write software" was a standard notion, something that everyone did. It seems like the modern world is training a generation of programmers who don't understand this, and who see the "end result" software as the only software worth writing. The idea of tool creation and integration is alien to them. That's what the IDE buttons are for.
- henrikschroder 17y agoI meant the build button, of course you don't have to do a full rebuild every time, that would be insane. Did you honestly think Visual Studio or the cs compiler is that retarded? However, it doesn't change the fact that you still have to perform it. If you're changing a file that has a lot of dependencies, all of those have to be re-built, unlike if you're sitting in Eclipse coding Java, where you don't.
- prodigal_erik 17y agoThe only reason incremental compilation is possible in Java is that the language completely lacks abstractions like macros and overloading which can globally affect the meaning of existing code. I already spend more time reading and writing code than recompiling, so making recompiling faster by making the code more verbose, repetitive, and error-prone is not a tradeoff I'm happy about.
- eru 17y agoI don't see how macros should make everything depend on everything else. When you want to use a macro you (should) still need indicate somehow where it comes from.
- lincolnq 17y agoThey 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.
- __david__ 17y agoBut 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.
- eru 17y agoOr how about changing types? Javas weak type system should make it necessary to re-compile (and even change the sources).
- lincolnq 17y agoIf 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.
- bugmenot 17y agoActually, the default setup of MS Visual Studio build is quite retarded, because the build time grows with number of projects due to lots of temp file copying. But if you use a few large projects, the build time is big because an entire projects needs to be rebuilt (assembly level, not class level like in Java or object-level like in C)
- sterwill 17y agoAbout Eclipse: in most cases Eclipse never "invokes" a Java compiler--the compiler is built into the IDE! That's right, those .class files are getting built by the JDT Core plug-ins that come with Eclipse [1]. javac is never even used. Of course, you could configure Eclipse to run ant or make or something else to compile your code, but the editor is still driving the integrated incremental compiler to mark up all your syntax errors. [1] http://www.eclipse.org/jdt/core/index.php http://www.eclipse.org/jdt/core/index.php
- brown9-2 17y agoThis is somewhat misleading. JDT is a compiler in the same sense of the term as javac is a compiler. It's just a different compiler, with some different features.
- InclinedPlane 17y agoI think you're just misparsing the parent post re: in most cases Eclipse never "invokes" a Java compiler. The meaning seems to be that a Java compiler is never invoked (because it's built into the IDE), not that a Java compiler is never used.
- diN0bot 17y agoit's not hard to invoke whatever compiler you want. when i write python in eclipse using pydev, i get build errors when i save (though i run the programs from the command line for various reasons).