Live data from Hacker News

What coding mnemonics do you use?

news.ycombinator.com

21–30 of 88 posts

Re: What coding mnemonics do you use?

#23
post #4

You might try a visual trick. Note that look like "arrows" and "point" in a particular direction. There is a small end (the tip/point) and a large end (the open end). The vertical size of the point is "less than" the vertical size of open end. So if the point comes first (reading left to right) then the point is "less than" the opening (and the symbol means "less than"), but if the opening comes first (reading left t…

I'm not convinced programmers even need a mnemonic for . After all, they'll read and write those glyphs millions of times in their lifetime.

Re: What coding mnemonics do you use?

#25
Not related to programming but close

The symbol for a diode is something like this: --|>|--

Now, which one is the Anode, which one is the Cathode

Very simple, the Anode has an A in the drawing (left side, turned 90 degrees), the Cathode (K) has a K, right side, upside down in the drawing

Re: What coding mnemonics do you use?

#26
post #23
post #4

You might try a visual trick. Note that look like "arrows" and "point" in a particular direction. There is a small end (the tip/point) and a large end (the open end). The vertical size of the point is "less than" the vertical size of open end. So if the point comes first (reading left to right) then the point is "less than" the opening (and the symbol means "less than"), but if the opening comes first (reading left t…

I'm not convinced programmers even need a mnemonic for . After all, they'll read and write those glyphs millions of times in their lifetime.

At least for me, the metaphors that I used to learn the symbols as a child have become my enduring mental models of those constructions, even if they're not actually needed to recall them any more.

Re: What coding mnemonics do you use?

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

Just remember that a hashtag points to something specific. A dot means nothing, so that's the least specific/most generic thing

Re: What coding mnemonics do you use?

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

Re: What coding mnemonics do you use?

#29
post #7
post #4

You might try a visual trick. Note that look like "arrows" and "point" in a particular direction. There is a small end (the tip/point) and a large end (the open end). The vertical size of the point is "less than" the vertical size of open end. So if the point comes first (reading left to right) then the point is "less than" the opening (and the symbol means "less than"), but if the opening comes first (reading left t…

Imagine the arrows are crocodiles. They always try and eat more. 1 4 > 1 If they're eating less, they're not happy crocodiles.

Or maybe as snork-eater-eaters

http://wharble.com/sites/default/files/Snork-Eater_Eater.jpg

Post reply on HN