Other people's metasyntactic variables
Apr. 25th, 2012 08:39 amEveryone knows about foo and bar. (or my $foo, int foo...) Probably because if you've the sort of mind described in the back of 'The new hacker's dictionary', you'll already have absorbed part of that culture without really knowing why. I had a similar-but-different experience while reading a weblog the other day. Salutory stuff.
Anyway. There are others - fred, bill, wibble, x, n.
If you come across integers or random indexes/counters that always seem to be i, j and k, you can tell that there's a dollop of ancestral FORTRAN somewhere in that code's gene pool.
I tend to use $thing and $otherthing. Actually, tended now that Perl has become an Orwellian un-language.
And of late I have been using 'blah' a lot. I had thought it had arrived randomly because it's quick to type like 'fred', but actually I now remember it was the favoured meta-variable of one of the hackers at Orchestream.
So there you go.
Anyway. There are others - fred, bill, wibble, x, n.
If you come across integers or random indexes/counters that always seem to be i, j and k, you can tell that there's a dollop of ancestral FORTRAN somewhere in that code's gene pool.
I tend to use $thing and $otherthing. Actually, tended now that Perl has become an Orwellian un-language.
And of late I have been using 'blah' a lot. I had thought it had arrived randomly because it's quick to type like 'fred', but actually I now remember it was the favoured meta-variable of one of the hackers at Orchestream.
So there you go.
no subject
Date: 2012-04-25 08:01 am (UTC)no subject
Date: 2012-04-25 08:56 am (UTC)no subject
Date: 2012-04-25 08:16 am (UTC)no subject
Date: 2012-04-25 08:43 am (UTC)no subject
Date: 2012-04-25 09:09 am (UTC)Apart from foo/bar/baz, I tend to xyzzy (for obvious reasons) and crapp0 (a personal hangover; a cow-orker 30-odd years ago always so referred to that ancient stats package CRP0).
no subject
Date: 2012-04-25 04:29 pm (UTC)no subject
Date: 2012-04-26 12:08 pm (UTC)no subject
Date: 2012-04-25 10:32 am (UTC)no subject
Date: 2012-04-25 11:00 am (UTC)no subject
Date: 2012-04-25 12:28 pm (UTC)no subject
Date: 2012-04-25 01:59 pm (UTC)no subject
Date: 2012-04-25 04:38 pm (UTC)Do you think I to N are default integers because FORTRAN did that or do you think FORTRAN did that because I to N were often integers?
I think the i,j,k,l,m,n are integers and x and y are continuous variables is a long standing mathematical tradition.
I have Paul Hoel's "Introduction to mathematical statistics" on my desk and that was first published in 1947. It uses i,j,k and n as integers but x,y, p and q as reals by default.
Cox and Smith's "Queues" from 1961 uses the same (that post-dates FORTRAN but I doubt is influenced).
Digging in my cupboard the only other early text book I can find (Hardy and Wright's "An introduction to the Theory of Numbers", 1938) has similar notation although a,b, and c are also often integer too -- but then number theory needs lots of integers.
no subject
Date: 2012-04-25 04:43 pm (UTC)no subject
Date: 2012-04-25 04:49 pm (UTC)no subject
Date: 2012-04-25 05:04 pm (UTC)Now I mainly write in python and there's no equivalent. Philosophically I know why but I still miss the bondage and discipline.
A hippy friend of mine when taught FORTRAN was told that variables had names and variables which were integers had names which began with I, J or K. When he was struggling with his code, he showed me it to get my help. It was full of code like:
DO 10 KEVIN=1,10
KYLIE=KYLIE+1
That quickly becomes impenetrable.
no subject
Date: 2012-04-25 04:41 pm (UTC)no subject
Date: 2012-04-25 04:46 pm (UTC)It's a useful construct when writing code-in-english.
no subject
Date: 2012-04-26 01:47 pm (UTC)