hirez: (Object)
[personal profile] hirez
Everyone 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.

Date: 2012-04-25 08:01 am (UTC)

Date: 2012-04-25 08:56 am (UTC)
From: [identity profile] hirez.livejournal.com
Once an assembly hacker...

Date: 2012-04-25 08:16 am (UTC)
diffrentcolours: (Default)
From: [personal profile] diffrentcolours
My hacky Perl scripts (as opposed to production code) often has $cheese, @biscuits and %badgers (and variants thereof).

Date: 2012-04-25 08:43 am (UTC)
From: [identity profile] nalsa.livejournal.com
$boo & $far (but also much i &j). but $C0FF33 makes the occasional appearance. (c0:ff:33: is my default mac prefix when populating tables, too).

Date: 2012-04-25 09:09 am (UTC)
ext_17706: (Default)
From: [identity profile] perlmonger.livejournal.com
Dangling cultural signifiers...

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).

Date: 2012-04-25 04:29 pm (UTC)
From: [identity profile] steer.livejournal.com
Are the obvious reasons because you like vector arithmetic or because you like old school text adventure games?

Date: 2012-04-26 12:08 pm (UTC)
ext_17706: (Default)
From: [identity profile] perlmonger.livejournal.com
The latter, but both really I suppose :)

Date: 2012-04-25 10:32 am (UTC)
From: [identity profile] nojay.livejournal.com
84,362 is my standard large number as in "It took me eighty-four thousand three hundred and sixty-two attempts to get this to work." I don't know where it came from but it's reflexive now.

Date: 2012-04-25 11:00 am (UTC)
From: [identity profile] mr-tom.livejournal.com
m'Aberdonian colleague tends to $jobbies, whereas I'm more of a $cordwangle, $loominthrumbs, $splod type.

Date: 2012-04-25 12:28 pm (UTC)
From: [identity profile] jarkman.livejournal.com
cheesespoonbanana. I blame Haemish.

Date: 2012-04-25 01:59 pm (UTC)
From: [identity profile] solipsistnation.livejournal.com
i, j, and k were always the go-to variables for BASIC programs, too (you see what I did there? Whoooo.)m. Even still I tend to use i (now $i) as a generic counter.

Date: 2012-04-25 04:38 pm (UTC)
From: [identity profile] steer.livejournal.com
God is real. Jesus is integer.

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.

Date: 2012-04-25 04:43 pm (UTC)
From: [identity profile] steer.livejournal.com
On a quick flip through "A Treatise on Electricity and Magnetism" (1891) I can't find i,j as integer -- in fact he (contentiously IMHO) uses r and s in that role.

Date: 2012-04-25 04:49 pm (UTC)
From: [identity profile] hirez.livejournal.com
Good question. I recall that the book with which I learned myself up some FORTRAN-77 mentioned that i,j, etc were predefined as integers and this was a bit rub and you should define all your variables properly. Which is obviously why we ended up with Ruby...

Date: 2012-04-25 05:04 pm (UTC)
From: [identity profile] steer.livejournal.com
FORTRAN I always started with IMPLICIT NONE because it was how you could tell someone crafting their code from someone bashing it out... and if I ended up with some lame programming language which needed similar to force you to declare variables then I did similar -- e.g. perl "use strict".

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.

Date: 2012-04-25 04:41 pm (UTC)
From: [identity profile] steer.livejournal.com
Weirdly I use $variable in writing even though I almost never write code that uses that notation. (Shell script and awk only languages I commonly use with that).

Date: 2012-04-25 04:46 pm (UTC)
From: [identity profile] hirez.livejournal.com
Ha! Meta-metasyntax!

It's a useful construct when writing code-in-english.

Date: 2012-04-26 01:47 pm (UTC)
From: [identity profile] christiffer.livejournal.com
"meta syntactic pseudo code" is my new phrase for the day.....

May 2025

S M T W T F S
    123
45678910
11121314151617
18192021222324
2526272829 3031

Style Credit

Expand Cut Tags

No cut tags
Page generated Mar. 22nd, 2026 07:14 pm
Powered by Dreamwidth Studios