help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Beginning Hobbyist Programmer Question


From: reader
Subject: Re: Beginning Hobbyist Programmer Question
Date: Thu, 17 Jan 2008 18:26:28 -0600
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.1.50 (windows-nt)

signups17@gmail.com writes:

> As I get more and more into programming, I get the sense that "real"
> programmers use emacs or vi, or some other editor that from my
> perspective, seems arcane and impenetrable compared to something
> simple like IDLE that comes with Python, or Scite, for example.

> Can anyone provide a cogent explanation for why I should take the time
> to climb that learning curve? What are the benefits, as you see them?

I'm a rather lowlevel user although a longtime user of emacs.  Also a
rather lowlevel programmer but even at my level without the powers of
a real editor (and I just scratch the surface) you will soon tire of
programming since so many things are repetitious.

I'm not sure what the editors you mention are capable of but you will
very soon if not already be needing to insert repetitive things such as
the skeleton of a while or for loop.  Or common strings that recur in
your scripts.

Maybe you will need to quickly comment a chunk for testing something.
I could build up a pretty long list of things emacs does for me but
you must already have run into some of this.

Emacs has the most powerful abbrev mode you are likely to find. 
`abbrevs' are emacs speak for inserting things by typing a
string of characters like:
  pr<spc> to insert `print "mydebug bla bla  ";' 

I know almost no python so not sure what would be appropriate there. 

Here is an example of the kind of thing I use very often in perl.

To insert the skeleton of a getopts section like below I type:
pget<spc>
HERE
## BEGIN GETOPTS SECTION =========================================
  our ($opt_a,  );
  use Getopt::Std;
  my $optstr = "ab:c ";
  getopts($optstr);

  if($opt_) { 
to HERE 

And after hitting space as shown, that whole blob between HEREs (of
course not the HEREs) is inserted.  So a bunch of the coding is done
in a few keystrokes.  Emacs has a whole section called `skeletons' and
using them to bolster abbrevs there is no limit to what you can insert
quickly.  Really whatever can be imagined and done with elisp code can
be brought to bear and inserted in a keystroke or two.

Of course emacs has a developed python mode.  I can't speak much about
it since I haven't used it to speak of but I'm guessing it will be
like all other parts of emacs... something that a goodly number of
experienced coders have added and subtracted to/from for some years.

> Also, assuming I'm convinced, can you point me in the direction of a
> good tutorial?

Aside from this monster windy post of mine; no one is likely to spend
much time trying to `convince' you, but I can tell you that you will
learn some new curse words before you become competent.  Things that
my fingers know how to do without thought now didn't get there real
easily.

Someone already told you about the best tutorial, but let me suggest
that you go at emacs the same way you did python.  I'm guessing you
jumped right in and got your hands dirty.  As problems arose you
sought help either in documentation or on python lists.

I can also tell you that you would be hard pressed to find a more
helpful list.  I've badgered this list for years and still have
never failed to get an answer to my questions.

Emacs has a truly massive customization section that can be accessed in
several ways.  M-x customize-apropos <RET> REGEX (or words) <RET>

Will find dozens of customizations for just about any area of emacs
usage.  With judicious use of REGEX or plain words you can find
something pretty quickly.

There is a truly deep and profound manual with emacs that can be
searched in several ways or just read at in your spare time.
Just reading parts of it will inspire you with possibilities.
I think you can still buy a paperback book of it if so desired.

I bought one long ago.  It is a pretty hefty medium sized book.

It may take you a while to really know how to find stuff in that
manual but it was laid out and prepared to be subjected to the full
power of emacs searching abilities right from the start. 

By now some really talented people have worked on it and made sure a
new user could find something helpful there.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]