Fonts in Code Editor

I’ve been trying out code editors (Brackets, Atom, Sublime, VSCode) see here: Desktop Code/Text Editor of Choice

I’ve decided on VSCode (maybe play with Atom just a bit more), and I’ve been looking at which font I prefer in the code windows. I’ve tested:

  • Consolas
  • Fira Mono
  • Hack
  • Inconsolata
  • Input Mono
  • Liberation Mono
  • Mononoki
  • PT Mono Regular
  • Roboto Mono
  • Source Code Pro
  • Ubuntu Mono

They are all very good in their own way and own uses. I am at a point where I can’t decide between Ubuntu Mono and Consolas. Both look great for my style. Others were too blocky, or too thin or less clear to read (but you may like them, try them out!)

What fonts do you all use?

Inconsolata-g for Powerline and Hack, sometimes Fira - depends on my mood…

My vote is Webstorm code editor, with Darcula Theme and Monospaced font.

Overall, the dark background and font is very easy on the eye.

I use Anonymous Pro for everything, because it has the best visual discrimination of all the fixed-width fonts I’ve tried, and I insist on slashed zeroes instead of dotted.

Well, technically I use my own modification that vertically centers +-~=#*<> to match the height of digits and braces, because I write a lot of Perl and the slight misalignment really stands out. It was my way in earlier versions of Anonymous Pro, but at some point he made them match the lower-case letters, so I created “Pseudonym”. :slight_smile:

-j

I bought Pragmata Pro, which I love.

I rarely use fancy IDEs, but VSCode is the best I’ve seen lately. tmux and vim are my tools of choice.

I use Consolas when I’m in Windows and Source Code Pro when in Linux, which is where I do most of my programming.

The biggest change I’ve made over the last year is to stop using syntax highlighting. I use nofrils dark. I thought I would hate it, but I love it.

why do you prefer the no highlighting?

I originally tried it because I heard that Rob Pike and Andrew Gerrand didn’t use syntax highlighting. I was intrigued since I had never heard of such blasphemy. I found the nofrils theme which only highlights comments by default. I discovered that I had a hard time identifying long strings in code (or missing closing quotes) with the default settings, so I enabled the “string backgrounds” option. That’s where I’ve left it.

But why?!

  • This sounds non-intuitive, but I’ve found it easier to read. After a few months without syntax highlighting, I now find it distracting.

  • I think it helps me write cleaner code. I’m generally in Go nowadays, so my code is inherently clearer and simpler than most other languages anyway.

  • I don’t know how many hours I’ve wasted over the years fiddling with coding style (years ago I was submitting patches to PHP code formatting tools). gofmt took all of that away, and I no longer think about it. I’ve had a similar experience with syntax highlighting. I’ve changed themes/styles numerous of times over the years, but now I don’t really care about it.

Granted, I will occasionally switch back to a traditional syntax highlighting scheme for a second when I suspect a syntax error is hiding in a file, esp. HTML. But I’m quick to switch back to nofrils.

You can also read the author of nofrils’ take on why he created it and how it has worked out for him. I share his sentiments.

1 Like

I (currently) use Menlo for my Go editor of choice: LiteIDE, which has very subtle syntax highlighting, most notable is the distinction between code and strings/comments.

I guess this all depends on how many hours a day you spend coding, and if the code is pleasing enough to look at in itself or if it needs some makeup to get you through the day.

2 Likes

For me there is no way around a monospaced font. Most of the time I’m either using Hack or Fira Code.

1 Like

Heh. I was first exposed to syntax highlighting (and its nasty little cousin auto-formatting) in MacPascal, and have hated it ever since. I’d like to reach through the Internet and strangle the people who started doing it with color, and a dose of rat poison for the ones who turned ls output into technicolor barf.

If you think it’s a good idea, try it with prose; carefully color-code every word in a page of text by part of speech, and then ask someone to read it out loud. There are ways to highlight significant portions of the text without breaking the flow of their reading, but constantly changing the text color is like :sun_behind_rain_cloud: sprinkling :smile: emoji :tada: everywhere :bomb: .

The only group that might be helped by marking-up prose in that fashion is “language learners” (without color-vision deficiencies…), who are unfamiliar with the rules and need help parsing English. But then only in their first-semester textbooks; eventually the training wheels need to come off, or they’ll never be able to read something they pick up in a book store.

-j

1 Like

Blockquote
If you think it’s a good idea, try it with prose; carefully color-code every word in a page of text by part of speech, and then ask someone to read it out loud. There are ways to highlight significant portions of the text without breaking the flow of their reading, but constantly changing the text color is like :sun_behind_rain_cloud: sprinkling :smile: emoji :tada: everywhere :bomb:

Oddly enough, I am working on that exact feature! Allow me to explain! I teach English in Asia. Asian languages do not have the concept of plurals, articles (a,an,the, etc), Distance (this,those), or tenses.

I actually want these words to jump off the page! I want students to see them and get in the habit of thinking about them. And actually use them…

With some js, and NLP I can highlight all the subjects in sentences. Or the objects, or prep phrases.

Maybe not colorized. I could also underline, bold the text, etc.

English is a horrible language… Lots of Greek, then a thick layer of latin, with Dutch grammar, then tons of loan words, then it mutates rapidly into an unexplainable mess. The spelling is stupid, too! All the “Rules” have exceptions, etc. Sigh

That was in the back of my mind while I was writing that, because I had a bit of Chinese in college and two years of Japanese in night school, and the first semesters of both were painful for non-Asian students because the textbook writers couldn’t adequately visualize the significant structural differences from English.

Out of curiosity, what morphological analysis package are you using for English? I use MeCab with Unidic for generating custom student editions of Japanese novels.

-j

I spent an entire morning reviewing this… So my expert opinion is… :slight_smile:

https://nlp-expo.firebaseapp.com/expo/uppercase-all-verbs-197792

This is THE best. period. forever, the rest are all crap!
Best to me is free, simple, easy to bang into a webpage, and then quickly mark up some text. YMMV!

My thoughts on language teaching:

  1. basic class. pronunciation, plurals, articles. Simple present, and present continuous. Those two tenses cover about 70% of English as used by native speakers. Lets get that 99% right…
  2. intermediate, more tenses, modals, etc. Past tense, future, hypotheticals.
  3. advanced… depends on the class, contracts, medical, hotels? all very different. No standard class for this.

I am American, and know that many Americans do not have great grammar. Language is not about grammar, to me… It is about expressing ideas. Most do not think of grammar after grammar classes in grade 10. Reduced to its most basic, Subject Verb Object is the most simple, and highly compatible with Asian languages. Build on that… Do not over-complicate lessons with stuff that will not be used daily. Tell students enough so they can understand what someone means when they say those things, but let them reply with SVO. Less words, less mistakes, more communication. Ideas, not words and grammar!

Also, http://aboutworldlanguages.com/vietnamese
Skip down to the “Grammar” section… This talks about the main differences between VN and English.

And https://www.fluentin3months.com/vietnamese/

Every language has 1,2,3, cat, red, green blue. Skip all that. Focus on the differences! Students can do the vocab and grammar reading before class!
In class we use it, and discuss it.

The Fresh Prince sample text nicely illustrates the difficulty of parsing English, since it contains both false negatives (“shooting” is a verb) and false positives (“plate” is not), as well as contractions being parsed differently (“I’d”, “I’ll”: no caps; “you’re”: caps).

Bringing it back to marking up computer languages, IMHO syntax is the easy part. If you’ve been doing this stuff for a while, you can quickly adjust to reading any procedural language without visual aids. It’s idiom that kills you, the “you can write FORTRAN in any language” habits that obscure the meaning of the code just as much as turning each line into fruit salad.

Amusing note: about 9 years ago, someone at our company knocked together a quick Perl script that was only supposed to be used once, for a one-time data conversion in Production. Except that the output turned out to be so useful that it became a cron job that ran every two minutes. Several years later, they wanted some new features and better performance, so it got handed to me.

It was “Perl by a Java guy”. Rewriting it from scratch using Perl idioms solved the performance problems and made it easy to add the new features. The script is still running in Production, and some poor guy in India has recently been tasked with adding features to it; since he hasn’t begged me for help yet, I think I successfully avoided making it too Perlish. :slight_smile:

-j

Indeed. Grammar fails us. It does not always help us extract the meaning. Common usage does not fit well into the grammatical boxes…

Also, English had no formal grammar until the Roman Catholic Church imposed a Latin based structure on it. Illiterate peasants do not need a lot of formal grammar. Schools, universities etc were vastly church based, and in Latin. Catholic mass was latin until ?!? 1967? English was just a pile of common usages. The latin guys put the various bits of English into whatever category fit least bad. Latin is very formal and rigid, English not so much… Round peg meet square hole!

I too came from a software background.

Depending on which computer I’m working on, I switch between Fira Mono, Consolas, and Iosevka, which I don’t think anyone else has suggested yet. I like Iosevka because it’s pretty narrow and lets me fit a lot on one screen (and it looks good, too). I use the Anonymous Pro bitmaps in my terminal.

1 Like