Live data from Hacker News

What coding mnemonics do you use?

news.ycombinator.com

31–40 of 88 posts

Re: What coding mnemonics do you use?

#31
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.

Re: What coding mnemonics do you use?

#32
post #2

.unshift - makes it bigger. Longer word than .shift .shift - makes it smaller. Shorter word than .unshift

I could never remember this until someone told me to imagine that an array is like a row of chairs at a cinema.

"Shift" will shift everyone up one, bumping someone off the start of the row.

Re: What coding mnemonics do you use?

#33
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'

specifically for this one, I have the mnemonic that the side containing the lower value has only one vertex, while the higher has 2 :)

Re: What coding mnemonics do you use?

#36
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 was surprised to see that as an example as well, but then I thought back to starting out as a programmer.

I'm sure I spent many hours fixing bugs caused by getting wrong.

Re: What coding mnemonics do you use?

#37
Most methods in C read like an assignment,

so if you are trying to remember what order the arguments to strcpy go, it's

    strcpy(x,y) is like x = y
Then remember specially that typedef is the wrong way around to the way you would like it to be :)

Re: What coding mnemonics do you use?

#38
post #36

Earlier quoted context omitted.

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

I was surprised to see that as an example as well, but then I thought back to starting out as a programmer. I'm sure I spent many hours fixing bugs caused by getting wrong.

I find it hard to believe that someone actually mixes these unless they completely skipped all math classes in school.

Re: What coding mnemonics do you use?

#40

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

I heard "Las Vegas Hells Angels" and it's stuck with me.

That's far more rock'n'roll, I might make the switch. Now I just need to remember...

'Naughty Llama Holidaymakers Book Lovely Vacation Homes from AirBNB'

= N.L.H.B.L.V.H.A = 'not Love Hate but Las Vegas Hells Angels'.

Post reply on HN