Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re: There's a level in Hell reserved for ________

by jonadab (Parson)
on Mar 01, 2003 at 18:27 UTC ( #239733=note: print w/ replies, xml ) Need Help??


in reply to Re: There's a level in Hell reserved for ________
in thread There's a level in Hell reserved for ________

people who use variable and function names such as $a, @b, %c and &d and the like.

Those are okay if they're lexically scoped in a block that fits on half of the screen all at once. (Otherwise, you're spot on, of course.) I say half of the screen, of course, so that you can look at two pieces of code at once (e.g., to view a routine and where it is called).

vi

No. I don't use vi, but it at least has some basic functionality. It's not scriptable, so it's not good for really serious use, but it can get simple jobs done in a pinch, unlike most other so-called text editors (EDIT, Notepad, SimpleText, TPU, ...).

There is however, on a related note, a special judgement reserved for people who release operating systems that don't include basic things like a decent text editor, perl, basic network utils (ping, traceroute, wget), and a compiler. (You're probably okay if it's on the CD but not installed by default; it's not including it at all that gets you the extra bonus warmth.)


for(unpack("C*",'GGGG?GGGG?O__\?WccW?{GCw?Wcc{?Wcc~?Wcc{?~cc' .'W?')){$j=$_-63;++$a;for$p(0..7){$h[$p][$a]=$j%2;$j/=2}}for$ p(0..7){for$a(1..45){$_=($h[$p-1][$a])?'#':' ';print}print$/}


Comment on Re: There's a level in Hell reserved for ________
Download Code
Re: Re: There's a level in Hell reserved for ________
by zengargoyle (Deacon) on Mar 01, 2003 at 20:28 UTC
    No. I don't use vi, but it at least has some basic functionality. It's not scriptable, so it's not good for really serious use, but it can get simple jobs done in a pinch, unlike most other so-called text editors (EDIT, Notepad, SimpleText, TPU, ...).

    i assure you, not only is vi scriptable, it's really good for serious use. and if you use a buff version like vim you can even have a Perl interpreter inside your editor.

    i remeber converting a shell script to Perl once while someone was watching.

    # foo.sh HELLO = "hello" WORLD = "world" # tons more of these

    luckily :g/^[A-Z]\+ =/s/^/my $/|s/$/;/ can Perlify all of those variable declarations for me!

    # foo.sh my $HELLO = "hello"; my $WORLD = "world"; # ...

    there's nothing like watching a file morph from one language to another almost magicly.

      Is it scriptable, really? I've never seen anyone claim that vim was fully scriptable before. I know about the Perl embedding (which is indeed cool, since there are (a small handful of) things Perl makes significantly easier than elisp), but maybe we're stumbling over the definition of scriptable.

      When I say scriptable, I mean that every action is scriptable. I'm not talking about giving the user the ability to create scripts and then call them at will (that's more like what I call macro facility), but the ability to completely rewrite the editor's behavior in arbitrary circumstances. So, for example, in a truly scriptable editor, I can create a mode just for quizzing questions, and I can set that mode up so that when I type a question in and finish up with a question mark that causes my function (quizques-electric-question-mark or somesuch) to be called, which can do whatever it likes (insert some additional stuff, move the cursor around, save the file, refactor the indentation, whatever). Similarly, given an arbitrary computer language (a new one, say), someone could create a mode that does not just syntax highlighting and indentation but also actively helps the author write -- something like cperl-mode. Every keypress has to be fully scriptable.

      If I'm mistaken, and vim is indeed scriptable to that degree, then I've been putting off learning it for too long. (Not that I can really switch, given the amount of custom elisp I have that I'd have to translate, but if it's as flexible as you say I'd like to learn it as a second editor.) But though I've seen a lot of vim advocacy, that's a claim I've never seen before. Can you point me in the direction of some documentation that explains how to do it, the vim equivalent of the Gnu Emacs Lisp Reference Manual? If this is really true, it excites me considerably, and I would stop putting it off and learn vim this spring.

      But I suspect that you misunderstood me, because if vim could really do that stuff I'd think some of the people who are really into vim would have written command shells and spreadsheets and mail/news clients and web browsers and z-machine emulators whatnot for it, like the Emacs people have done.


      for(unpack("C*",'GGGG?GGGG?O__\?WccW?{GCw?Wcc{?Wcc~?Wcc{?~cc' .'W?')){$j=$_-63;++$a;for$p(0..7){$h[$p][$a]=$j%2;$j/=2}}for$ p(0..7){for$a(1..45){$_=($h[$p-1][$a])?'#':' ';print}print$/}

        i'm still not a vim power user by any means, but i've noticed that when i

        'vim a_directory'
        it pops up in a dired like mode.

        " <enter> : open file or directory " o : open new window for file/directory " O : open file in previously visited window " p : preview the file " i : toggle size/date listing " s : select sort field r : reverse sort " - : go up one level c : cd to this dir " R : rename file D : delete file " :help file-explorer for detailed help " Sorted by name (.bak,~,.o,.h,.info,.swp,.obj at end of list) "= /home/me/omatic/ ../ fri/ friday/ fridaytwo/ pres/ sat/ saturday/ sun/ sunday/ thursday/ tue/ tuesday/ :call <SNR>2_ToggleHelp() 12,1 + Top

        and i remember back in decades past that there were macros that could create and solve a maze. i simply assume that vim is Turing Complete and if you liked you could make it do whatever you wanted. but it might be like programming in brainf*ck.

        it also does syntax-highlighting on the fly as i type so it could probably do any other work on the fly as well.

        my whole take on the emacs thing is you don't have an editor with a scripting language, you have a scripting language with an editor module as the default interface. the web-browser is written in lisp and uses the editor module for input/output. =P

Re: Re: There's a level in Hell reserved for ________
by mowgli (Friar) on Mar 01, 2003 at 20:54 UTC
    ... people who use variable and function names such as $a, @b, %c and &d and the like.

    Those are okay if they're lexically scoped in a block that fits on half of the screen all at once. (Otherwise, you're spot on, of course.) I say half of the screen, of course, so that you can look at two pieces of code at once (.e.g, to view a routine and where it is called).

    Granted. I also don't mind variable names like $a if they're used solely as one-time temporary values and the like, but that's about it.

    ... vi.

    No. I don't use vi, but it at least has some basic functionality. It's not scriptable, so it's not good for really serious use, but it can get simple jobs done in a pinch, unlike most other so-called text editors (EDIT, Notepad, SimpleText, TPU, ...).

    I'm not convinced. I'd rather use just cat and sed to edit my programs than dabbling with vi. ;) But that's just me, of course.

    There is however, on a related note, a special judgement reserved for people who release operating systems that don't include basic things like a decent text editor, perl, network utils (ping, traceroute, wget), and a compiler. (You're probably okay if it's on the CD but not installed by default; it's not including it at all that gets you the extra bonus warmth.)

    Absolutely agreed - in particular, not including a C compiler is something that I hope the respective responsible parties get some heat for. ;)

    --
    mowgli

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://239733]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others examining the Monastery: (7)
As of 2014-07-25 00:09 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite superfluous repetitious redundant duplicative phrase is:









    Results (167 votes), past polls