Live data from Hacker News

What coding mnemonics do you use?

news.ycombinator.com

71–80 of 88 posts

Re: What coding mnemonics do you use?

#71
post #51

Earlier quoted context omitted.

I find it hard to believe that a statistically normal programmer mixes up . That sounds more like dyslexia.

This is the first time I'm hearing about this too so I think there is more to it. I don't even see why a mnemonic is required since the shape of both ' ' clearly demonstrate the relationship that the operator is testing.

I probably should have chosen a better mnemonic to start from! I'd point out that if you see greater and less than more like arrows it's utterly confusing. I'm not denying I'm probably weird in that respect, it's just something I have to use tricks to remember….

Re: What coding mnemonics do you use?

#72
post #3

I never remember that . = class and # = id in CSS, so I use "say no to drugs" to remember that "hash is not class". Perhaps a mnemonic which only really works in the North East of the UK where 'class' is colloquial slang for 'good'. Also not very good if you smoke pot, I guess.

I also took it to mean that it's not classy to smoke hash (i.e. 'you stay classy, San Diego' :D)

Re: What coding mnemonics do you use?

#75

Questionably coding, but I always loved this IRC snippet: tar -xzf merc.tgz what the fuck how the fuck do you people remember this shit just think with a german accent XTRACT ZE FILES

I really don't see what the big deal is with tar. Everyone seems to hate it. Probably because exactly one of those flags is necessary: zcat merc.tgz | tar -x

I quite like it, and have almost a singalong bit for the meaning attached to each character I add to a long tar command

tar - [create] [verbosely] [a g/bzip'd compressed] [file named] foo.tgz (from) input_dir

tar -cvzf foo.tgz input_dir

Your version doesn't seem as 'fun', I guess zcat and PIPE are just hard to rhyme along to.

Re: What coding mnemonics do you use?

#76

Earlier quoted context omitted.

Ah, yes the "I can't fit it to my mental model, therefore it is impossible" argument. When little, my brother used to mix up the words "more" and "less" while speaking. I don't doubt someone could mix up > and <.

It's easy. They're alligator mouths, that always go for the larger number (greedy alligators!)...

This genuinely confused me because I thought the larger number would eat the smaller number.

Re: What coding mnemonics do you use?

#77
post #74

Questionably coding, but I always loved this IRC snippet: tar -xzf merc.tgz what the fuck how the fuck do you people remember this shit just think with a german accent XTRACT ZE FILES

Don't memorize. Use unp: http://packages.debian.org/unstable/utils/unp

Or dtrx:

http://packages.debian.org/unstable/utils/dtrx

Re: What coding mnemonics do you use?

#78
post #45

Earlier quoted context omitted.

Just out of curiosity, do you say "array of string" or "strings" or something else?

Actually, I say "string" and then drop the bass for the square brackets.

Normally, this would honestly be a moment when I'd question if you were trolling, maybe post the fry meme image.. but. Given the topic, I actually believe you O_O

Re: What coding mnemonics do you use?

#79

LoVe HAte when ordering psudeo classes in css for anchors* ":link, :visited, :hover, :active" *may not be particularly weird or novel

Also CSS related, when doing margin/padding I use "TRouBLe" to remember: margin: (T R B L)

Do you have one for border-radius? Because I still can't remember the order of those..

Re: What coding mnemonics do you use?

#80
post #28

The fact that programmers can't remember well illustrates why children shouldn't be chastised for getting (for example) b and d wrong. I have dealt with this by conditioning myself to always read < as 'is less than'

I find it hard to believe that a statistically normal programmer mixes up . That sounds more like dyslexia.

I've known a few otherwise non-dyslexic programmers that have had this issue. One guy kept a sticky note on his monitor with "> Greater, < Less" written on it.
Post reply on HN