Readability measures how easy code is to read and understand.

learn more… | top users | synonyms

12
votes
4answers
3k views

Good use of try catch-blocks?

I always find myself wrestling with this... trying to find the right balance between try/catching and the code not becoming this obscene mess of tabs, brackets, and exceptions being thrown back up ...
18
votes
3answers
2k views

Must source code released under GPL be human-readable?

In a response to another question, a poster suggested that under the GPL: ...you need to provide the human readable [code], not a whitespace stripped version... Readability would seem to me to ...
34
votes
11answers
2k views

Intentional misspellings to avoid reserved words

I often see code that include intentional misspellings of common words that for better or worse have become reserved words: klass or clazz for class: Class clazz = ThisClass.class kount for count in ...
4
votes
11answers
9k views

Avoid Postfix Increment Operator

I've read that I should avoid the postfix increment operator because of performance reasons (in certain cases). But doesn't this affect code readability? In my opinion: for(int i = 0; i < 42; ...
22
votes
7answers
9k views

How far should 'var' and null coalescing operator '??' be entertained without hampering readability?

I know the title of the question is very subjective, but I was confronted with usage of ?? operator by my peers, where at the same time I was not very happy/comfortable with applying var in new ...
81
votes
19answers
39k views

Are `break` and `continue` bad programming practices?

My boss keeps mentioning nonchalantly that bad programmers use break and continue in loops. I use them all the time because they make sense; let me show you the inspiration: function verify(object) ...
12
votes
4answers
9k views

How to determine if a programming language is verbose or terse?

Programming languages can often be described as verbose or terse. From my understanding, a verbose language is easy to read and understand, while a terse language is concise and neat, but more ...
30
votes
16answers
4k views

Should you sacrifice code readability with how efficient code is? [closed]

Should you sacrifice code readability with how efficient code is? e.g. 3 lines of code into 1 line. I read in Code Craft by Pete Goodliffe that readability is key. Your thoughts?
6
votes
4answers
3k views

Is nesting types considered bad practice?

As noted by the title, is nesting types (e.g. enumerated types or structures in a class) considered bad practice or not? When you run Code Analysis in Visual Studio it returns the following message ...
9
votes
6answers
1k views

Pythonic Java. Yes, or no? [closed]

Python use of indentation for code scope was initially very polemic and now is considered one of the best language features, because it helps ( almost by forcing us ) to have a consistent style. ...
10
votes
12answers
1k views

Maintainability of Boolean logic - Is nesting if statements needed?

Which of these is better for maintainability? if (byteArrayVariable != null) if (byteArrayVariable .Length != 0) //Do something with byteArrayVariable OR if ((byteArrayVariable != ...
23
votes
12answers
2k views

How do people manage to write and maintain extremely complex and hard to read code? [closed]

Reading SQLite source code is IMO mission impossible. Yet it is a usable piece of quite complex software (it's a full-blown embedded database after all) that can be downloaded, compiled and used from ...
20
votes
12answers
1k views

Are long functions acceptable if they have internal structure?

When dealing with complicated algorithms in languages with support for nested functions (such as Python and D) I often write huge functions (because the algorithm is complicated) but mitigate this by ...
17
votes
8answers
1k views

Do you prefer conciseness or readability in your code? [closed]

Language shortcuts can often be used to make code more concise. For example, ternary and null coalescing operators can reduce the amount of code, but arguably to the detriment of readability: In C#: ...