17 ms·
Ligatures in programming fonts: hell no (2019)
- pletnes 5y agoThis reminds me of discussions with older Fortran programmers who argue for ALL CAPS ALWAYS. I guess ligatures are fine by me, I use them and have not been bitten. Editors should rather focus on showing whitespace somehow, I have been bitten by tab/space/CRLF many times!
- bee_rider 5y agoSpeaking of fortran, one thing that annoys me in Fira Code actually is that /= renders as some weird thing, rather than "does not equal." And of course it has no chance of understanding .ne. but that's fine. In LaTeX lstlisting you can sometimes get weird little underlines to explicitly show spaces in code. It looks pretty bad! I almost want a font that draws l as a lower case cursive l, although I guess it is probably better not to fix this problem as somebody out there will have a font that mixes them up.
- ARandumGuy 5y agoThis article really irritates me, despite the fact that I broadly agree with the conclusion. The points on Unicode and wrong substitution feel weak, because there's plenty of valid situations where Unicode isn't displayed "correctly," and plenty of situations where the characters displayed don't match they semantic meaning. In my opinion, the main reason to avoid ligatures isn't some big moral issue on "correct meaning" or "properly using Unicode." The main issue is that ligatures can cause confusion if the reader doesn't know the ligature (which is most readers). For what it's worth, I like using font ligatures on my own IDEs. I think they look nice. But I would never choose them for anything displayed for anyone else.
- dkjaudyeqooe 5y agoI don't see a problem at all. If you like ligatures in your code and they work for you, you use them, if not you don't. It's not like they're hard coded somewhere, they're a matter of personal preference, just like spaces/tabs and fixed-width fonts. It's just the author's preference in rant form, nothing more.
- taormina 5y agoThe other thing the author isn't considering is that some of us have UI additions that make my IDE display a ligature, that visually replaces a known set of keystrokes. Now, what I actually typed is still there! It just looks fancy in my code editor.
- michaelcampbell 5y agospaces/tabs ARE hardcoded in your code, but otherwise, yes exactly.
- Ciantic 5y agoThe article is probably written to irritate, whether intentionally or not. While it's easy to accept that ligatures in public code is bad, he still goes on to say: > “What do you mean, it’s not a matter of taste? I like using ligatures when I code.” Great! In so many ways, I don’t care what you do in private. Although I predict you will eventually burn yourself on this hot mess... Also note the ending line: > If you don’t believe me, try it for 10 or 15 years." Well, ligatures has soon been in ten years or more in programming fonts. In many ways, the article has a good point, don't use ligatures in public code. It has second point too, which I think is not true: If you use ligatures, you may write logical bugs by twisted semantics. This is a statement, which would require statistical study on programmers who use ligatures and who doesn't. Do they write more bugs or not? I find some ligatures very helpful for readability, and thus they actually reduce bugs, but it's all in the eye of the reader.
- dkjaudyeqooe 5y agoLigatures are display only. They are not part of any language syntax I know of.
- haolez 5y agoNot exactly related, but wouldn't it be awesome to have a font with ligatures to make J or K programming have the readability benefits of APL? Random thought!
- a4isms 5y agoJust imagine if J or K could be as glorious as this: https://www.youtube.com/watch?v=a9xAKttWgP4 https://www.youtube.com/watch?v=a9xAKttWgP4
- mlochbaum 5y agohttps://wjmn.github.io/posts/j-can-look-like-apl/ https://wjmn.github.io/posts/j-can-look-like-apl/ uses Emacs. Discussed at https://news.ycombinator.com/item?id=20728715 https://news.ycombinator.com/item?id=20728715
- WesolyKubeczek 5y agoLigatures in programming look cute, and maybe if you want to showcase a snippet of some particularly clever and elegant code, print it on some expensive paper with tasteful palette (and none of your CMYK nonsense! Only pure pigments!), frame it, and hang it on the wall, I can see its appeal. At work, I've tried it. I've tried hard to like it. I had to stop because Fira Code (and ligatured Iosevka) took the principle of the least astonishment, threw it on the concrete floor and kept beating it down till it stopped breathing, and then some. I found myself spending time wondering "what characters is this made of?", and "how do I type THAT?" when viewing some existing code, and "WTF is this?" when a ligature that would have likely made sense in Ruby or Haskell (or in APL?) made it into my Perl code. Also, "is this a ligature or some Unicode glyph?" was a question I found myself asking. In a better world, I shouldn't be wondering about it while fixing some integration with one of Intuit's molochs or somesuch. But here I was. Switching to non-ligatured text shed a lot of cognitive burden off me. At least I can tell which thing is ASCII and how I type it. And my code doesn't look as a Guillome Apollinaire's calligramme.
- avgcorrection 5y ago> Also, "is this a ligature or some Unicode glyph?" was a question I found myself asking. In code editors that use monospaced fonts the ligatures will often look nicer since things like Unicode arrows will only take up a single “character space”.
- eyelidlessness 5y agoMany of these ligatured programming fonts look the same way, by shifting the combined characters horizontally into a single width space.
- WorldMaker 5y agoYeah, but that "single width character" is often still in the middle of two widths worth of space. In most environments that should still often be enough of a clue.
- deleted 5y ago[deleted]
- PureParadigm 5y ago> The problem is that ligature substitution is “dumb” in the sense that it only considers whether certain characters appear in a certain order. It’s not aware of the semantic context. In many code editors (even my terminal with fish shell!) this is not true. Ligatures are broken up when the text changes style due to syntax highlighting. Syntax highlighting can consider context, so if there is a mistaken ligature, this can be fixed by changing the syntax highlighting rules.
- dang 5y agoDiscussed at the time: Ligatures in Programming Fonts: Hell No - https://news.ycombinator.com/item?id=19805053 https://news.ycombinator.com/item?id=19805053 - May 2019 (86 comments)
- josefrichter 5y agoNah, ligatures are fine. Most of the time they’re used in situation where we are literally trying to create new character by combining others. Like |>, =>, !=, ===, >=, ~=, etc. The individual characters don’t have semantic value on its own, only the combination does. Then it’s quite fine to display it as one ligature character. What I mean is the meaning of |> is not a combination of meaning of | and meaning of >.
- quelltext 5y agoThat really depends on the programming language. For example {| might be paired with |} as special quotation syntax, at any rate some form of bracket. See, Fira Code has a ligature for those. But in Ruby you'd see one of them in one liner blocks, e.g.: list.map {|x| x*x} Here {| is not a thing that should be combined. It would look really confusing as you'd search in vain for a corresponding closing special bracket. { and } denote the block and | and | the argument(s). How symbols are combined to form meaningful units depends on the syntax of a language and this issue cannot be avoided. So your milage may vary. I'd be on board more if ligatures were applied in a language specific way, aware of the meaning of tokens in context, e.g. to leave <= in string literals alone, render it ⇐ when used as an arrow (maybe in a language that has left arrows), and something like ≦ when used in a comparison context. But the same thing being rendered in different ways may be very confusing (unless there's an easy on/off toggle).
- josefrichter 5y agoThese are rare exceptions and I think formatters can usually deal with that. I believe it’s also possible to disable specific ligatures (ie not disable all ligatures, but just blacklist those that don’t work in given language)
- avgcorrection 5y agoLigatures in code fonts are an interesting development. I don’t have any experience with them. The most neat thing about them is that they are very much a only-I-need-to-use-this convenience. It doesn’t really infringe on anyone. For the most part. I used a beginner Haskell book for some course. And they used the proper symbols for some operators. But then newbies might think that the symbols used in the book is what constitutes what raw Haskell looks like, which is wrong. So that’s very inappropriate. On the other hand, this is not the same as using ligatures to display things like `==` in an editor; the former is text substitution, while the latter is purely a visual thing. And I am fine with the latter as long as it is not misleading. These visual ligatures are the closest thing that most languages will get to using “nice-looking” (subjective) symbols instead of just every combination of all the printable ASCII symbols. Now, using Unicode in some new tech is intrusive since that is a decision that affect all users of that tech. The author of this piece did do that in his Pollen by using U+25CA LOZENGE (`◊`) as the central metacharacter. I don’t know how that panned out since I haven’t used that very interesting typesetting language. Modern/new languages might want to loosen up on the aversion they have towards Unicode. But it’s a chicken and egg problem: input methods suck so most languages don’t want to burden their users with having to use symbols that don’t show up on their keyboards. And in turn input methods suck because we often don’t need anything better (at least us who are monolinguals and/or from the West). Maybe the best that languages that want to use Unicode can do is to provide Unicode symbols as an alternative by making sure that some ASCII soup can always be used instead (kind of like C’s trigraphs…).
- cronix 5y agoThis only affects you reading code on MY computer. Your computer can display my code in whatever font you wish. This is much to do about nothing. It's simply a presentation layer, and it matters most to the person doing the coding and should be whatever they choose that makes them perform better. For me, ligatures were a big improvement. They shortened code so more is displayed on the screen with no alteration in meaning and made other things just more obvious, intentional and stand out. And when I upload it to github or anywhere else, it's displayed in a traditional font with no ligatures because it's totally nondestructive and has nothing to do with the actual code - only how it appears (to me).
- oneplane 5y agoMost of the hyper-personalised things in IT tend to cause some unusual breakage at various stages. tl;dr: you can obviously do whatever you want, but when you interact with others, having more things in common helps the transfer of information and knowledge. Take a super-personalised 'pretty' keyboard with a custom layout. That's great if you have a desk that is yours where only you sit, and you never sit anywhere else. The reality is that you aren't guaranteed to be the only one there, and you're also not guaranteed to be always there when you are writing. So now you have to either have a backup-keyboard or have lower performance for yourself or others that use your desk. Same goes for the way you like your shell, when you configure it in such a way that it no longer represents anything that looks like a default distro shell, your examples may no longer work for others. Examples of others might no longer work for you. You, using a shell on another system might no longer be familiar to you, and when you have someone looking at your work (be it a presentation or co-worker) they might have a hard time understanding what you are doing at all. This also goes for fonts, color schemes, menu configurations, even the desk, chair, monitor or network you are using. None of that means you shouldn't use what works well for you, or that you shouldn't do whatever you want when it doesn't interact with others, but in reality you never really work in isolation, and as soon as you need to interact with something that isn't yours or someone needs to understand what you are interacting with in your setup the flow of information is quite influenced by the presentation based on your preferences. That doesn't mean that everything and everyone needs to be the same either. If you work on a software project together with others, you probably have a coding standard and editorconfig that embody the commonalities, and then it doesn't matter if someone is using neovim, babi, IntelliJ or ed. But if you end up on stage somewhere showing your work to a larger audience, having an editor that is familiar enough to not distract or confuse, a shell that looks like the shell the audience might be familiar with and a font that people don't need to "interpret". You can replace stage with any other form of sharing, including screencasts, screenshots, books, websites etc.
- 9dev 5y agoThe author points out two problems, which both are ridiculously obscure edge cases: if there’s really a Unicode arrow in code you deal with, it likely won’t matter much if there’s an arrow or something closely resembling an arrow. The second point recommends getting rid of ligatures entirely just because they may, in some situations, do not display the right thing. Both arguments ignore the 99.9999999999% of times ligatures do what they’re supposed to, and help me identify some symbols quicker. I’ll happily accept being confused once in a year about a strange-looking arrow in a debug log output, or from a weirdly rendered arrow in some ASCII art print. People complain about weird stuff.
- karmakaze 5y agoThe last place where you want to have to mentally apply any decoding rules is in "debug log output".
- 9dev 5y agoAre we still talking about the same thing..? Fira code has like 20 ligatures which enhance the rendering of arrows and equality signs. There’s no „decoding rules“ to apply. This is just way, way overblown. Are you really stumped and confused if there’s „=>“ vs. „⇒“ in a piece of text..?
- karmakaze 5y agoI never understood the justification though, beyond "it's pretty". When I see '<=' in a conditional, I see one symbol and attach its meaning. I've never needed to 'encode' that either.
- cbm-vic-20 5y agoIn the case of a "real Unicode arrow", I'd just as soon use a Unicode literal if the language supports it, like '\u2192'.
- erichurkman 5y ago
- karmakaze 5y agoIt's hard enough to find a good coding font without having to disqualify them because of their ligatures. Many fonts overdo it with making them pretty or look like single characters. If they instead appeared like two typed characters that form a single operator without much ambiguity that could be useful. Of course you don't want to depend on using the ligatures for the whitespacing to be 'right'. Much as colored syntax can go very wrong with a poor color palette, mappings, or monitor color profile, ligatures go wrong enough not to make it worthwhile. Maybe they'll get sorted out eventually as we have good color defaults these days.
- indymike 5y agoI've actually caught multiple bugs using ligatures which make operators more obvious. It may not help you, but for me it makes logic expressions and various arrows a lot easier to read. On the whole unicode confusion thing, if you are naming your variables with unicode arrows and logic operators, that might just be an antipattern you want to avoid for other reasons.
- nsonha 5y agothe author almost went there with photo from a printed page: ligature could confuse people learning how to program. That's an actual point that matters to some people, which I would give a shit about. Instead they presented such mind blowing discoveries as ligatures "contradict Unicode" and "are wrong sometimes". I don't use ligatures in anything other than code, why are those problems?
- mananaysiempre 5y ago> So what’s the problem with programming ligatures? > (1) They contradict Unicode. [Goes on to mention U+FB01 LATIN SMALL LIGATURE FI and how a ligature for U+003D EQUALS SIGN, U+003E GREATER-THAN SIGN is indistinguishable from U+21D2 RIGHTWARDS DOUBLE ARROW] No. Nonono. Hell no, one might say. (I’m frankly disturbed to hear this said by a typography expert, because this means something is deeply wrong, perhaps with my understanding here.) It was never a goal of Unicode to have a code point for every ligature a typographer might ever want. For example, there is a code point for FI and for LONG S T, but not for FJ or FT. Like other “presentation forms” (a thing that Unicode is explicitly not supposed to contain), these exist only for roundtrip compatibility with old encodings (some ancient Adobe-Latin variant maybe?) and are deprecated for any other use (although I’ll be damned if I can find a clear statement to that effect on the Unicode website, there are notes in other places[1]). The second part holds water to some extent, but given the amount of visual ambiguity afforded by allowing a text to contain arbitrary Unicode (which we must if U+21D2 is at all a consideration), no programming font can solve it, and no programming font tries. [1]: https://twitter.com/fakeunicode/status/945017346858532864 https://twitter.com/fakeunicode/status/945017346858532864
- WorldMaker 5y ago> (some ancient Adobe-Latin variant maybe?) As with so many problems in encoding anywhere have a single well renowned crazy source: some EBCDIC code pages had manually laid out ligatures. (IBM's shadow remains a heavy one.)
- adamrezich 5y agoI like how we had to figure out some new utterly inconsequential thing to argue about after vim/emacs and tabs/spaces got old
- throw7 5y agoHis list for characters easily confused is weird... the bulk of them I've never had problems disambiguating. My simple test is: lI1O0 and to just stay with monospace.
- samgranieri 5y agoI think the ligatures in Fira Code are pretty sweet. I've been using it for over a year. But that's just my preference. Everyone rolls a different way.
- lobocinza 5y agoPersonally I never had trouble reading code without ligatures. I tried Fira Code and other ones in the past but it felt like a purely cosmetic thing that looks ugly.
- Shorel 5y agoGreat opinion. It is perfectly fine to have strong opinions in such subjective topics, and I respect the vision of others. Also: I would probably never use your font, as I think ligatures look amazing. And I have never encountered a single case of your objection #2.
- logbiscuitswave 5y agoI really don’t like ligatures but I also don’t like it when my IDE auto-completing quotes/braces/brackets/etc. I try to turn all that kind of stuff off. Basically, I find it very distracting when typing something and then seeing something else appearing around my typing. Ligatures definitely fall in that “distracting” realm for me. It may not be as pretty but I like the symbols showing exactly as I typed them. I don’t begrudge others who like these —- it’s their preference. I just prefer non-ligatured versions of coding fonts.
- aidenn0 5y agoOn a side note, Triplicate Code is the only font I've ever considered buying to use on my screen. Reading the book: "Oh, those code examples look lovely, what font?" checking the website: "$120. It's nice, but is it $120 nice?" Logically that's not too much to pay for something I stare at for 40+ hours per week, but for irrational reasons it's hard to pay that much for something so intangible
- neetrain 5y agoI personally love ligatures, but if you’re preparing your code for others to read—whether on screen or on paper—skip the ligatures. I can agree with this.
- crvdgc 5y agoLigatures help to convey the intended meaning of the code, which outweighs the rare case when they go wrong. Programming languages' operators like == are actually ASCII arts for the convenience of the machines, never the humans. It is encoding a concept that is not representable in ASCII, so it has to be encoded by a conventional combination of two characters. When reading your own or others code, you have to do this subtle mental labor of decoding the ASCII art back to the concept. Programming ligatures, on the other hand, alleviate this burden. They conform the intended meaning of the author. It's not a typographical problem, rather it's a communication problem. For most ligatures, you can guess the underlying ASCII codes, and if you can't guess, you only need to learn once. In an editor or on a webpage, you can copy the code and paste onto something that doesn't have the ligature font enabled to learn its components. The idea case is Unicode programming like Agda, but it has its own problems like not easy to type and find out how to type, lacking some operators, hard to read with small font size, etc. Ligatures are a balanced option between the ASCII art and the Unicode programming. Not hell yes, but neither hell no.
- Billfiles 5y ago
- h2odragon 5y agoEspecially when programming, but also at most other times, I want a 1 to 1, unambiguous correspondence between the symbol I entered and the display on the screen. Making my ":)" into an emoji is wrong. "Do what I meant" input magic bullshit is always going to be wrong about "what you meant" sometimes, and occludes the possibility of "I didn't know what I meant until I saw it" with its helpful corrections. Have had this argument with fans of "autocomplete" systems, too. An analogy I like is a powered exoskeleton: if you had one you could run faster and jump higher and all these good things: but then when it breaks or you're not wearing it you've less native ability and no familiarity with the unassisted world, which makes you dependent on the tools.
- dkjaudyeqooe 5y ago> Especially when programming, but also at most other times, I want a 1 to 1, unambiguous correspondence between the symbol I entered and the display on the screen. Ligatures don't necessarily stand in the way of this. It's a matter between the font and the syntax.
- aidenn0 5y agoFont ligatures are always going to be wrong because their logic is both general and simple. On the other hand, if you actually parse the input and use it to make transformations, it would be possible to show you what the tool your are inputting to believes you mean in a clearer fashion, which is very useful. Automated indenting and syntax highlighting (when done correctly) can catch errors as you type.
- CJefferson 5y agoI'm sure builders would struggle without diggers and cranes, and doctors would struggle without electricity. But why would I purposefully do away with useful modern inventions just so I can remain compitent without them?
- h2odragon 5y agoWhy would you occasionally lift heavy weights, only to put them back down, repeatedly? But this activity is viewed as beneficial by so many that there's an industry providing for it.
- meepmorp 5y agoCounterpoint: I like ligatures in programming fonts.
- Something1234 5y agoCounterpoint to your counterpoint: the standard is still the best way, and ligitures are non standard.
- HanaShiratori 5y agoRip rc files, no colored terminals anymore :(
- detaro 5y agoStandards matter for interop, not so much for personal preference in personal environments.
- _pmf_ 5y agoI hope you use the standard Windows OS.
- torstenvl 5y agoCan you point me to where in a programming language standard it says what font, hinting, and kerning must be used when editing code?
- pbronez 5y agoI bet ligatures would be unambiguously helpful in programing if they were limited to the presentation layer and controlled by the syntax highlighter. For example, the author uses Fira Code[0] as an example of well-intentioned by problematic ligatures. The author says this is bad because (1) it contradicts unicode and (2) the substitutions will be inappropriate sometimes. (2) is solved by applying substitutions in semantically relevant places with the syntax highlighter. This would be particularly useful when typing special sequences. If you get the ligature substitution, then you know you don't have a typo. (1) is trickier. You want to save a unicode file, and you want to be able to copy text selections that end part way through a ligature. This requires some finesse. [0] https://github.com/tonsky/FiraCode https://github.com/tonsky/FiraCode
- PopeUrbanX 5y agoDictating to other people how their personal workflows should look: Hell No
- h2odragon 5y agoYou're allowed to disagree. Vociferously if that's your desire. If you post a good counter rant, people will probably enjoy reading it even if you are just ranting. Including reasonable sounding counter arguments would be nice too, but it's not required. It's called "discourse". Differing opinions are voiced and compared to each other, not in search of "Universal Truth", but because different things work better or worse for different people. Greater awareness of the scope of possibility allows individuals to find the things that work best for them. Society as a whole benefits, eventually; at the cost of lots of noise... which we seem to have regardless.
- hunterb123 5y agoFont ligatures are 100% subjective aesthetic. There is no rant worth reading about it (including this blog post). Either you like them or you don't and it doesn't affect anyone else's machine. It doesn't matter if it's pure Unicode or whatever loosely connected complex faux objective reasoning you can drum up to support your subjective view. I didn't like them, but then I did get used to them and I prefer them for JS/TS (only FiraCode's specifically), let me stretch that into an article...
- godDLL 5y agoHe is not your boss, so chill. But if he was, it would be OK, no?
- LandR 5y agoNo. Ligatures and substitutions are display only. I can setup my ide to display how I want it to display code. It affects no one else. Why should any manager dictate that to me? I'd not be working for someone like that. Feels that it would be someone on a huger power trip. Imagine dictating what font your Devs have to use... That would be mental.
- cute_boi 5y agoLig makes appearance somewhat cool but they definitely have drawbacks. Last time while writing rust i had to use shift operator a <<= 1; and it looked so ugly i had to add space between << and =. Does this mean I will stop using lig? Nope.
- jamincan 5y agoIt is possible to only enable the specific ligatures you are interested in if your editor and font support it. https://github.com/tonsky/FiraCode/wiki/How-to-enable-stylistic-sets https://github.com/tonsky/FiraCode/wiki/How-to-enable-stylis...
- asdfasgasdgasdg 5y agoI mean I don't personally like them but I'm not gonna yuck your yum. As long as you run your code through the autoformatter before you submit, you can program in a variable width font for all I care.
- mrpotato 5y agoI agree with the author. I only ever look for fonts that will help add contrast to visually similar characters (ie: i, l, 1, o, 0, etc)
- bee_rider 5y agoAssuming anybody else reads your code -- this will just enable you to write code that is visually ambiguous to people using normal fonts. Ligatures, on the other hand, don't hurt anybody else.
- shagie 5y agoWhen I was required to use Eclipse, Source Code Pro was my preferred font. In January of 2020, JetBrains (which I've been able to use for the past few years professionally) came out with JetBrains Mono which is quite nice too. It has ligatures... which I don't enable. I've found the blog posts on the designs of each to be interesting. https://blog.typekit.com/2012/09/24/source-code-pro/ https://blog.typekit.com/2012/09/24/source-code-pro/ https://www.jetbrains.com/lp/mono/ https://www.jetbrains.com/lp/mono/
- brunellus 5y agoDesign Blogs With Polarizing Titles: Hell No
- kej 5y agoI like programming ligatures for the same reason I like syntax highlighting: it makes it easier for my brain to quickly scan a line of code. I have yet to be bitten by some ambiguity, and the more prominent difference between == and === has prevented a few subtle bugs.
- throwaway284534 5y agoI’d like to say more than “me too,” but you’ve nailed why I love ligature fonts so much. It’s strange to me how the OP is so laser focused on ligatures being “bad” because they violate Unicode. Coding up novel solutions is a stalwart of what it means to be a capital ‘H’ Hacker! I’m almost offended on a cultural level that they couldn’t at the very least appreciate the spirit of ligatures in programmer fonts. Personally, I’ve never experienced a situation where Fira Code was the cause of of an ambiguous syntax or Unicode issues. But if they have, why not come up with a solution instead of being a hater?
- michaelcampbell 5y agoCount me in. I suspect a lot of the "confusion" oriented posts are people exaggerating to make a point, as we as developer seem to so love to do.
- phorkyas82 5y agoCount me in, too. For me it is really easier to parse ≥ than ">=", where I might even get confused about the order of the symbols. Seems more succinct and close the mathematical expression it embodies.
- NelsonMinar 5y agoI'm not a fan of the ligatures. But I'm not sure this website's "They contradict Unicode". Yes there are code points for ligatures. But it's also very reasonable for a typesetting system to encode the individual characters and just combine them to a ligature glyph for presentation. Which is what programming fonts have to do, since the ligature code points aren't part of the programming language. I do something much weirder, I program in proportional fonts. Once you get used to it it's really lovely. Unfortunately the way I figured out how to do it requires some aggressive reformatting of code (mostly using tabs instead of spaces) which makes it hard to share code with others unless they buy in to your preferences.
- avgcorrection 5y agoMy impression was that codepoints for ligatures are there for backwards compatibility reasons. In that case they wouldn’t add codepoints for brand new ligatures. So I don’t really get the point that he’s making (if I’m correct).
- WorldMaker 5y agoYeah, most of the codepoints for ligatures that exist in Unicode are for compatibly mapping from old encodings that predate modern font ligature support (such as EBCDIC had a bunch of manual ligature encodings). These days Unicode suggests leaving ligatures entirely to fonts and unencoded as most people don't need to round-trip through an EBCDIC speaking mainframe (hopefully!).
- seanmcdirmid 5y agoWhat’s weird about programming in proportional fonts? I’ve been doing that for a decade now. Auto formatter mandated at work doesn’t allow for manual format directives anyways, so no one notices. Ligatures can be nice if you can solve the edit problem: keeping an -> as two characters even if it looks like → can help a lot. Unfortunately, editors don’t do that, so they become too annoying to use (maybe when we render code like we render latex will it be accepted).
- 5y ago
- d--b 5y agoI use ligatures that turn spaces into tabs.
- dkjaudyeqooe 5y agoThat's pretty cool. My font doesn't have them, sadly.
- godDLL 5y agoWhat is your tabstop length preference, then? :)
- thom 5y agoI am happy for other people, even those I collaborate with, to set up their editor however they like. Ligatures aren't to my taste, but it's not really affecting me when I read the code and I'm not regularly pairing right now so whatever. Maybe someone's done a scholarly study to test editing and comprehension performance for fonts with and without, but I doubt the results would change my personal choices. However, all that said, if you ever check in unicode identifiers that I can't easily type then you're on your own.
- dkjaudyeqooe 5y agoIt should be noted for clarity that unicode in code is orthogonal to this, which is display only.
- thom 5y agoNot quite, because in both cases the issue is "what the hell is that and how do I type it?"
- dkjaudyeqooe 5y agoIf I send you a file I edited with ligatures you can't see them, not true with a file with unicode-only chars.
- thom 5y agoYes, that was my original point. But my decision on whether to use a font with ligatures, or whether to allow unicode in program text, is still motivated by the same thing, so I’m not sure I’d say they were completely orthogonal concerns.
- vikingerik 5y agoI'll offer a possibly valid use case for Unicode identifiers: mathematical notation. C# allows Unicode for variable names, and I wrote some code using θ (theta) as a variable for a geometric angle. I really liked having a struct for cylindrical coordinates to name the values as (r, h, θ), which flowed quite well visually, better than writing out "theta" or "angle". And since it was a member of a struct, once I had the symbol in the editor once, the Intellisense code completion would just show the θ in the picker dropdown. (It was for a personal project and I'm not sure I'd do that in a team environment, but I'd at least ask the other developers if they'd like it. And of course one use of Unicode being good doesn't mean that all uses of Unicode are good.)
- ask_b123 5y agoI was quite confused about why I was not seeing any differences between the font examples, till I remembered I have uBlock Origin Blocking remote fonts. I also agree with another comment that I don't want my ":)"s being converted into emojis. And the ligatures look pretty good, but I wouldn't use them when programming.
- maweki 5y agoIt depends on the language. At least for me as a Haskell programmer, the arguments are not really valid. * The operators do indeed mean the mathematical symbols * Haskell does not support unicode in operators normally. The operators are ascii. * I have yet to come across where the ligatures were wrong for my code and as I do not have those unicode operators in my code (and am not really sure how to type them) they were never ambiguous. I am happy to have ligatures in Haskell. A colleague of mine programs in Agda though, which supports unicode operators and they have their mathematical meaning there. So he's fine without ligatures and does indeed type the unicode symbols using vim. It really depends on the language.
- marcus_cemes 5y agoI like the ligatures in Fira Code. I find the arrows, boolean operators and the pipe symbol "|>" a lot easier to read as symbols instead of three seperate characters. I can understand why some people would dislike them. I'm not sure about merging together regular letters, although I haven't actually ever noticed this. In my mind it depends on where you are on the spectrum, the hardcore programmers that are one with the code and want to see every letter in a terminal editor and those that stray more towards the designer and practical side of programming. Just do what works for you, and get burned, otherwise you don't learn but endlessly follow "best practice" advice.
- recursive 5y agoEveryone can do whatever they want in their own editor. My personal peeve is being subjected to ligature'd fonts in code examples in programming blogs. I find it particularly egregious when the blog is explaining a new language or syntax to an ostensible beginner. Fortunately Firefox still supports user styles. Here's how to stop the madness for anyone that cares. https://winaero.com/enable-loading-userchrome-css-usercontent-css-firefox/ https://winaero.com/enable-loading-userchrome-css-userconten... Inside my userContent.css I've got this gem. * { font-variant-ligatures: none !important; }
- kevincox 5y agoIn my opinion programming blogs shouldn't touch the font settings in `<pre>` and `<code>` at all. Then everyone can view the code how the prefer.