Unicode tricks in pull requests: Do review tools warn us? (semanticdiff.com)
from DarkPlayer@lemmy.world to programming@programming.dev on 19 Dec 2023 01:43
https://lemmy.world/post/9734720

#programming

threaded - newest

snowe@programming.dev on 19 Dec 2023 06:37 next collapse

Website really struggled on mobile. Anytime I swipe to view the longer code lines in the code blocks it would open the sidebar. Very annoying.

superbirra@lemmy.world on 19 Dec 2023 08:30 next collapse

yeah I also hated it

[deleted] on 19 Dec 2023 14:24 next collapse

.

ReluctantMuskrat@lemmy.world on 19 Dec 2023 21:49 collapse

Had no trouble here on mobile.

superbirra@lemmy.world on 20 Dec 2023 07:20 collapse

thank you for letting us know? :)

hh93@lemm.ee on 19 Dec 2023 06:41 next collapse

Very interesting read

monk@lemmy.unboiled.info on 19 Dec 2023 07:47 next collapse

Homoglyphs? Invisible text? Bidirectional text? Just highlight every line that goes beyond ASCII with yellow warning colors and require to vet it. Maybe make localization data an exception.

actual_patience@programming.dev on 19 Dec 2023 10:48 next collapse

Very simple solution actually. Here I was thinking we’d need AI to solve it.

DudeDudenson@lemmings.world on 19 Dec 2023 12:12 next collapse

People would call that solution AI these days. If it has at least one if statement then they call it AI

slacktoid@lemmy.ml on 19 Dec 2023 20:58 collapse

We say we have AI to get VC funding

cbarrick@lemmy.world on 19 Dec 2023 14:01 next collapse

This doesn’t work for code bases written in non-English languages. Especially east asian languages.

Any line containing an identifier that is also a word would be highlighted.

More and more programming languages are supporting unicode identifiers for this use case.

[deleted] on 19 Dec 2023 14:22 next collapse

.

mrkite@programming.dev on 19 Dec 2023 20:05 next collapse

So it won’t work for 0.0001% of all github projects.

sndrtj@feddit.nl on 20 Dec 2023 08:31 next collapse

I’d suggest to have the occasional look at the “most popular repos” ranking. It’s about 50% Chinese.

Super-interesting sometimes as it shows completely different tech trends.

cbarrick@lemmy.world on 21 Dec 2023 15:14 collapse

I know right.

It’s wild that an American company primarily doing business in the West would have a bias towards English.

monk@lemmy.unboiled.info on 19 Dec 2023 22:15 collapse

Yeah, just don’t. Allowing to code in anything other than English is a disservice, plain and simple.

Inb4, I’m not being US-centric, Latin ain’t even my native alphabet.

arthur@lemmy.zip on 19 Dec 2023 12:32 collapse

Or the non-ascii character itself.

ck_@discuss.tchncs.de on 19 Dec 2023 15:55 collapse

TL;DR: you could adopt good programming practices like “don’t shadow mutable state” and “put constants first in a comparison” or you can pay us money so we show you obscure attempts to exploit your bad programming in code review … maybe …