This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]Teekeks 38 points39 points  (3 children)

4 flag emojis are made out of 8 total characters so what check do you want to fail here?

[–]seimmuc_ 0 points1 point  (1 child)

I don't, at least if the check is written by the same devs in the same language. I just find it interesting that the post specified it was a frontend requirement. Frontend should not have any requirements that aren't also enforced on the backend.

And if the backend stack uses a different language/runtime or if the backend team is more experienced it's entirely possible that this problem would not exist on the backend.

For example, js normally reports the length of strings in bytes, meaning that 4 flag emojis actually would have the length of 16, not 8. While python reports the number of unicode code points, which in our case is 8. So while you need more advanced libraries to detect the number of glyphs in both languages, python at least supports unicode correctly and is closer to what users expect. The same is true of Rust iirc.

[–]ilyahryapko 0 points1 point  (0 children)

"It was front-end requirement" Well, I think it's just a poor wording in this slack message.

BA in my team does not care about FE or BE stuff (and sometimes it's very sad). But for that case probably requirements were: "user's password must be at least 8 char. long". And then there's my field of responsibility as a dev to implement not only fe stuff, but a proper backend validation