Live data from Hacker News

I couldn't debug the code because of my name

mikolaj-kaminski.com

291–300 of 300 posts

Re: I couldn't debug the code because of my name

#291

Earlier quoted context omitted.

"The right thing" for filesystem entries is transparently copy, do not evaluate. A file path is a mem-copied, length value sized block of identifier you don't ever mangle. If you must mangle it, touch only the necessary areas as directed. (E.G. join with os.pathsep and do not normalize anything). Want to offer Unicode validation? Sure having that as an OPTION is fine. Forcing it means I can't rely on that tool to han…

That the beauty of it with python: - if you want to treat paths like unicode strings, you can. Which is great for simple scripts where you don't want to deal with complexity. And 99% of the time, it's enough with modern OSes. - if you want to threat path as bags of raw bytes, you can. Which is necessary to transparently copy and do not evaluate, as you said, for covering edge cases. - if you need to actually deal wit…

Where does that filepath come from? A config file; are you going to do your text processing, and interaction, with other modules in byte[] arrays in Python 3+?

Python 2's unicode model was _closer_ to correct, the trivial coercion between byte[] and Unicode.

Conversion also shouldn't imply, force, or check Validation nor Normalization. Labeling a bytestream with an Encoding and validating / normalizing that encoding should be options. Operations on bytestreams with encoding related attributes should set them to either 'unknown' result or to a proper output type if they're aware the manipulations will still yield a valid encoding.

Normalization is more complex, since Unicode strings can be normalized in different ways, then combined, and still be a valid string but no longer uniformly normalized.

Re: I couldn't debug the code because of my name

#292

Earlier quoted context omitted.

JetBrains is generating an invalid YAML file, which are UTF-8. If they were using a decent YAML library, it would have crashed at that point. And firmly pointed the finger at the real bug, reading raw bytes from the environment or a .properties file parser and assuming it is valid UTF-8. And this is why you always validate your data when you slurp it in, or else you pass crap down several layers where it crashes or m…

I'd expect a decent YAML library to have functions taking UTF-8 and not wasting time verifying that the data passed is actually UTF-8 in release builds.

You generally don't verify on output, because you verified on input (especially with languages where text strings are Unicode or UTF-8 byte strings like Python3 or Rust). But it would also be a premature optimization when it does make sense to check. For expected YAML use cases I doubt it would be a measurable difference in runtime. And it has to inspect the strings in any case to correctly quote things and deal with indentation if there are newlines.

Re: I couldn't debug the code because of my name

#293
post #105
post #94

Earlier quoted context omitted.

I used a system where the maximum length on the "new password" field in the change password form was longer than the password field in the login form. The symptom was that I could login if I used my password manager browser plugin, but not if I pasted it from my password manager.

I maintained a system where we had unbounded password length... but only respected the first six characters of the password. (we did fix that).

Sounds like some banks I’ve heard of.

Re: I couldn't debug the code because of my name

#294

Earlier quoted context omitted.

I disagree that having localization for number formatting based on a system setting by default makes sense. Formatted numbers are needed for both human and machine consumption and only one of those can deal with unexpected formatting.

Maybe the galaxy-brain design principle is: if you're designing an API, make sure that where possible bugs occur in an area where programmers care about fixing them (data I/O) rather than somewhere that they neglect (user interface localisation). Voila: better software!

Except programmers test with their own locale and everything works there. Then the user gets an obscure error that the programmer is not able to reproduce because on their system a number from some internal config file was parsed incorrectly.

Re: I couldn't debug the code because of my name

#295
post #77

Earlier quoted context omitted.

I think it's reasonable to find that morally objectionable: English is the only language* that can be fully represented in ASCII, so pretending that ASCII is all you need excludes a large part of the world. * yes, by and large. Many languages make do, but even the European languages that use the same script as English cannot be fully represented: - Pretty much all mainland European languages use accents (simple examp…

It's naïve of you to maintain the façade that English can be fully represented in ASCII. We've just had longer than other languages to adapt to that particular encoding technology, and the good luck to have a code set built to represent our language become the lingua franca of computer technology.

A single example is worth more than a thousand slights.

Re: I couldn't debug the code because of my name

#296
post #65

Isn't it bizarre that we have self-driving cars, the ISS, and phones with 50 megapixel cameras but still struggle with character encoding?

for self driving cars, ISS and digital cameras everything you do is blurry in a sense, "good enough" approximation is actually good enough while character encoding and transformations have to be done perfectly and precisely and have surprisingly big number of edge cases

Re: I couldn't debug the code because of my name

#297

Earlier quoted context omitted.

I'm really surprised someone technically minded thought it's a good idea to put a non ASCII character in their username. I'd never do that.

There's nothing special about a username vs any other string. If there is, that is a problem.

Since identifiers like usernames are seen by people they are susceptible to homograph attack and _do_ deserve to be treated a bit more carefully. Also you probably dont want usernames like ń̸̡͍̲̲̫̰̦̔͛̋̉͊̔̈̈̈́̀͑͘i̶̜̔̐̅̔̑̈̕͝͝g̶̢̭̮̲͕͉͔͙̳̥͖̉̏̇̎̊̈́̊̆̃̎̑͆̿͠ͅh̶̡̛̪͔̯̯͈̼̿͊̂̍͐͒͐͐̆̽͛̄̽͝t̸̛͔̮̆͊̋́̑̓̅̀̆͋̕ͅf̸̤̗̺̣̤̝̟̱͎̦̀͒̽̓̋̏͌͋̇͛ͅḷ̶̭̓̿́y̵͍̦̫̫̠͆͛͋̓͑͑͋̔͑́̔̽̚̚

Re: I couldn't debug the code because of my name

#298
post #149

Earlier quoted context omitted.

"If you wanna change". I think we have found the disconnect: you quite happily use a word like "wanna" which is nonsense in English. Its allowed because it is understandable. Wanna is "want to". Ooh, "gonna": That'll be "going to". What's gonna to you is l bar for me or vice versa or something 8)

This post is a good reminder to never fall for “I don't want to cause offense, I want to understand the causes of difference.” again.

I apologise for that comment. Too much wine was involved. Sorry.

Re: I couldn't debug the code because of my name

#299

Earlier quoted context omitted.

I do find this sort of stuff fascinating and also faintly frustrating but of course my mother tongue is (in)famous for being a bit loose at first sight. According to one of my employees (Polish) Ł sounds roughly like w as in win or water but not as in what. A quick read of this: https://en.wikipedia.org/wiki/%C5%81 doesn't help too much. Does enforcing Ł instead of say w cause your written language to fail in some wa…

I think I just learned that some dialects/accents don't pronounce the w in water and the w in what the same way. What's the difference?

What can be pronounced as "wot" or something like "hwot". I can't recall the technical term.

Re: I couldn't debug the code because of my name

#300

I can very much relate to this but also have very little sympathy here. I have a special character in my name, an apostrophe, and it causes trouble regularly online and with tooling. A number of years ago I decided just to never use it when it came to anything to do with technical work be it email, logins or usernames. Unicode characters are a pain to deal with and I have suffered from it first hand trying to handle…

I can relate, mine is O'Rourke and even in 2021 I get: - websites telling me I have an invalid name - post addressed to O'Rourke, O\\\Rourke, O&Rourke - "my account" pages say "Welcome, Mr O\Rourke"

The best one I have every seen is O\apostropheRourke for a car rental in France. I have no idea how they thought that was a good idea!
Post reply on HN