Live data from Hacker News

OMG Ponies (Aka Humanity: Epic Fail)

msmvps.com

11–20 of 30 posts

Re: OMG Ponies (Aka Humanity: Epic Fail)

#11
With every passing year, I'm more and more convinced a language approaching Haskell's pedantic-ness is A Good Thing. A language where Joda is the most convenient option, where all numerical quantities have units, and you have to make an explicit option to do "unsafe" things. Naturally, the goal of the language is to do as few unsafe operations as possible.

I think lisp is a good example: Most lisps have a full numeric tower that automatically converts between ints and bignums and ratios as appropriate. You don't have to think about the floating-point representation of 0.3 unless you wrote (double 0.3) in your code somewhere. Correctness should be the default, because it's much easier to trade some correctness for performance. Going the other way is much harder, and most people don't need performance.

This goes a long way, but now I notice the biggest obstacle is "legacy systems". The only time I get in trouble with the Clojure numeric tower is when I want to store a Ratio in the DB.

Re: OMG Ponies (Aka Humanity: Epic Fail)

#12
post #11

With every passing year, I'm more and more convinced a language approaching Haskell's pedantic-ness is A Good Thing. A language where Joda is the most convenient option, where all numerical quantities have units, and you have to make an explicit option to do "unsafe" things. Naturally, the goal of the language is to do as few unsafe operations as possible. I think lisp is a good example: Most lisps have a full numeri…

Can we get significant digit support too? That would make my life a happier place.

edit: the joke about the horse mispelling "main()" by force of habit made me chuckle.

Re: OMG Ponies (Aka Humanity: Epic Fail)

#13
post #10

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…

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.

Re: OMG Ponies (Aka Humanity: Epic Fail)

#14
post #9
post #3

It's important to note that choice of language affects a lot of these issues. For example, the unicode issue in Python: >>> s = unicode('Les Misérables','utf-8') >>> print s[::-1] selbarésiM seL

Nope, Python fucks this up just the same, even in Python 3: >>> print u'Les Mise\u0301rables'[::-1] #2 >>> print('Les Mise\u0301rables'[::-1]) #3 selbaŕesiM seL Almost no implementation will fuck up LATIN SMALL LETTER E WITH ACUTE U+00E9, but nearly all programming languages will royally fuck up a COMBINING ACUTE ACCENT U+0301 even in much easier cases like string length. Almost all implementations that claim to be U…

Here’s a good series of articles on how it works in Ruby: http://blog.grayproductions.net/categories/character_encodin...

Apparently Ruby 1.9 handles it well.

(I wouldn’t be surprised if this had previously been linked on HN.)

Re: OMG Ponies (Aka Humanity: Epic Fail)

#15
post #6
post #3

It's important to note that choice of language affects a lot of these issues. For example, the unicode issue in Python: >>> s = unicode('Les Misérables','utf-8') >>> print s[::-1] selbarésiM seL

I think the s is round the wrong way.

and the grave should be an acute.

Re: OMG Ponies (Aka Humanity: Epic Fail)

#19
I'm embarrassed. I admit it, I forgot Turkish upcases 'i' to İ. But the core teaching, which is "if it involves internationalization or talking to humans find a library written by a legitimate expert and use it instead" is true gold.
Post reply on HN