Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

The article really was entertaining. These are all common problems for new C# programmers.

Doubles in .net are IEEE 64-bit (8-byte) double-precision floating-point numbers . I've written a few different comparers to deal with problems like the one he demoed. He should have typed it to be a decimal if it was currency or he wanted it to have an exact value instead of be a double-precision floating-point number.

As for the reverse on the string. He reversed the characters, which are defined in .net as char / byte. Not unicode. If you want to play nice with unicode in .net you need to parse it as unicode. A hugely common mistake for all of us who have done some internationalization in .net.

I remember or sorts of trouble with java.util.GregorianCalendar back in the day. Ugh.

I'm not defending .net or C#. I'm just not surprised he ran into these newbie problems. You guys should see the evilness that is Access, the inconsistencies there make this look like nothing. And it's a black art with almost no documentation anywhere.



Jon didn't run into most of these problems so much as answer others who did run into them on stackoverflow.com or the MS newsgroups.


> You guys should see the evilness that is Access, the inconsistencies there make this look like nothing. And it's a black art with almost no documentation anywhere.

Are you talking about MS Access? It's about 15 years old. There should be a lot of documentation. You need to look for old books form the last decade though.




Consider applying for YC's Winter 2027 batch! Applications are open till November 2.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: