Top "Readability" questions

Readability is a subjective parameter used to measure an aspect of code quality.

Looping over array values in Lua

I have a variable as follows local armies = { [1] = "ARMY_1", [2] = "ARMY_3", [3] = "ARMY_6", [4] = "ARMY_7", } Now I want to do an action for …

loops lua readability
Implicit return values in Ruby

I am somewhat new to Ruby and although I find it to be a very intuitive language I am having …

ruby return readability implicit
How to make SQL query more readable in PHP?

When you have a long fields in SQL query, how do you make it more readable? For example: public function …

php mysql readability code-readability
New (std::nothrow) vs. New within a try/catch block

I did some research after learning new, unlike malloc() which I am used to, does not return NULL for failed …

c++ performance exception-handling readability
Why are "continue" statements bad in JavaScript?

In the book Javascript: The Good Parts by Douglas Crockford, this is all the author has to say about the …

javascript readability continue
Would you use num%2 or num&1 to check if a number is even?

Well, there are at least two low-level ways of determining whether a given number is even or not: 1. if (num%2 == 0) { /* …

c++ numbers readability low-level bitwise-operators
Java try/catch performance, is it recommended to keep what is inside the try clause to a minimum?

Considering you have code like this: doSomething() // this method may throw a checked a exception //do some assignements calculations doAnotherThing() //…

java performance try-catch readability
What's the cleanest way to write a multiline string in JavaScript?

It doesn't really have to add newlines, just something readable. Anything better than this? str = "line 1" + "line 2" + "line 3";

javascript string readability maintainability
How to Format Code in Research Reports

I am currently writing a formal research report, and I'll be including code with this report. Question: Is there an …

coding-style report readability code-readability
Looping on C++ iterators starting with second (or nth) item

I am looking for a readable, elegant way to do the following in C++, here shown in Python: for datum …

c++ coding-style iterator readability