A modest proposal
When you compile a source file and get multiple compile errors, there are two conflicting principles governing the order in which you go through the source file fixing them.
On the one hand, you want to fix the errors from the top downwards, because of the possibility that some errors are cascades from others: fixing earlier errors may cause later ones to turn into non-
On the other hand, if you fix an early error in a way that changes the number of lines in the source file, then you have to mentally adjust all the line numbers in the subsequent error messages. Do this multiple times and you're looking at keeping a running track of the cumulative change to the file's line count as you edit, which you didn't really want to have to hold in your head at the same time as the more important state regarding the problems you're fixing.
The solution is simple. Line numbers in source files should be indexed backwards from the end, with line 0 being the part of the file after the final newline, line 1 the line before that, and so on. If compilers reported errors using those line numbers, and programmers' text editors displayed the same line numbers, then there would no longer be a conflict: you'd fix compile errors from the top of the file downwards, each error message would have a correct line number when you reached it, and you'd only see cascade errors after fixing the primary error that caused them.
no subject
no subject
no subject
My proposal requires O(number of compilers + number of editors) work to set up, and copes transparently with arbitrarily silly compile arrangements. The only real point against it is that it's barking mad.
no subject
no subject
no subject
no subject
In Emacs, you type M-x compile RET and then enter your command (typically make).
translating Windows to Unix path separators and prepending the right top-level source directory
Emacs does this automatically. And it can handle cygwin paths too using the cygwin-mount library.
(I don't want to sound like an Emacs zealot so I'll stop now...)
no subject
no subject
no subject
(I'm sure something is possible, it just needs more tuits than I've come up with so far.)
no subject
sshdunder my own uid as my primary interactive-session process, and sshing in to that from my desktop box. That way all my processes are still children of the process they ought to be, which means in particular that if CPU-time accounting is going on then it will still give the right answers, but I also get to use sensible X forwarding and so forth.no subject
no subject
Or you could use a development environment which handles this book-keeping for you. This need not involve any compiler/editor integration at all. For example, Emacs has a "compilation-mode" for reading the output of compilers; for each error message in the compiler's output it creates a marker (a kind of bookmark) for the original position of the error in the file. This marker stays with the text even if you add or delete lines above or below it, so you just run the command ‘next-error’ to go to the next error without needing to do any mental adjustment. I'm sure other programmer editors do something similar.
no subject
My primary reason not to is that I'd have to translate ten years' worth of accumulated editor configuration written in Jed's embedded scripting language, including my personal MUA...
no subject
* Native windowing system integration was pretty tough, but I think the big problem was Unicode. Emacs was a victim of being a first mover here: in the 1990s it had adopted its own system (MULE) for integration of multilingual character sets, so when Unicode turned out to be the standard way to achieve this, MULE had to be backed out while the rather complex interface remained backwards compatible to avoid breaking a vast installed codebase.
no subject
That must have taken some special effort.
Do you really mean, worse in absolute? Or merely "not as good as what other programs offer these days"?
If the former, I wonder what made people take something that works and make it worse.
no subject
no subject
no subject
no subject
And yeah, it's very nice.
And if it starts to lose where the errors are then I just hit compile again - even with reasonably large systems it's only 30 seconds to do a build.
no subject
The old DOS assembler A86 had a rather different way of solving this problem - it injected its error messages right into the source files! It actually worked surprisingly well, but it would probably cause too much confusion these days.
no subject
no subject
no subject
(Though, curiously, I hadn't known about Swift's work when I used the title yesterday. I had somehow absorbed through cultural osmosis the general tone of things for which that title was appropriate, and it was only after I posted it that it occurred to me to look up what else it had been used for. I was pleased to find I'd got it pretty much right.)
no subject
Although when I use it in mostly the original sense, it actually tends to be something like how I read this post -- a nominal solution, which sounds completely ridiculous, and you describe as a "modest proposal" to make it clear you're not yet advocating it, yet you can't help but wonder if maybe it _would_ be sensible after all.
no subject
no subject
But I have to admit I also use irony in situations like this as a defense; if I come up with a wacky idea, I'll phrase it as a "modest proposal" in order to raise it, but not feel the need to justify it. Which is useful, if it invites some objective consideration of the problem and potential solution, but is also questionable, in that it would be more honest to simply say "I had this idea, is there any merit, or is it _just_ silly?" :)
no subject
no subject
no subject
no subject
no subject
LOL. I love your metaphor. It sounds like line-numbers are the least of the problems with your errors, though :)