M
M
makaravich2016-01-15 22:44:57
Programming
makaravich, 2016-01-15 22:44:57

Why do programming people use monospaced fonts?

Actually, perhaps the question is stupid, but for me personally it is not obvious why we use fonts with the same character width to write code. Why are they better than others?

Answer the question

In order to leave comments, you need to log in

5 answer(s)
A
Alexey S., 2016-01-15
@Winsik

indented :)

A
Andrey, 2016-01-16
@VladimirAndreev

Someday you will also swear loudly when " turns out to be two apostrophes, not a quote))

O
Oleg Tsilyurik, 2016-01-16
@Olej

Why do programming people use monospaced fonts?

The programming does not use fonts.
Programming uses brains.

A
Alexander Ruchkin, 2016-01-16
@VoidEx

In some cases, it is important for formatting that the width of all characters be the same:
For example, some align like this (or something like that):

void foo(
         int    x,
         double y)
{
  int    quux = x;
  double bla  = y;
  float  t    = 0.0;
}

With non-monospace, this will not work. Perhaps there are other reasons.
Personally, I use non-monospaced ones - they are easier to read, but I don’t use such formatting and rarely see it.

P
Peter, 2016-01-15
@petermzg

Easier to program.
For example, you write an input which contains text, it's easier to take the width of one character and calculate the caret position than to calculate the offset at different character widths. For highlighting the test also.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question