Jump to content

Indented Code Is Hard to Read


Random Terrain

844 views

I must be the only person on the planet that has a hard time reading indented code. If you put "indented code is not easier to read" into Google, there isn't even one result. For me it's like trying to read a whole page of centered text.

 

z_rt_centered_text.png.905a67220fa831d52a198e46bb84e714.png

 

Or trying to read code that is following the jagged lines of a polygraph.

 

z_rt_polygraph_jagged_lines_02.gif.4f2ded83b4fa4fbfc400fa11b3aa6c3d.gif

 

I get lost jerking my eyes back and forth all over the page trying to read indented code. The following excerpt from the page below explains what I'm talking about:

 

https://uxmovement.com/content/why-you-should-never-center-align-paragraph-text/

Quote

Left aligned text is easier to read than centered text for paragraphs. This is because when you center your text, the starting place of each line changes. This forces your users to work harder to find where each line begins to continue reading. Without a straight left edge, there is no consistent place where users can move their eyes to when they complete each line.

 

Whether it's code or paragraphs, I can read faster and it doesn't hurt my eyes as much if it's in a straight line down the left side and not spread out all over the place in a jagged fashion.

 

 

 

Random Terrain

  • Thanks 1

2 Comments


Recommended Comments

Awesome perspective RT great article! :)  

 

We've gone overboard with multiple markup colors and massive indentation - I don't like either of these. The squiggly red underlines are even worse and frequently there by mistake in some editors.

 

The most offending aspect of indentation in large Microsoft SQL Server projects with many programmers is that indentation can't be relied on because SQL Management Studio tool doesn't automatically indent anything and manual indenting tends to go out of alignment over time. There are programmers who spend a great deal of time reviewing and redoing the indentation to understand the programs when this happens.

 

Any fans of indentation can PM me for a stored procedure program I wrote for Microsoft SQL Server that adds indentation to any stored procedure.

 

I use it on my own (left aligned) stored procedure programs when other developers request indentation, and use it to fix other developers indentation on large procs where it invariably goes off.

 

You would like this RT - I have another program I use that just removes SQL proc indentation completely so I can see the program easier, then I can run it through the indenter when I'm done so indenting programmers can follow the indentation. I feel the same way about markup colors, the IDE for SuperCharger Disk BASIC is refreshingly monochrome for that reason and has no indentation except that a space can be used instead of a line number or label. 

 

BASIC is great for breaking indentation, next x,y or next x:next y are often rewritten on separate lines by indenting fanatics.  

 

  • Like 1
Link to comment

I don't indent my code at all, so I can scroll left and right less often.  However, I do use the colors to help me read the code a bit better.

  • Like 1
Link to comment
Guest
Add a comment...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...