Earlier quoted context omitted.
If your syntax highlighting is wrong, it's buggy. Proper syntax highlighting is 100% correct.
Correct syntax highlighting is subjective, because color selection is a matter of taste.
Ligatures in programming fonts
51–60 of 87 posts
Re: Ligatures in programming fonts
#52The author's point about "dumb" ligatures doesn't really hold up: While the "fi" ligature will always mean "f followed by i" its use is not always correct. For example, in German compound nouns, you do not set a ligature between the two nouns. For instance, "Kaufläche" (Kau: chewing, + Fläche: area) should be written with ligature, while in "Kaufleute" (Kauf: purchase, + Leute: people, = merchants) the ligature shoul…
Re: Ligatures in programming fonts
#53The first problem isn't really a problem, since ligatures are provided by fonts, not character encodings. From the Unicode FAQ on ligatures and digraphs ( http://unicode.org/faq/ligature_digraph.html ): "The existing ligatures exist basically for compatibility and round-tripping with non-Unicode character sets. Their use is discouraged. No more will be encoded in any circumstances. "Ligaturing is a behavior encoded i…
All in all though, this is a purely local dev preference matter - your editor ligature settings never affect the committed code, so neither are really a problem in practice.
Re: Ligatures in programming fonts
#54The author's point about "dumb" ligatures doesn't really hold up: While the "fi" ligature will always mean "f followed by i" its use is not always correct. For example, in German compound nouns, you do not set a ligature between the two nouns. For instance, "Kaufläche" (Kau: chewing, + Fläche: area) should be written with ligature, while in "Kaufleute" (Kauf: purchase, + Leute: people, = merchants) the ligature shoul…
Re: Ligatures in programming fonts
#55I work with someone who uses ligatures. Everytime I need to see his screen is a problem, I can never recognize what exactly the characters mean. Yes, you get used to it if you use it, but if you don't, working with other people becomes a problem. I thought it was a bad idea the first time I saw it, and after seeing it in real code I still think the same thing.
But, you know, others didn't like my emacs setup, they says that its hard to read in such small sizes, and my color theme with dark background is bad for their eyes. Strange people, what on earth make them think, that I should be considering their eyes health while choosing font and color theme for myself?
Re: Ligatures in programming fonts
#56The article lists a bunch of non-issues. Yes, you can create confusion by abusing unicode. But that's not new. C++ allows zero width spaces in identifiers. There's a guy on reddit who uses characters from Canadian Aboriginal Syllabics block to have angle braces in Go identifiers. Yes, they are guaranteed to be wrong sometimes. The big one is the But it's incredibly obvious when they are wrong. So it's not an issue in…
I gifted that guy gold for the sheer audacity of the thing.
Re: Ligatures in programming fonts
#57Honestly, this sounds like the kind of argument you could present about how syntax highlighting is a terrible idea. It might be wrong! I don't use ligatures, but I really don't see a problem with other people using them. It's fine, it's a style preference thing, that, like fonts and colour schemes, is as much fashion and personal preference as it is anything. But it's fine.
If your syntax highlighting is wrong, it's buggy. Proper syntax highlighting is 100% correct.
For example, in C, what highlight category do you give to '*c'? A declaration, a dereference, or a multiplication call?
In Lisp, is the first element of a list a macro or a function (or a value)? If there's a reader macro, it gets even harder.
Re: Ligatures in programming fonts
#58The author's point about "dumb" ligatures doesn't really hold up: While the "fi" ligature will always mean "f followed by i" its use is not always correct. For example, in German compound nouns, you do not set a ligature between the two nouns. For instance, "Kaufläche" (Kau: chewing, + Fläche: area) should be written with ligature, while in "Kaufleute" (Kauf: purchase, + Leute: people, = merchants) the ligature shoul…
Are there any font specifications that allow for this kind of distinction?
Re: Ligatures in programming fonts
#59Honestly, this sounds like the kind of argument you could present about how syntax highlighting is a terrible idea. It might be wrong! I don't use ligatures, but I really don't see a problem with other people using them. It's fine, it's a style preference thing, that, like fonts and colour schemes, is as much fashion and personal preference as it is anything. But it's fine.
Syntax highlighting without context is not really a good experience. The highlighter needs to know what language you're using, and a pretty good idea of how to parse it.
And the comment on ligatures below points out, this is actually true of ligatures for human languages as well, but I doubt the font engines are properly tuned for that either. I'd make an exception for the 'obvious' ligatures like gg gy etc where the descenders were overlapping without a ligature. That shouldn't be an issue in a monospaced context though.
Re: Ligatures in programming fonts
#60Earlier quoted context omitted.
The fact that they go on disk is a pro, not a con; and the fact that they're one character not multiple is also a pro and a not a con: what's the point of the individual characters? Those were merely introduces as a necessary workaround to cope with input limitations. Kind of like C trigraphs - and nobody uses those because they want to.
Unicode is a disadvantage for someone who wants to contribute to your code. That person now has to figure out how to write down Unicode arrows, taking her/him out of her/his flow.