What weird coding things do you have to use statements for or other weird tricks to remember? I can never remember < or >, and only remember that < is less than from years of typing (i=0; i<30; i++).
Not a mnemonic per se but I have melodies for common code snippets.<p>"public static void Main(string[] args)", which is the default method signature for the main method in C#, is a hip-hop beat. SQL statements are always metal tunes. Javascript is usually indie pop.
I never remember that . = class and # = id in CSS, so I use "say no to drugs" to remember that "hash is not class".<p>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.
The fact that programmers can't remember < and > well illustrates why children shouldn't be chastised for getting (for example) b and d wrong.<p>I have dealt with this by conditioning myself to <i>always</i> read < as 'is less than'
LoVe HAte when ordering psudeo classes in css for anchors*<p><pre><code> ":link, :visited, :hover, :active"
</code></pre>
*may not be particularly weird or novel
Questionably coding, but I always loved this IRC snippet:<p><sdmkun> tar -xzf merc.tgz what the fuck<p><sdmkun> how the fuck do you people remember this shit<p><bucketmouse> just think with a german accent<p><bucketmouse> XTRACT ZE FILES
I was taught the alligator/crocodile thing like many others, but it never really stuck. For some reason (later in life), someone said "left hand, less than" as they held up their left hand to form a less than sign. That image sticks in my head a lot better.<p>Another thing that was particularly hard to get naturally was the ternary operator. It didn't sink in easily until Jon Skeet said pretend the ? is indeed a question. If the answer is 'yes', this will happen.
Not related to programming but close<p>The symbol for a diode is something like this: --|>|--<p>Now, which one is the Anode, which one is the Cathode<p>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
You might try a visual trick. Note that < and > 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 to right), the opening is "greater than" the point (and the symbol means "greater than").
.
Most methods in C read like an assignment,<p>so if you are trying to remember what order the arguments to strcpy go, it's<p><pre><code> strcpy(x,y) is like x = y
</code></pre>
Then remember specially that typedef is the wrong way around to the way you would like it to be :)
For the right-hand rule, a vile insult: take the cross-product of the thumb and forefinger of your right hand and rotate on it.<p>Look, Joshua Foer says that emotional imagery is more likely to stick...
I don't use mnemonics in general. For me the effort to remember the mnemonic is actually double that for remembering the thing per se. I need to once remember the symbols->mnemonic connection and then the mnemonic->meaning connection, instead of simply the direct symbols->meaning one. It feels like cluttering my brain with junk that not only doesn't make it easier to remember things, it actively makes it harder.