You may be thinking of Python's "significant whitespace". But all that does is indicate nested blocks.
This works exactly the same in a proportional or monospaced font. The only thing Python cares about is how many spaces or tabs you have at the beginning of a line, and that you don't mix the two.
There are coding styles that don't look as good in a proportional font, such as this kind of "column alignment" or "hanging indent":
def function_with_a_long_name(first_param_with_a_long_name,
second_param_with_a_long_name,
third_param_with_a_long_name):
pass
But you don't have to code like that!The most popular Python code formatter, Black, only uses indentation and no column alignment. Here is how it formats that code:
def function_with_a_long_name(
first_param_with_a_long_name,
second_param_with_a_long_name,
third_param_with_a_long_name,
):
pass
This indentation-based coding style is just as easy to read and write in a proportional font as it is in monospaced.If I had to pick one to use with a proportional font, I guess it would be Perl. The aesthetics would at least fit it well.
that would be horrific! Don't you ever use comments to pin-point to specific parts of a source line?
It works because the spaces are nice and wide unlike in a typical proportional font.
I don’t use it anymore mostly because I wanted something with a little more character but it’s worth a try.