An Editor that Skips to the End of a Def

Bjoern Schliessmann usenet-mail-0306.20.chr0n0ss at spamgourmet.com
Wed Sep 26 09:04:54 EDT 2007


Lawrence D'Oliveiro wrote:

> It's strange, but in nearly 30 years of writing code in dozens of
> different languages, I've never felt the urge to line up my code
> in columns. Never. 

You definitely used the wrong languages :)

http://worsethanfailure.com/Articles/The-Other-Kind-of-RPG.aspx

| Well into the .COM-boom, RPG [Report Program Generator] coders
| were still stuck coding in ?fixed format? style. Prior to that,
| RPG programmers had no choice but to use standard 80-character
| punch-card-length columns with fixed fields. In this format, the
| operator (?opcode? in RPG-speak) goes in columns 26-35, the first
| operand (?Factor 1?) goes in columns 12-25, the second operand
| (?Factor 2?) goes in columns 36-49, and the ?result field? goes in
| columns 50-63. If you do the math, that means that the fields
| (?variables? in modern-speak) were restricted to six characters.
| And of course, all had to be uppercase.      
| 
| RPG IV, the latest incarnation, introduced the concept
| of ?extended? columns with a more relaxed format. Instead of
| having one operation (ADD, SUB, DIV, etc) per line, programmers
| could use the EVAL opcode to do all sorts of crazy things like ?A
| = (B+C) * D?, all with a single line of code. It even afforded
| programmers the luxury of using lowercase letters in variables.     

I demand a Python module implementing this, because I don't like
this bad, liberal Python code today. 8)
 
> That's another issue, that of ROI. Having learnt the vi/vim
> keystrokes, what does that enable you to do? Use vi/vim, and
> that's it. Whereas I've found other situations where subsets of 
> Emacs keystrokes are recognized, such as anything that uses GNU
> readline (including the Python console--see, this IS relevant to
> Python after all)

readline's editing-mode can be emacs or vi (see "man readline").
 
> Making lots of small changes is even worse--it means you're
> jumping into insert mode for shorter times, more frequently.

That's convenient, IMHO. For example, for changing an identifier you
can delete it, activate editing mode and place the cursor where the
name was using just two keystrokes (cw<theword><ESC>). Almost the
same with multiple words, lines, or the line until EOL. For special
needs there is visual mode (like "mouse selection").

This flexibility is admittedly in most cases not suited for
occasional users because it needs much practice. Also, for prompts
a separate insert mode can be strange.
 
> And that's when you discover something else: that how you delete
> text in vi/vim differs, depending on whether it's something you
> just inserted while currently in insert mode, or whether it was
> there from before you last entered insert mode [...]
>
> At least with Emacs, text is text--it doesn't matter when it was
> inserted, it still behaves the same way.

Would you accept that the style of editing is a matter of taste? 

Regards,


Björn

-- 
BOFH excuse #185:

system consumed all the paper for paging




More information about the Python-list mailing list