Posix vs. Windows

H. S. Teoh hsteoh at quickfur.ath.cx
Fri May 18 18:29:36 PDT 2012


On Sat, May 19, 2012 at 02:39:20AM +0200, Mehrdad wrote:
> On Friday, 18 May 2012 at 23:50:18 UTC, H. S. Teoh wrote:
> >>Was it actually that slow?
> >
> >Anything that has a GUI is unacceptably slow over a remote
> >connection, last time I checked. I'm not talking about connecting
> >over a  local network, which doesn't really count, but a connection
> >over the internet.
> 
> 
> Uhm, no.
> 
> The *slowest* GUI's I've seen are -- by far -- SSH-based. (e.g.
> remote Emacs -- even on a local network -- is horrible.)

You must be using Emacs with a GUI.


> I've _personally_ used National Instruments's tools over cable
> internet (if you've used them, you know they're certainly *not* less
> GUI-intensive than an IDE lol), and they're completely usable. Not
> /fast/, mind you -- but completely acceptable.

GUI-intensive apps aren't even on my radar. I don't do GUI. I'm a
command-line freak. The only GUI I consistently use is the browser,
which I only use for nice embedded image support and the fact that
nowadays, almost every website is graphic-intensive and specifically
designed to be as painful to use as possible should you ever dare to
turn off images.


> And no, my cable wasn't fantastic either.
> And yes, it was plain old Remote Desktop.
> Also, the other side's server was kinda slow too.
> 
> You should definitely try it. :P

I regularly do all sorts of stuff over SSH. And I don't mean SSH
tunnelling that crap called X11, I mean good ole pure text-only SSH.
As soon as anything with graphics factor into the equation, it turns
into a crawling morass of slowness. Which is what I mean. GUI's are
useless across an SSH connection.


[...]
> >But you're right that certain renamings, like a member function
> >name that may be overloaded across a large number of classes,
> >could potentially be very painful.
> 
> Yeah, imagine trying to name a method named "getValue()" to
> something else (probably because you realized that's not a great
> name :P).

Although I'd argue that somebody silly enough to actually design an API
with methods called "getValue" deserves the pain of manually renaming
every instance of it. :-P


> A HUGE time waster without refactoring tools, and last time I
> checked, no text-based tool did it.

Oh? It's called "rename the method and recompile, get 50 pages of
compile errors, pipe it to a grep command that extracts the filenames
and line numbers, use sed to transform that into a sed command that
automatically substitutes every instance of the matching identifier on
the given files/line numbers".

See, I told you I was a command-line freak. :-) You can't do that in any
GUI app that wasn't specifically designed to handle that specific
operation.  It's all fine and dandy when it *does* happen to support
that exact operation that you need, but good luck when the app writers
didn't think of this one case that you just ran into. Which I just did
with basic tools designed 20+ years ago (probably longer). :-P


> >Though what I'd really like in that case is a syntax-tree aware text
> >editor.
> 
> 
> 100% agree, I've been looking for them too. But they don't exist.  And
> practically speaking, without project management (in which case they'd
> be half-baked IDEs), the *can't* exist...

Well, I _did_ demonstrate how to do it above, given the proper tools and
shell support. :-) It's a bit clunky, but hey, it works. And if you get
further compile errors, just look those up (using suitable combinations
of grep/sed) and undo the wrong substitutions. Just two steps, and
you're done.


> >Or a nice console-based IDE that isn't dependent upon a GUI.
> ,
> I'd probably use them too, but they don't exist AFAIK. :(

My IDE is called vim. :-P *runs and hides*


[...]
> >I'm not talking about having to click through 5 menus and type in
> >a macro definition, bind it to some keystroke, and then run it
> >afterwards. I'm talking about things like "search for this regex
> >and replace it with that pattern, now do this again to the next 25
> >occurrences of the search term" -- ON THE FLY.
> 
> Oh, I misunderstood then. In that case, you don't even need an
> external tool...
> 
> Ctrl-H: Brings up Replace dialog.
> Alt-E: Check the "Regex" box.
> Alt-P: Type in the regex.
> <types regex>
> Alt-R: However many times you want, to replace the next instance.

You're missing the point. My point was that you can do this with
*arbitrarily complex sequences of operations*. Yes search and replace
with regex is a specific command that's supported by your IDE, but what
about "move one line down, one word over, increment the number by 1"
repeated 50 times to repair a table of numbers that had some
miscalculations"? In vim, you can group such sequences of operations and
apply them repeatedly. The fact that the operations are logical (move
one word over instead of move 5 characters over, which may not work if
your code has varying word lengths) helps a lot.


> Though I'd question what you were doing if it were 25 times. Most
> likely you want to do it within a certain range of the document, in
> which case you can highlight that portion of the text (with the
> keyboard or the mouse, both are easy :P), and just tell your
> editor/IDE to replace only that portion.

It was just for illustrative purposes. It doesn't have to be "repeat n
times"; what about "apply operation X,Y,Z until the end of the enclosing
block"?


[...]
> >I don't care to waste time defining a whole named macro just for this
> >one occasion. I want to, in essence, write 1-line code to transform
> >the current selection, right now.
> 
> Yes, writing 1-line code is definitely easier in *nix-based tools
> (since they're text based, obviously), but if you have any other
> examples of actual tasks you do regularly, let me know -- I'm sure
> there's a way to do them with VS/Eclipse that isn't much different in
> terms of the amount of work/payoff.

Like I said, I do all sorts of insane stuff all the time. And not just
with code, I regularly edit code, documentation, script files, data
files, etc., in the same vim session. It sucks to have to open 15
different apps and waste time switching between them when I could do
everything without my fingers leaving the keyboard for 1 second (and
without focus-distracting cycling through windows).


[...]
> I've made a macro to look for all of my C++ include and library
> directories, and switch them from Visual Studio to Windows WDK (for
> various reasns).
> Oh, and to detect where the WDK is, I read the registry keys inside
> the macro, find the directories, etc.. Easy. And *none* of the pain
> with escaping quotes or whatnot, since it's an actual *language*
> (VB.NET, which has nothing to do with VB6, btw -- just C# in a
> different syntax), not a Bash script.

Bash scripts suck. We've established that. :-) Your example went over my
head, 'cos I haven't used windows in any serious way for at least 15
years. :-P


[...]
> All in about ~150-200 lines of VB.NET code, and I've used it a few
> dozens of times now. Saved my fingers from all the typing I'd
> otherwise have to do to change a gazillion project settings.

Stop right there. Project settings, eh? lol... I remember that one term
when I was TA in an introductory Java course (way back in the day), and
we had to use VisualAge Java. Let's just say that I'm glad _I'm_ not one
of the students. :-P  For me, an SConscript does my project management
way better than any IDE project settings could ever do. And, being
actually written in Python, I can write arbitrarily complex code for
switching between compilers, libraries, operating systems, whatever, and
just specify one or two command-line parameters, and the whole thing
builds like magic.

In fact, SCons rulez so much that I build an _website_ with it, starting
with source code that produce numerical programs that output data that
gets turned into POVRay scenes, which gets rendered into images that are
installed to the website. Then there are static php files that get piped
through php-cli and installed as .html files.  There's also a particular
image that's generated by scanning a Subversion log, filtering into a
dataset that gets graphed by gnuplot, and then the image is installed to
the website. And some sample source code that automatically gets
tarballed. All of this is done with a single SCons command -- change a
single file, and it automatically figures out everything that has to be
updated (e.g., update the tarball), and leaves everything else
untouched.

Now try writing an IDE that can do all of _that_ in one go. :-P


> And I don't have to interface with any text lol.
> 
> If you were to do this with some text-based tool, it'd be next to
> impossible IMO, since you'd have to edit XML settings, and keep
> track of all the repetitions (e.g. something might appear under a
> Debug node but not a Release node, etc.).

XML is the spawn of evil, next in evilness only to Javascript, but I
digress. :-P Seriously though, you could just use xmlstar (google for
it) if you really have to. XML is not meant for human consumption. Only
machines can process that horribly tedious stuff without its brain
turning into a pretzel.


> >By which I mean VI vs. EMACS, of course. ;-)
> 
> 
> Ah lol.
> 
> I hate both. XD

You don't know what you're missing.  No, really. Trust me, I know,
because I used to hate them too. I hated them so much, that I wrote
(well, tried to write) my own editor just so that I didn't have to use
them, when pico just didn't cut it anymore for doing serious work.  And
then my supervisor at my first job made me learn vim. Which made me hate
it all the more. Until one day, after investing lots of time (and
venting lots of frustration) into learning how to use it properly, it
suddenly all *clicked*.

Since then, I've never looked back.  Now in retrospect (har har), all
those other "editors" that I loved were actually just backbiting
cripples that wasn't worth a pinch of my dedication to them.  Try it
sometime. You might find yourself liking what you thought was impossible
not to hate, ever. :-)


T

-- 
In a world without fences, who needs Windows and Gates? -- Christian Surchi


More information about the Digitalmars-d mailing list