Just reading all of this (I haven't used ligatures when coding), but the confusion between a ligature of >= and the Unicode ≥ (U+2265) could be handled by the language parser accepting either to mean "greater than or equal to". Would moving beyond ASCII be that much of a stretch for modern languages?
Modern languages do have unicode operators. See for example Julia[1] and Raku[2] [1] https://docs.julialang.org/en/v1/manual/mathematical-operati... [2] https://docs.raku.org/language/operators.html
Ligatures in programming fonts: hell no (2019)
61–70 of 201 posts
Re: Ligatures in programming fonts: hell no (2019)
#62Re: Ligatures in programming fonts: hell no (2019)
#63Unicode is an encoding tool, fonts are a display tool.
And just because the right symbol happens to be available in unicode doesn't mean it's right or easy to use it in every context ; especially when writing a compiler or when writing code. Who wants to have to write ≠ in their code dozens of time a day, without a keyboard made for this?
Fonts exist just for that: decide what the encoded text you have should look like. They are not competing with encoding, they're complementing it. Different fonts exist because people have different opinions about what's best for them to read.
The second point that is raised is a matter of tradeoffs and personal taste. If someone feels like seeing ≠ instead of /= or != in a given context is worth a surprise once a year, who am I to say they're wrong? It's not like I have to use their font, or like they can't use different fonts for different situations.
Re: Ligatures in programming fonts: hell no (2019)
#64Just reading all of this (I haven't used ligatures when coding), but the confusion between a ligature of >= and the Unicode ≥ (U+2265) could be handled by the language parser accepting either to mean "greater than or equal to". Would moving beyond ASCII be that much of a stretch for modern languages?
Most modern languages already use Unicode for variable names and such. But why would you want to type a Unicode lte/gte character? I’m sure it’s not that hard on a Mac keyboard, but can’t be easier than <=
Re: Ligatures in programming fonts: hell no (2019)
#65Just reading all of this (I haven't used ligatures when coding), but the confusion between a ligature of >= and the Unicode ≥ (U+2265) could be handled by the language parser accepting either to mean "greater than or equal to". Would moving beyond ASCII be that much of a stretch for modern languages?
help?> ≥
"≥" can be typed by \ge
search: ≥
>=(x, y)
≥(x,y)
Greater-than-or-equals comparison operator. Falls back to y 'a' >= 'b'
false
julia> 7 ≥ 7 ≥ 3
trueRe: Ligatures in programming fonts: hell no (2019)
#66Earlier quoted context omitted.
Modern languages do have unicode operators. See for example Julia[1] and Raku[2] [1] https://docs.julialang.org/en/v1/manual/mathematical-operati... [2] https://docs.raku.org/language/operators.html
Note that the Raku Programming Language has pure ASCII equivalents for all operators as well, for the Unicode challenged. E.g. ≠ vs !=, ≤ vs = etc. etc.
Re: Ligatures in programming fonts: hell no (2019)
#67I have absolutely no idea how many people might share print screens of their code, and how often some beast looking at these images might, because of that, find a way to discover how to type a similar looking symbol in unicode, enter it in their editor, and compile it without error, therefore introducing a subtle bug. Luckily I rarely share my code through pdf, but mostly through git. Therefore, that hypothetical bea…
For example, the text spoofer issue can be resolved in the text tools, like having variables with different names can be colored differently (this coloring scheme is better than having color just denote variable even without spoofing as it allows you to catch typos easily) Also you can have zero-width spaces highlighted
Re: Ligatures in programming fonts: hell no (2019)
#68Just reading all of this (I haven't used ligatures when coding), but the confusion between a ligature of >= and the Unicode ≥ (U+2265) could be handled by the language parser accepting either to mean "greater than or equal to". Would moving beyond ASCII be that much of a stretch for modern languages?
I can’t wait for a programming language that considers the strings ">=" and "≥" to be equal.
Unclear if it will ever be ubiquitous, but I'm betting on widespread in a couple decades.
Re: Ligatures in programming fonts: hell no (2019)
#69I mean am I the only one that is browsing with completely disabled JS by default? :-D
More and more sites don't load anything withnout a JS and I'm not talking about advanced apps like Microsoft Office online...
Re: Ligatures in programming fonts: hell no (2019)
#70I gotta say I’m a little tired of using * for multiplication. It’s time for programming languages that use Unicode characters for operators, and let the editor replace != with the Unicode slashed equals character. No ligatures, just operators.
Julia editor plugins let you do that - not an automatic replacement, but you can type the Latex for a symbol and press , for eg. `\ne` to get `≠`.
I suppose there could be an automatic-replacement mode, for those that have exact ASCII equivalents. So that, for eg., the editor replacing `!=` in your code with `≠` doesn't affect anyone else, because they're exactly equivalent and others can continue using `!=` if they prefer that.