Live data from Hacker News

OMG Ponies (Aka Humanity: Epic Fail)

msmvps.com

21–30 of 30 posts

Re: OMG Ponies (Aka Humanity: Epic Fail)

#21
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…

You can get the correct result by normalizing the string first:

    >>> import unicodedata
    >>> print unicodedata.normalize('NFC', u'Les Mise\u0301rables')[::-1]
    selbarésiM seL

Re: OMG Ponies (Aka Humanity: Epic Fail)

#22
post #21
post #9

Earlier quoted context omitted.

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…

You can get the correct result by normalizing the string first: >>> import unicodedata >>> print unicodedata.normalize('NFC', u'Les Mise\u0301rables')[::-1] selbarésiM seL

[deleted]

Re: OMG Ponies (Aka Humanity: Epic Fail)

#23
I saw this presentation at the London DevDays where Jon gave it.

I was quite far back, and when he walked on stage with the sock puppet on, I assumed it was one of those wrist support gloves that you use when you get RSI because you won't just stop typing all day long, even though you're harming yourself.

After all, I thought, it's Jon Skeet - he never stops typing, surely? :-)

Re: OMG Ponies (Aka Humanity: Epic Fail)

#24
post #8

Unicode has its own special line terminator character as well, just for kicks It looks like you're trying to refer to NEL, which is in Unicode because it was distinct in EBCDIC, and who doesn't want lossless round-trips?

Unicode also has separate Line Breaks and Paragraph Breaks somewhere around U+2000.

Re: OMG Ponies (Aka Humanity: Epic Fail)

#25
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…

>a language approaching Haskell's pedantic-ness

I believe the word you're looking for is "pedantry".

/pedant

Re: OMG Ponies (Aka Humanity: Epic Fail)

#26
post #21
post #9

Earlier quoted context omitted.

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…

You can get the correct result by normalizing the string first: >>> import unicodedata >>> print unicodedata.normalize('NFC', u'Les Mise\u0301rables')[::-1] selbarésiM seL

That's in some sense even more broken: Not all combined characters have a normalized form, so the result is even less predictable. (I don't have an example ready.)

Re: OMG Ponies (Aka Humanity: Epic Fail)

#27
post #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.

Yeah, but who expects to need a special library for uppercasing some seemingly Latin text?

Re: OMG Ponies (Aka Humanity: Epic Fail)

#28
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…

Yes, Haskell is not pedantic enough!

Re: OMG Ponies (Aka Humanity: Epic Fail)

#29
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…

> 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.

Re: OMG Ponies (Aka Humanity: Epic Fail)

#30
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…

What you're saying is that people will finally understand that thinking about a problem and preventing bugs before you begin is better than trying to fight fires afterwards.
Post reply on HN