Reply by Albert van der Horst July 3, 20052005-07-03
In article <uy8933xdy.fsf@news.dtpq.com>,
Christopher C. Stacy <cstacy@news.dtpq.com> wrote:
<SNIP>
> >The programming language that I usually work in (Lisp) uses a >different set of conventions. First of all, case doesn't matter. >If you say "UNDER" or "under" it means the same thing, so we >don't bother with run-together words and worrying about the case. > >And although you could use underscore, nobody does, because we >can use dash ("-"), which reads more naturally. I make this >claim, because nobody is ever instructed not to use underscore. >They know that they could, and many of the older programmers >came from languages (like PL/I) where that's you always did. >And yet nobody --- in particular, no newbies -- ever even >suggest using underscores. I think the only reason this is >not done in other languages is the infix subtraction problem.
Well, in Forth we use the dash convention often too. I have defined the word _ as "push a don't care value to the stack". Its prononciation is "don't care". Forth uses any number of weird character combinations, but the prononciation is known: */mod "star-slash-mod" +! "plus-store" $^ "string-index" Not only the founder, Chuck Moore, insists that words are pronouncable, he prefers them to form sentences. Further most Forth's are case-insensitive, although I don't really like that.
>So we would always just write "time-left", pronounced "time left".
Groetjes Albert. -- -- Albert van der Horst,Oranjestr 8,3511 RA UTRECHT,THE NETHERLANDS Economic growth -- like all pyramid schemes -- ultimately falters. albert@spenarnc.xs4all.nl http://home.hccnet.nl/a.w.m.van.der.horst
Reply by Rob June 29, 20052005-06-29
"Mike Harrison" <mike@whitewing.co.uk> wrote in message
news:rnedb1d97cg01ab2g5g4mbn0d8tb5f9asq@4ax.com...
> On 20 Jun 2005 05:29:08 -0700, ian_okey@hotmail.com wrote: > > > > > > >David Tweed wrote: > >> Rob wrote: > >> > (1) __loop. Well, how are you supposed to drop that into polite > >> > conversation? > >> > >> "under-under-loop" > >> > >> > (2) time_left so how could you tell it apart from TimeLeft? > >> > >> "time-under-left" > >> > >> -- Dave Tweed > > > >Following Mr pre-decremented Tweed's suggestion, I am going to have to > >start using the following > > > >_Milkwood > > >_score > ..well as _ is often called an "Underscore", that one could causeeven
more confusion....
> >
And probably a little mis_standing.
Reply by Paul Keinanen June 25, 20052005-06-25
On Fri, 24 Jun 2005 14:56:51 -0700, Zonn <news-zonn@zektor.AOL.com>
wrote:

>On 23 Jun 2005 22:35:49 GMT, in msg <3i0rq5Fiu9rvU4@news.dfncis.de>, >Hans-Bernhard Broeker <broeker@physik.rwth-aachen.de> wrote: > >>Zonn <news-zonn@zektor.aol.com> wrote: >> >>> If you double up the letters in your simple counters using 'ii', >>> 'jj' or 'cc' for a throw away character, etc. as variable names, >>> you'll have a *much* easier time searching for them in your text >>> editor. >> >>Only for rather limited-capability instances of "text editor". A >>programmers' editor that can't search for 'i' as a *word* (as >>understood by the programming language being edited) isn't really >>worth your money. > >Most of my work is embedded assembly language programming, where the language is >seldom supported by my text editor (Codewright) in the detail needed search for >'i' as a word, or a byte, or as a macro substitution parameter, or a variable in >a conditional 'IF', or in an EQU statement, etc.
Even Windows Wordpad contains the search options "Match whole words only" and "Match case", which works quite well searching for variable i or j :-) The RSX-11 EDT screen editor had the concept of "word" and user definable word separators a quarter of a century ago. It would be quite a surprise if an editor intended for program development would not have such features these days even in the language insensitive mode. Paul
Reply by Dave Hansen June 24, 20052005-06-24
On Fri, 24 Jun 2005 14:56:51 -0700, Zonn <news-zonn@zektor.AOL.com>
wrote:

>On 23 Jun 2005 22:35:49 GMT, in msg <3i0rq5Fiu9rvU4@news.dfncis.de>, >Hans-Bernhard Broeker <broeker@physik.rwth-aachen.de> wrote: >
[...]
>>Only for rather limited-capability instances of "text editor". A >>programmers' editor that can't search for 'i' as a *word* (as >>understood by the programming language being edited) isn't really >>worth your money. > >Most of my work is embedded assembly language programming, where the language is >seldom supported by my text editor (Codewright) in the detail needed search for >'i' as a word, or a byte, or as a macro substitution parameter, or a variable in >a conditional 'IF', or in an EQU statement, etc.
CodeWright is well able to search for a single-character variable (such as 'i'). But it's not the way I have it set up by default -- you have to get mouse-clicky or at least learn the keyboard equivalents. I can search for [^A-Za-z_]i[^A-Za-z_] from my standard seach (which is a somewhat painful amount of typing, and also happens to include whatever precedes and follows the variable. To change all instances of the variable 'i' to 'x', the search pattern would be ([^A-Za-z_])i([^A-Za-z_]) and the replacement pattern would be \1x\2. Certainly doable, but searching for (and replacing) 'idx' is simpler. the substring doesn't generally appear within other identifiers. Otherwise, I have to resort to using the "dialog" box search, which has every possible option except fixing the kitchen sink. To perform the search without a mouse, I have to use Alt s (note: NOT Alt-s) s (again) i (what I'm searching for) Alt-w (limit to whole-word) enter. To perform the replacement, it's Alt s r i (what I'm searching for) Alt-r x (replacement value) Alt-w enter (This will give me a prompt for each replacement -- If I want to do a global replacement, Alt-g before enter, or if I want to do a single replacement, Alt-s before enter). You can also use the dialog box to search in multiple files. You can probably set all the options necessary to do the from the keyboard, but I wouldn't try it. I certainly wouldn't try to memorize them all... Regards, -=Dave -- Change is inevitable, progress is not.
Reply by Lanarcam June 24, 20052005-06-24
Hans-Bernhard Broeker wrote:
> Zonn <news-zonn@zektor.aol.com> wrote: > > > If you double up the letters in your simple counters using 'ii', > > 'jj' or 'cc' for a throw away character, etc. as variable names, > > you'll have a *much* easier time searching for them in your text > > editor. > > Only for rather limited-capability instances of "text editor". A > programmers' editor that can't search for 'i' as a *word* (as > understood by the programming language being edited) isn't really > worth your money.
When you need to use the search facility of an editor to find a variable such as 'i' this is often the case that you have a function that spans many pages. I sometimes had to do so but I cursed the lousy programmer who left a buggy and unfinished work and had not been able to split its work into manageable functions. When I write the code the functions are short. I can locate easily the local variables even with short names. The global variables have long names and can be easily found by the editor.
Reply by Zonn June 24, 20052005-06-24
On 23 Jun 2005 22:35:49 GMT, in msg <3i0rq5Fiu9rvU4@news.dfncis.de>,
Hans-Bernhard Broeker <broeker@physik.rwth-aachen.de> wrote:

>Zonn <news-zonn@zektor.aol.com> wrote: > >> If you double up the letters in your simple counters using 'ii', >> 'jj' or 'cc' for a throw away character, etc. as variable names, >> you'll have a *much* easier time searching for them in your text >> editor. > >Only for rather limited-capability instances of "text editor". A >programmers' editor that can't search for 'i' as a *word* (as >understood by the programming language being edited) isn't really >worth your money.
Most of my work is embedded assembly language programming, where the language is seldom supported by my text editor (Codewright) in the detail needed search for 'i' as a word, or a byte, or as a macro substitution parameter, or a variable in a conditional 'IF', or in an EQU statement, etc. But assembly language is a bit OT from the original discussion... In 'C' you make a good point. -Zonn -- Zonn Moore Remove the ".AOL" from the Zektor, LLC email address to reply. www.zektor.com
Reply by Reinardt Behm June 24, 20052005-06-24
Meindert Sprang wrote:

> "CBFalconer" <cbfalconer@yahoo.com> wrote in message > news:42BB1F0A.6FCAF7A4@yahoo.com... >> > Prithee tell, how doth one type _ without using the shift key? >> >> One doesn't, thus catering to dislikes of excess labor and of the >> presence of '_'s in source text. If I must use the shift key, at >> least let me use a normal alpha key with it. > > Can''t you just rotate the cap on the -/_ key 180 degrees? > > But seriously, one could wonder why no programmers editor/IDE vendor in > the world has come up with a "keyboard-in-C-mode" mode, where you actually > do not have to press shift to get _..... > > For some stupid reasong I always use uderscores when programming in C or > assembly, while at the same time I use capitals when programming in > Pascal. Weird guys, those programmers... > > Meindert
If it was only that _ char. On my german keyboard I must use the right alt key (AltGr) to get the {[]}|~@\ keys. This is a very "nice" design of "international keyboards". So using a shift ky for _ is no nuisance compared to all the chars I need for programming. -- Reinhardt Behm, Nauheim, Germany, reinhardt.behm@t-online.de
Reply by Richard Henry June 24, 20052005-06-24
"CBFalconer" <cbfalconer@yahoo.com> wrote in message
news:42BB1F0A.6FCAF7A4@yahoo.com...
> Dave Hansen wrote: > > CBFalconer <cbfalconer@yahoo.com> wrote: > >> Rob wrote: > >>> > >>... snip ... > >>> > >>> Is it me or do I seem to have a dislike of _'s ? > >> > >> I seem to be one of the very few who agree with you. I think > >> it is a consequence of extreme laziness, and thus reluctance > >> to use the shift key. > > > > Prithee tell, how doth one type _ without using the shift key? > > One doesn't, thus catering to dislikes of excess labor and of the > presence of '_'s in source text. If I must use the shift key, at > least let me use a normal alpha key with it.
Alt-numeric can "type" any printable character. This _ was inserted with alt-0-9-5. Not that that solves the laziness problem.
Reply by Dave Hansen June 24, 20052005-06-24
On Fri, 24 Jun 2005 07:44:06 +0200, "Meindert Sprang"
<mhsprang@NOcustomSPAMware.nl> wrote:

[...]
>For some stupid reasong I always use uderscores when programming in C or >assembly, while at the same time I use capitals when programming in Pascal.
Might it be, perhaps, that standard Pascal doesn't (didn't?) permit underscores in identifiers?
>Weird guys, those programmers...
Goes without saying. Regards, -=Dave -- Change is inevitable, progress is not.
Reply by June 24, 20052005-06-24
cstacy@news.dtpq.com (Christopher C. Stacy) writes:

> "Meindert Sprang" <mhsprang@NOcustomSPAMware.nl> writes: > > But seriously, one could wonder why no programmers editor/IDE vendor > > in the world has come up with a "keyboard-in-C-mode" mode, where you > > actually do not have to press shift to get _..... > > In Emacs, you could swap the keys this way: > > (define-key global-map "-" '(lambda () (interactive) (insert "_"))) > (define-key global-map "_" '(lambda () (interactive) (insert "-"))) > > Is it not similarly trivial to do this in other editors?
I suppose I should have put those on the C-mode key map.