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.
What coding mnemonics do you use?
41–50 of 88 posts
Re: What coding mnemonics do you use?
#42I 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.
Strange one. FYI, "class" has the same meaning in French slang -- probably borrowed from you guys.
I didn't know for sure, but I had that feeling knowing that most of the English language is borrowed from others, and not the other way around. (http://www.etymonline.com/index.php?allowed_in_frame=0&searc...)
Re: What coding mnemonics do you use?
#43Earlier quoted context omitted.
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?
#44ln -s "what you want," "where you want it"
Re: What coding mnemonics do you use?
#45Not a mnemonic per se but I have melodies for common code snippets. "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.
Re: What coding mnemonics do you use?
#46LoVe HAte when ordering psudeo classes in css for anchors* ":link, :visited, :hover, :active" *may not be particularly weird or novel
margin: (T R B L)Re: What coding mnemonics do you use?
#47The 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?
#48The 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've always thought it's because of carelessness
Re: What coding mnemonics do you use?
#49Earlier quoted context omitted.
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.
When little, my brother used to mix up the words "more" and "less" while speaking. I don't doubt someone could mix up > and <.