TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

What coding mnemonics do you use?

27 pointsby vickytnzalmost 12 years ago
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++).

19 comments

MichaelAzaalmost 12 years ago
Not a mnemonic per se but I have melodies for common code snippets.<p>&quot;public static void Main(string[] args)&quot;, 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.
评论 #6172069 未加载
评论 #6172333 未加载
Terrettaalmost 12 years ago
Markdown hyperlink syntax:<p><pre><code> &quot;squared circle&quot; aka []() aka [word](http:&#x2F;&#x2F;link)</code></pre>
hill79almost 12 years ago
I never remember that . = class and # = id in CSS, so I use &quot;say no to drugs&quot; to remember that &quot;hash is not class&quot;.<p>Perhaps a mnemonic which only really works in the North East of the UK where &#x27;class&#x27; is colloquial slang for &#x27;good&#x27;. Also not very good if you smoke pot, I guess.
评论 #6175815 未加载
评论 #6208045 未加载
评论 #6172234 未加载
评论 #6172039 未加载
ronaldxalmost 12 years ago
The fact that programmers can&#x27;t remember &lt; and &gt; well illustrates why children shouldn&#x27;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 &lt; as &#x27;is less than&#x27;
评论 #6175422 未加载
评论 #6172245 未加载
评论 #6172575 未加载
评论 #6172251 未加载
评论 #6172378 未加载
jentulmanalmost 12 years ago
LoVe HAte when ordering psudeo classes in css for anchors*<p><pre><code> &quot;:link, :visited, :hover, :active&quot; </code></pre> *may not be particularly weird or novel
评论 #6172357 未加载
评论 #6172243 未加载
anotherhuealmost 12 years ago
Questionably coding, but I always loved this IRC snippet:<p>&lt;sdmkun&gt; tar -xzf merc.tgz what the fuck<p>&lt;sdmkun&gt; how the fuck do you people remember this shit<p>&lt;bucketmouse&gt; just think with a german accent<p>&lt;bucketmouse&gt; XTRACT ZE FILES
评论 #6175287 未加载
评论 #6176538 未加载
billb2112almost 12 years ago
I was taught the alligator&#x2F;crocodile thing like many others, but it never really stuck. For some reason (later in life), someone said &quot;left hand, less than&quot; 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&#x27;t sink in easily until Jon Skeet said pretend the ? is indeed a question. If the answer is &#x27;yes&#x27;, this will happen.
raverbashingalmost 12 years ago
Not related to programming but close<p>The symbol for a diode is something like this: --|&gt;|--<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
da02almost 12 years ago
.unshift - makes it bigger. Longer word than .shift<p>.shift - makes it smaller. Shorter word than .unshift
评论 #6172249 未加载
chriswaughalmost 12 years ago
When working with axis - &quot;X is a-cross&quot;
评论 #6174149 未加载
评论 #6172183 未加载
评论 #6172252 未加载
评论 #6172616 未加载
pwgalmost 12 years ago
You might try a visual trick. Note that &lt; and &gt; look like &quot;arrows&quot; and &quot;point&quot; in a particular direction. There is a small end (the tip&#x2F;point) and a large end (the open end). The vertical size of the point is &quot;less than&quot; the vertical size of open end. So if the point comes first (reading left to right) then the point is &quot;less than&quot; the opening (and the symbol means &quot;less than&quot;), but if the opening comes first (reading left to right), the opening is &quot;greater than&quot; the point (and the symbol means &quot;greater than&quot;). .
评论 #6172015 未加载
评论 #6171923 未加载
评论 #6172100 未加载
评论 #6172078 未加载
评论 #6172201 未加载
评论 #6172128 未加载
PaulHoulealmost 12 years ago
&lt; and &gt; are pretty easy. The big side (the mouth) points to the larger number because that it what it wants to eat.
评论 #6172202 未加载
评论 #6172287 未加载
CJeffersonalmost 12 years ago
Most methods in C read like an assignment,<p>so if you are trying to remember what order the arguments to strcpy go, it&#x27;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 :)
评论 #6175276 未加载
ChristianMarksalmost 12 years ago
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...
anonymousalmost 12 years ago
I don&#x27;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-&gt;mnemonic connection and then the mnemonic-&gt;meaning connection, instead of simply the direct symbols-&gt;meaning one. It feels like cluttering my brain with junk that not only doesn&#x27;t make it easier to remember things, it actively makes it harder.
burgeralarmalmost 12 years ago
When using ln to link files, I tend to recite:<p>ln -s &quot;what you want,&quot; &quot;where you want it&quot;
评论 #6175767 未加载
评论 #6176520 未加载
3minus1almost 12 years ago
backslash is a man falling backwards. forwardslash is the opposite.
Joeboyalmost 12 years ago
&quot;dollar hat, dollar at&quot; in Makefiles:<p>$(CC) -c $^ -o $@
leigh_talmost 12 years ago
\r\n or \n\r?<p>ReturN - R before N
评论 #6227932 未加载