TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

What coding mnemonics do you use?

27 点作者 vickytnz将近 12 年前
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 条评论

MichaelAza将近 12 年前
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 未加载
Terretta将近 12 年前
Markdown hyperlink syntax:<p><pre><code> &quot;squared circle&quot; aka []() aka [word](http:&#x2F;&#x2F;link)</code></pre>
hill79将近 12 年前
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 未加载
ronaldx将近 12 年前
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 未加载
jentulman将近 12 年前
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 未加载
anotherhue将近 12 年前
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 未加载
billb2112将近 12 年前
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.
raverbashing将近 12 年前
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
da02将近 12 年前
.unshift - makes it bigger. Longer word than .shift<p>.shift - makes it smaller. Shorter word than .unshift
评论 #6172249 未加载
chriswaugh将近 12 年前
When working with axis - &quot;X is a-cross&quot;
评论 #6174149 未加载
评论 #6172183 未加载
评论 #6172252 未加载
评论 #6172616 未加载
pwg将近 12 年前
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 未加载
PaulHoule将近 12 年前
&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 未加载
CJefferson将近 12 年前
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 未加载
ChristianMarks将近 12 年前
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...
anonymous将近 12 年前
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.
burgeralarm将近 12 年前
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 未加载
3minus1将近 12 年前
backslash is a man falling backwards. forwardslash is the opposite.
Joeboy将近 12 年前
&quot;dollar hat, dollar at&quot; in Makefiles:<p>$(CC) -c $^ -o $@
leigh_t将近 12 年前
\r\n or \n\r?<p>ReturN - R before N
评论 #6227932 未加载