Live data from Hacker News

Read and understand code faster with programming ligatures in Fira Code font

visualstudioextensions.vlasovstudio.com

21–30 of 43 posts

Re: Read and understand code faster with programming ligatures in Fira Code font

#22

I'm not sure that I want my equality signs to be ligature'd together. I feel like using this might mess up alignment in a monospace font.

Usually the ligatures in these fonts are designed to fill the same width as the original combination of separate characters in monospace use. That does preserve the alignment of code to either side of the ligature, but unfortunately at the expense of either making some of the symbols much wider than normal or adding a lot of extra whitespace to pad them out. For programming, the ligatured version seems quite risky if it means the only visual difference between single and double equals or underscore characters is a bit of width and/or horizontal padding.

What I would like to try is a language where = actually meant equality rather than assignment and a few other common operators like !=, ===, !==, = all appeared using the standard mathematical symbols at the same width as =, . That way, some related cases would naturally line up and most lines with comparisons would become shorter and less cluttered, which seems like a modest incremental improvement in language syntax. Alas, you’d also need software and keyboard input to support that in a way that made those alternative symbols effortless and entirely predicable to use. This feels like a job for a standardised programmer’s keyboard and AltGr, except that you’d need a standardised programmer’s keyboard for each of the different languages that already uses AltGr for other purposes, and at some point it all becomes more trouble than it’s worth.

Re: Read and understand code faster with programming ligatures in Fira Code font

#25
post #16

I would be very hesitant to use this. It's not "more intuitive" as the author would like to think. In fact , our visual system has been trained to instantly recognize a!=b in code, and I read code a lot more often than Math formulas. Plus code is not math (e.g. 1+(a>0)), confusing = with == will lead to lots of errors etc. If I get used to this font on my machine, i will have a real problem when parsing code in anoth…

>In fact , our visual system has been trained to instantly recognize a!=b in code

Citation needed.

>confusing = with == will lead to lots of errors etc

This is more about NOT confusing == with = -- and several similar characters than the opposite.

Sounds like you have thought of all kinds of arguments to not actually try it and see whether it's any good in practice -- which is how anything should be judged (unless it involves some huge risk). In other words, a priori rationalization.

>If I get used to this font on my machine, i will have a real problem when parsing code in another terminal/editor.

The above argument advices to forever stick to a lowest common denominator coding toolset, lest one has to ever try to work in other environment.

How about maximizing the performance one gets from their own, and most frequently used, environment, instead of "what-ifing" for foreign systems they might have to use 1/10 of the time or less?

Plus, having a tool at our disposal and getting used to it doesn't mean we can't also do without if needed. Especially if it's a small improvement, like the one proposed by the ligatures here, and not some totally different notion that we can't ever go back to how it was without it...

Re: Read and understand code faster with programming ligatures in Fira Code font

#26
post #14

This isn't really what I thought it would be. I don't want != changed to ≠ because ≠ isn't a C++ operator. What I thought would be true ligatures ("tying together") of "&&" which could still be recognized as a pair of ampersands, but by being conjoined cleanly appear to be symbol in their own right, which is what "&&" is. However part of the value of ligatures is symbol tightness, which is defeated by the need for a…

>I don't want != changed to ≠ because ≠ isn't a C++ operator.

A colored != is not a C++ operator either. It's about getting our minds to differentiate symbols faster, not about whether they exist as is in some language's syntax.

Re: Read and understand code faster with programming ligatures in Fira Code font

#28
post #25
post #16

I would be very hesitant to use this. It's not "more intuitive" as the author would like to think. In fact , our visual system has been trained to instantly recognize a!=b in code, and I read code a lot more often than Math formulas. Plus code is not math (e.g. 1+(a>0)), confusing = with == will lead to lots of errors etc. If I get used to this font on my machine, i will have a real problem when parsing code in anoth…

> In fact , our visual system has been trained to instantly recognize a!=b in code Citation needed. > confusing = with == will lead to lots of errors etc This is more about NOT confusing == with = -- and several similar characters than the opposite. Sounds like you have thought of all kinds of arguments to not actually try it and see whether it's any good in practice -- which is how anything should be judged (unless…

I admit that the >= and I don't understand why ppl upvoted my comment. You should try it first and report back.

Also, http://www.pallier.org/papers/Chang.Reading.2015.pdf

Re: Read and understand code faster with programming ligatures in Fira Code font

#29

Anybody else despise the look of many of these ligatures? One of the worst is the design of the ampersand.

I don't even think they add much to readability. If i could choose, the only ligatures i 'd like would be >= and !=

Re: Read and understand code faster with programming ligatures in Fira Code font

#30

I'm assuming this doesn't take care of context? For eg: String s = "A != B"; would render the ligature inside the string?

it doesn't unless you use a different font for strings. But it seems that would be fine in your example
Post reply on HN