Questions tagged [readability]

Readability is a subjective parameter used to measure an aspect of code quality. It is based on the assumption that code should be easily comprehensible by humans, both in its form and in its meaning.

Readability is a subjective parameter used to measure an aspect of code quality. It is based on the assumption that code should be easily comprehensible by humans, both in its form and in its meaning.

To improve code readability, the following is usually considered:

  • The code is written such that a person with poorer programming skills will be able to understand what is written.

  • Adding descriptive comments to explain every step of the way.

  • Using proper indentation and white spaces.

  • Choosing object\variable names that describe their purposes.

  • Referencing the algorithm and the responsible authors.

730 questions
0
votes
1 answer

Display html articles in a easy to read format

I have looked at the readability api which is useful to display data in a clean format on a html webpage. I am passing a Url to http://www.readability.com/read?url= to display the data. I am initially directed to a page where I can choose to view…
bhavs
  • 2,091
  • 8
  • 36
  • 66
0
votes
1 answer

Implement rdd.me api in UIWebView

I'm working on an app which load newsarticles into a UIWebView from RSS. But I want the users to get a better reading experience and want to implement the rdd.me api. I haven't found any good guides to implement this api into a ios application and…
eplefrik
  • 73
  • 6
0
votes
1 answer

jQuery selectors in an object - reduce redundancy versus readability

Let's say I have a web form that collects a company name and its address information from a user. In a related javascript file, to reduce the jQuery selectors scattered throughout the functions and to collect related information in a single object…
Derek
  • 952
  • 3
  • 13
  • 34
0
votes
3 answers

How to refactor this Ruby code?

I created the following, that works, but it seems very cryptic. Is there a way to write it in a more Ruby-esque or understandable way? This method removes the lower factors below a number. So, 10.high_factors returns [6,7,8,9,10]. 6 is divisible by…
B Seven
  • 44,484
  • 66
  • 240
  • 385
0
votes
2 answers

Access fields or properties from within the declaring class

Public Class FooBar { private int _foo; public int Foo { get { return _foo; } set { _foo = value; } } public void DoStuff() { _foo++; // Do this? Foo++; // Or this? } } Is there a more…
kenwarner
  • 28,650
  • 28
  • 130
  • 173
0
votes
1 answer

OAuth process, Twitter, and Readability

From what I can tell, Twitter and Readability differ in the order of the OAuth process. Twitter requires: request_token authorize / authenticate access_token whilst Readability requires: authorize request_token access_token Meanwhile, the OAuth…
Bobby Jack
  • 15,689
  • 15
  • 65
  • 97
0
votes
1 answer

Constructing a user-defined-function that returns a table (or other alternatives), to make query more readable

I currently have a section in my query that looks similar to this , T3 AS ( select 'FSA' as tType, b.fsacd as tBefore, c.fsacd as tAfter from T1 as a , T2 as b,T2 as c where a.beforeID = b.tID and a.afterID =c.tID union…
Daniel Vaca
  • 159
  • 2
  • 3
  • 15
0
votes
3 answers

Should one try to condense their code as much as possible?

New to programming, I've held the (self imposed) notion that the less lines (of code), the better. Thus, when programming something, rather than having separate variables for pieces, I've been nesting all that I can into a line. For…
Coldblackice
  • 3,450
  • 4
  • 21
  • 22
0
votes
3 answers

Can this jQuery code be refactored

I am trying to improve my jQuery skill and I have this bit of code. It's basic purpose is to size and resize a background to keep it at the same height as a responsive slider, so matching the size of the window; and tracking that if it's resized by…
byronyasgur
  • 4,627
  • 13
  • 52
  • 96
0
votes
2 answers

Large HTML, line breaks and .html() method using jQuery

I have to dynamically load the following HTML in a DIV using jQuery .html() method.

Cor do produto:

Marcio Mazzucato
  • 8,841
  • 9
  • 64
  • 79
-1
votes
0 answers

How to handle big api with authentication in Flutter? (Clean code, Architecture)

I'm trying to code a big api-project with multiple different calls and authentication. In order to keep my code readable, I'd like to split my API into multiple fractions... what's the best approach? From what i have seen in the web, all examples…
ratloser
  • 116
  • 1
  • 7
-1
votes
1 answer

How to make this Python function for finding colourful numbers operate on any number?

A colourful number is one that includes no duplicates in the list of it digits + the products of the subsets of its digits. For example, the products of 263 are [2, 6, 3, 2x6, 6x3, 2x6x3]. These are all different numbers, so 263 is colourful. I made…
-1
votes
1 answer

which of these ways to verify object is better in perspective of readable and maintainable?

I'm programming Human Resource data sync batch program. This program reads user and department data from customer company's database and save to our database. For example, there is class named 'User' indicates each user. It has 4 member variables,…
-1
votes
1 answer

How would I make the readability better in Java

I feel like the amount of while loops nested into each other isn't too readable and could be simplified down but I'm not sure how I can simplify it down. Could someone let me know what I would have to do to simplify this. I'm not sure how I would…
-1
votes
3 answers

How can I clean up these print statements?

So, I'm playing with .csv files learning how to read and present the info. I'm printing the results to the terminal, but as I print more content, I have a wall of print statments that just keeps getting longer and longer. Is there any way to clean…
Ryan
  • 3
  • 3