PHWinfo banniere

Titres
PORTAIL ANNUAIRE ARTICLES COMPARATEUR HÉBERGEURS DEVIS FORUMS RÉDUCTEUR D'URL
Précédent   PHWinfo > Autres forums > Forum Programmation & Conception > comp.lang.c > Re: Identifying variables: what process do you follow?
S'inscrire FAQ Membres Recherche Messages du jour Marquer les forums comme lus
Re: Identifying variables: what process do you follow?

Réponse
 
LinkBack Outils de la discussion
Vieux 16/10/2007, 19h11   #1
Alan Curry
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Identifying variables: what process do you follow?

In article <53f61$4714c98e$4275d90a$21258@FUSE.NET>,
Kevin Walzer <kw@codebykevin.com> wrote:
>
>With C, such an approach doesn't seem practical. You need to identify
>some variables ahead of time just to have a program that will compile!
>So, I'm wondering what approach seasoned C programmers use for larger
>programs, i.e. ones larger than the simple single-function ones I'm
>learning from my C textbook. Is there a design process that identifies
>such things?


Most of us don't type the complete program in a single pass from beginning to
end. If you use an editor instead, you'll have the ability to go back and add
variable declarations. The Standard Text Editor (ed) is sufficient, but there
are even more ful editors available today, which actually make use of the
cursor positioning abilities of the terminal, enabling you to see the code as
you edit it!

With this modern wonder, the full-screen text editor, you may begin writing a
C function without including any local variable declarations. When you come
to a point where you need a local variable, instruct the editor to relocate
the cursor to the beginning of the function. This is often done by the
repeated use of a key labeled with an arrow pointing in an upwardly
direction, each press of which will cause the editor to respond by moving the
cursor onto the preceding line of your source code.

Having arrived at the beginning of the function, insert the declaration.
Locate the cursor movement key of opposing orientation to the one previously
employed. Press repeatedly until the return of the cursor to its starting
position is actualized.

Advanced users may find editor shortcuts for moving the cursor to the desired
locations with fewer keypresses.

.... Seriously, what are you editing with, "cat > file.c" ?

--
Alan Curry
pacman@world.std.com
  Réponse avec citation
Vieux 16/10/2007, 22h18   #2
Kevin Walzer
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Identifying variables: what process do you follow?

Alan Curry wrote:
> In article <53f61$4714c98e$4275d90a$21258@FUSE.NET>,
> Kevin Walzer <kw@codebykevin.com> wrote:
>> With C, such an approach doesn't seem practical. You need to identify
>> some variables ahead of time just to have a program that will compile!
>> So, I'm wondering what approach seasoned C programmers use for larger
>> programs, i.e. ones larger than the simple single-function ones I'm
>> learning from my C textbook. Is there a design process that identifies
>> such things?

>
> Most of us don't type the complete program in a single pass from beginning to
> end. If you use an editor instead, you'll have the ability to go back and add
> variable declarations. The Standard Text Editor (ed) is sufficient, but there
> are even more ful editors available today, which actually make use of the
> cursor positioning abilities of the terminal, enabling you to see the code as
> you edit it!
>
> With this modern wonder, the full-screen text editor, you may begin writing a
> C function without including any local variable declarations. When you come
> to a point where you need a local variable, instruct the editor to relocate
> the cursor to the beginning of the function. This is often done by the
> repeated use of a key labeled with an arrow pointing in an upwardly
> direction, each press of which will cause the editor to respond by moving the
> cursor onto the preceding line of your source code.
>
> Having arrived at the beginning of the function, insert the declaration.
> Locate the cursor movement key of opposing orientation to the one previously
> employed. Press repeatedly until the return of the cursor to its starting
> position is actualized.
>
> Advanced users may find editor shortcuts for moving the cursor to the desired
> locations with fewer keypresses.
>
> ... Seriously, what are you editing with, "cat > file.c" ?
>


Emacs, actually.
  Réponse avec citation
Réponse


Outils de la discussion

Règles de messages
Vous ne pouvez pas créer de nouvelles discussions
Vous ne pouvez pas envoyer des réponses
Vous ne pouvez pas envoyer des pièces jointes
Vous ne pouvez pas modifier vos messages

Les balises BB sont activées : oui
Les smileys sont activés : oui
La balise [IMG] est activée : oui
Le code HTML peut être employé : non
Trackbacks are oui
Pingbacks are oui
Refbacks are oui


Fuseau horaire GMT +1. Il est actuellement 13h25.


Édité par : vBulletin® version 3.7.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC5 Tous droits réservés.
Version française #16 par l'association vBulletin francophone
PHWinfo est un site Éducation Sans Frontières
Ad Management by RedTyger
©Tous droits réservés par les parties respectives
Page generated in 0,08120 seconds with 10 queries