4 ms·
I guess someone should develop an IDE/editor plugin that marks non-ASCII characters outside of string literals.
by rbinv 11y ago
I guess someone should develop an IDE/editor plugin that marks non-ASCII characters outside of string literals.
- lazyjones 11y ago> marks non-ASCII characters outside of string literals. Many programming languages support non-ASCII variable name characters now.
- rbinv 11y agoGood point, didn't consider that. Although any good IDE/editor should catch the use of "undeclared" variables and functions.
- TorKlingberg 11y ago> Many programming languages support non-ASCII variable name characters now. Just because you can do something doesn't mean you should. It is usually worth keeping variable names and such in English in enable international collaboration. Also non-ASCII source files can get mangled in transit.
- kuschku 11y agoWell, it does happen, though – look at this weather data from a large German newspaper, it is in a custom format ('|' separated values) and in German: http://wetter.bild.de/data/meinwetter.txt http://wetter.bild.de/data/meinwetter.txt It happens all the time, everywhere, that people write code and stuff in their native language.
- Dylan16807 11y agoThat's data. The suggestion is about variable names.
- kuschku 11y agoWell, the variable names of Bild.de (for example HTML class names) are also in German. It happens all the time, everywhere.
- halostatue 11y agoRuby now allows (some) Unicode glyphs as names (allowing for things like Δv). 08:11:32 >> Δv = 3 => 3 08:11:39 >> p Δv 3 => 3 My solution when I have problems like this is to start building a negative regexp in vim: /[^-a-zA-Z0-9 \[\]] I then add other symbols as I find them. I can usually find the illegal characters in about 30 seconds this way—and I can add the non-ASCII glyphs that I expect to be present to my regexp.
- metasean 11y agoJavaScript allows a wide range of Unicode characters - http://stackoverflow.com/a/9337047 http://stackoverflow.com/a/9337047
- archimedespi 11y agoVim plugin: https://github.com/vim-utils/vim-troll-stopper https://github.com/vim-utils/vim-troll-stopper