Posix vs. Windows

H. S. Teoh hsteoh at quickfur.ath.cx
Fri May 18 16:03:16 PDT 2012


On Fri, May 18, 2012 at 11:08:26PM +0200, Mehrdad wrote:
> On Friday, 18 May 2012 at 19:40:35 UTC, H. S. Teoh wrote:
> >This is one of those things that makes Windows (l)users wonder how we
> >Unix people can stand using the shell all day -- their idea of shell
> >is the DOS prompt (a veritable train wreck of train wrecks).  If only
> >they knew what a *real* shell can do. ;-)
> 
> 
> Don't generalize. :P

Well, that was partially tongue-in-cheek. ;-)


> I'm a Windows user, but yes, I've used Linux.... and yes, the command
> prompt is indeed a train wreck. Bash is indeed a lot better.
> 
> And no, I haven't used PowerShell; I hate programs that take too long
> to start up.

Whoa. PowerShell takes a long time to start up? Sounds like it's already
a train wreck even before you start using it.


> I definitely know what a *real* shell can do, but I also know that
> it's *pretty damn hard* to write foolproof code in Bash.
> Just look at: http://mywiki.wooledge.org/BashPitfalls

OK, _using_ bash and _coding_ in bash are two very different things. I
routinely write complex 1-liners to do crazy complex stuff in ways that
no GUI can express. *But* I also never write bash scripts.  Well, OK,
that's a lie... I do, but never more than 1-liners, or just very simple
sequences of commands.

Because you're right: bash is good for interactive use, but it's ...
shall we say, completely atrocious for scripting? Like the stupid
implicit interpolation everywhere (and sometimes _inconsistent_ levels
of interpolation -- well OK, it's actually consistent, but not to
someone who can't recite bash code in their dreams), that causes leaning
toothpick syndrome galore.

For scripting, you want Perl, not bash.

And just for the record, I was a tcsh user for well over a decade before
I decided to use bash, 'cos tcsh also has its own suckage.


> It's just that in Bash scripts, it's easier to get to 99% correctness
> than it is with batch files. But getting to 100% is a pain in *BOTH*
> (indeed, I still have no idea how to do it).

Use Perl. :-)

And batch files... yikes. The incompleteness and quirkiness of them
makes them almost completely unusable for anything but the most trivial
of tasks. Bash scripts can do a lot more, but there are pitfalls, holes,
and hidden interpolations everywhere that threaten to disintegrate your
beautiful castle of cards if you feed it the wrong kind of data.


> On the other hand, I *do* wonder how CLI users get any work done
> without the ability to do GUI-related tasks (e.g. refactoring in
> Visual Studio/Eclipse/whatever?). :P

I find IDEs more painful to use than scratching your nails on a
chalkboard. The inability of running an IDE over a remote SSH session
without everything slowing down to a snail crawl makes it completely
unusable for me. In the amount of time it takes the beast to paint the
screen, I could've manually refactored the code three times over. The
use of a _real_ text editor (i.e., NOT that monstrous shipwreck of an
excuse for software called notepad, or its dainbramaged second cousin
wordpad) helps a lot. Like, one that can filter an arbitrary text
selection through an arbitrary-complex shell command. :-) Or that can
repeatedly apply a complex sequence of editing commands at a single
keystroke (as opposed to navigating the rodent through endless layers of
menus).

But I won't start the Visual Irritation vs. Extremely Massive And
Cumbersome System flamewar here. ;-)


T

-- 
"How are you doing?" "Doing what?"


More information about the Digitalmars-d mailing list