News for hackers. Stuff that matters.
Re:What coding mnemonics do you use? by ronaldx on Wednesday August 07, 2013 @08:14AM (#6172237)
The fact that programmers can't remember < and > 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? by norvig on Wednesday August 07, 2013 @04:33PM (#6175422)
When I was in grad school a friend in another department said "You guys in CS have much nicer printers; can I mail you my thesis and have you print it out? And how would I mail it?" I said "Sure; Just do 'mail [email protected] less-than-symbol filename". Later he calls in a panic -- "my thesis file has disappeared! I did what you said ... oh, wait a minute, I might have done greater-than instead of less-than..."

Fortunately for both of us, he had been diligent about making backups and din't lose his entire thesis.

Re:What coding mnemonics do you use? by afandian on Wednesday August 07, 2013 @08:16AM (#6172245)
I find it hard to believe that a statistically normal programmer mixes up < and >. That sounds more like dyslexia.
Re:What coding mnemonics do you use? by yogo on Wednesday August 07, 2013 @09:03AM (#6172486)
This is the first time I'm hearing about this too so I think there is more to it. I don't even see why a mnemonic is required since the shape of both '<' and '>' clearly demonstrate the relationship that the operator is testing.
Re:What coding mnemonics do you use? by vickytnz on Wednesday August 07, 2013 @05:31PM (#6175796)
I probably should have chosen a better mnemonic to start from! I'd point out that if you see greater and less than more like arrows it's utterly confusing. I'm not denying I'm probably weird in that respect, it's just something I have to use tricks to remember….
Re:What coding mnemonics do you use? by inthewind on Friday August 16, 2013 @04:30AM (#6222808)
Also a lot of people have trouble with the back and forward slashes. When teaching html, people got the closing slash mixed up, it was all over the place.
Re:What coding mnemonics do you use? by ronaldx on Wednesday August 07, 2013 @08:19AM (#6172257)
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 < and > wrong.

Re:What coding mnemonics do you use? by karka91 on Wednesday August 07, 2013 @08:25AM (#6172282)
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? by anonymous on Wednesday August 07, 2013 @08:53AM (#6172416)
Ah, yes the "I can't fit it to my mental model, therefore it is impossible" argument.

When little, my brother used to mix up the words "more" and "less" while speaking. I don't doubt someone could mix up > and <.

Re:What coding mnemonics do you use? by Chris2048 on Wednesday August 07, 2013 @01:18PM (#6174128)
It's easy. They're alligator mouths, that always go for the larger number (greedy alligators!)...
Re:What coding mnemonics do you use? by ronaldx on Wednesday August 07, 2013 @08:46PM (#6176674)
This genuinely confused me because I thought the larger number would eat the smaller number.
Re:What coding mnemonics do you use? by Chris2048 on Wednesday August 14, 2013 @05:53PM (#6214567)
The alligator is just the symbol, ignoring the smaller number completely.
Re:What coding mnemonics do you use? by blablabla123 on Wednesday August 07, 2013 @09:52AM (#6172786)
I used to mix it up in elementary school because the school teacher explained that "<" is "less" and ">" is "more". Even worse, she suggested to memorize it like this: |<leiner = kleiner (german, meaning less)

At some point I realized it's possible to memorize it visually, since then I never mixed it up again

Re:What coding mnemonics do you use? by inthewind on Friday August 16, 2013 @04:33AM (#6222816)
Yeah people frequently mix up left and right also. And my brother always wrote his numbers backwards or rather left to right (units on the left).
Re:What coding mnemonics do you use? by taejo on Wednesday August 07, 2013 @08:34AM (#6172323)
I remember several kids in my class having great difficulty with < and > when they were first introduced. I can well imagine many of them just decided it was impossible and gave up.
Re:What coding mnemonics do you use? by PeterisP on Wednesday August 07, 2013 @03:53PM (#6175172)
Was it possible to give up? In my place, they wouldn't be let on to the next grade if they'd fail basic math - i.e., they'd spend the summer repeating it + an extra year in the same grade if that wasn't enough; so it would have to be a real exception to see a 10 year old who can't somehow manage that.

Anyways, the classic mnemonic for that was simple - for < and > the wide part contains more 'thingies' than the narrow part. They're actually taught before numbers or together with numbers, like [pic of four strawberries] > [pic of three strawberries].

Re:What coding mnemonics do you use? by vickytnz on Wednesday August 07, 2013 @05:28PM (#6175771)
I was taught the crocodile thing, but had real issues with it: I can think it through but it's not fast. I'm pretty much ambidexterous (i.e. write with left and catch a ball with my right) so while I can do quite a lot of things with both hands I also have problems with left and right!
Re:What coding mnemonics do you use? by thedudemabry on Friday August 09, 2013 @02:22AM (#6184033)
I've known a few otherwise non-dyslexic programmers that have had this issue. One guy kept a sticky note on his monitor with "> Greater, < Less" written on it.
Re:What coding mnemonics do you use? by afandian on Friday August 16, 2013 @06:12AM (#6223118)
I find that really fascinating. Was it just those things? What about which paren (or brace) opens and which one closes? (I'm not being facetious!)
Re:What coding mnemonics do you use? by kelvich on Wednesday August 07, 2013 @09:17AM (#6172575)
Teacher in elementary school taught me simple rule: signs < and > has two endings on one side and one ending (corner) on another. So two bigger than one and bigger number should be on side with two endings.
Re:What coding mnemonics do you use? by rwbcxrz on Wednesday August 14, 2013 @09:50AM (#6211447)
Mine taught us that it was an alligator, and it always wanted to eat the bigger number.
Re:What coding mnemonics do you use? by llcoolv on Wednesday August 07, 2013 @08:17AM (#6172251)
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? by milliams on Wednesday August 07, 2013 @08:44AM (#6172374)
Yeah, the smaller end of the triangle is the smaller number and the wider end is the larger number.
Re:What coding mnemonics do you use? by chewxy on Wednesday August 07, 2013 @08:45AM (#6172378)
Interesting. So other people too do get it mixed up. Makes me feel less silly when I find bits of my own code that looks like `x := >- receiverChannel`

I've always thought it's because of carelessness