Questions tagged [readability]

Readability measures how easy code is to read and understand.

Readability measures how easy code is to read and understand.

Questions in this tag should be about code organization, style, and structure from the point of view of enhancing readability by others.

Readability is not the same as legibility, which refers to the clarity and recognition of individual characters rather than whole words, sentences, and other linguistic and coding constructs.

203 questions
13
votes
4 answers

Emphasize negation

I was just writing an if statement with fairly long property names and came occross this problem. Let say we have an if statement like this: if(_someViewModelNameThatIsLong.AnotherPropertyINeedToCheck == someValue && …
9
votes
5 answers

Is it possible to make long code representing a computation easier to read?

Long methods are generally considered bad, however in my code I have some hard-to-understand long methods (more than 50 lines). I have trouble making those methods easier to read because a single statement inside is already more than 50 lines long,…
Michael Tsang
  • 820
  • 2
  • 7
  • 13
8
votes
3 answers

What happens to programmers most oftenly while reading the code of others?

When reading others code do you usually have any troubles understanding it, Or its more usually that you question the others code about it being wrong/non-efficient/bad-formatted(etc)? Someone reading what you coded on your first job
Vinícius
  • 296
5
votes
5 answers

Question regarding code readability

I would like to know, is it considered a common practice to use constructions like |=, &&, ||, != altogether in the single line of code? E.g. hasErrors |= vi2!=null && vi2.hasErrors() || vi.hasErrors(); What can be done to make the code more…
dhblah
  • 1,381
1
vote
3 answers

Is there a standard on where to put the `/` in file & directory substrings?

Let's say I have 2 variables dir_name = mydir and file_name = file1, each to be used in formatted strings. There're a few ways to insert a / in a string with those 2 variables. dir_name = mydir/; file_name = file1 dir_name = /mydir; file_name =…