python – readability of the short function

I have a function that consists of a line of code:

def trimString(string):
    """ Remove unnecessary whitespace. """
    return re.sub('s+', ' ', string).strip()

But I've been debating with myself if the following would be better, seeing as explicit> implicit.

def trimString(string):
    """ Remove unnecessary whitespace. """
    string = re.sub('s+', ' ', string).strip()
    return string

So which is preferable, the first or the second? And why is that the case?

The question may be out of the question, but I find myself asking it quite frequently and I thought this was the place to ask.

readability: why not use sans-serif fonts in the print design?

Let me begin my answer by saying that the evidence is everywhere on this subject. It seems prudent to suggest that the choice of typeface has a relatively minor effect on the speed of reading or readability given our current understanding.

There is a section on the Wikipedia page for Serif that seems to directly address the question:

Serialized sources are widely used for body text because they are considered easier to read than printed sans-serif fonts. However, the scientific study on this topic has been ambiguous.

Here are some sources that seem to suggest that serif text has a statistically significant effect on readers (either through improvements in readability, recall or reader preference):

Certainly, the conventional wisdom (and what I was taught in the design school) is that the serif text tends to be easier to read. In general, the consensus of the research seems to indicate that there is no significant difference in readability or reading speed, only for serif reasons:

In fact, a greater difference in readability can easily be found within members of the same family type than between serif and sans serif typography.


It is important to keep in mind that academic research on readability is usually done by measuring reading time and / or comprehension; Factors that require long format text to be meaningful. In the use of short forms, such as signage, this is the best research I know about the readability of typography (and you can see that they are testing things like distance reading, word recognition and efficiency).

There is a great distinction between body copy (paragraphs of running text) and headings and other larger types. The Sans serif fonts (in their modern form, text without serifs has existed for thousands of years in prints and hundreds of years in handwriting (see street labels) were produced for larger and bolder uses, such as posters and The first commercially available sans serif font was designed for two large / very large uses.) It was not until 1832 (positively recent in the history of Western typography) that a commercially available minuscule sans serif face (to which it referred to then and now as a "Grotesque" type) became available.In those larger uses, there is no real suggestion, neither conventional nor other wisdom, that the serif text be better for that purpose (even in printed).

In general, "readability" is reduced to semiotics: the ability of the brain to convert curves and page spots into letters and words that have meaning. Hypothetically, the familiarity of a particular font should reduce the time (and effort) it takes to consume it (that's why the logos are so easy to process, you become so used to seeing those letters in that source in that order that you really do not need to read them to process the whole word or phrase having the meaning it has). In practice, the investigation. have He showed that familiar typefaces, to which readers have been exposed many times before, can be read more quickly:

The results indicate that the exposure has an immediate effect on reading speed

In a classic case of a chicken and egg problem, the fact that, in general, we have chosen serif fonts for long format text has meant that typographers have designed them in general for long format text. You rarely see a serif face with a height x as low as Futura or tiny counters as in some black faces and ultra bold without serifs, for example. They almost always have real italics (as opposed to obliques), include lowercase numbers much more often than without serifs and often have more flexible ligatures and other modern typographical features.

This does not mean that a typesetting book in Helvetica does not look beautiful compared to Garamond's similar type. There are abundant tricks in the designer's arsenal to match the playing field and improve the readability of sans serif (such as opening the first line and reducing the length of the line, as well as choosing fewer faceless geometric faces that include characteristics such as stress and distinctive forms).

In short: your choice of source is more important for brand and design reasons than for any other reason.

readability: How to use the empty space in the design of the card list?

The main page of my website shows summaries of the profiles of the users. Each profile summary is encapsulated in a "card".

Take a look at an example here (using fictitious data).

enter the description of the image here

For reference, the width of the card is approximately the width of the main content

on the StackExchange websites.

As you can see, there is a lot of empty space between the main information area on the left and the contact button on the right.

I want to avoid several cards per "row" since I think it's confusing; The benefits of the current design are that they are easy for our brain to follow and read the information.

navigation – (How) capitals affect readability

TLDR

In summary, given the following two options:

  • This is a case of sentence
  • This is the case of the title

Has any research been done on which is easier to use, especially considering dyslexia and other reading disabilities?


Long story

I've been trying to find the best way to capitalize headers, menu items and other UI functions.

After reading several blog articles about the case of the sentence against the title, I still have to find research results that show how this capitalization affects users. The questions I would like to weigh with each other include:

  • Which easiest option to scan?
  • Is there a favorite for users with reading disabilities?
  • Do form factors affect this problem (font size, color, font)?
  • Does culture affect this at all?
  • Does any option affect reading comprehension?
  • Does retention affect?

I would love to eliminate all the reasons of "user preference" and get to find why users prefer specific methods of capitalization.

For example, I know that I prefer Case Sentence instead of Title because it is calmer for my eyes. I could reason that this is because I am used to the fact that most body texts are the case of sentences. For example, you would not write a complete book in Title Case.

While explanations of this kind are useful, they are not conclusive, since they are not based on research. So I'd love to get some real numbers to accompany this, if possible.

readability – recognition of button functionality

On our website we have a section with the best-selling products of each brand. The sections are directed with a great title. By clicking on the top sale button of each brand, a group of five to ten different products is displayed.

enter the description of the image here

The problem: nobody interprets the buttons as such, they continue browsing without knowing it by clicking on each button to change the products from the bottom.

Adding the logo of each brand worsens the design by the difference in shape and proportions of each:

enter the description of the image here

What can be done to make this function more evident? I guess it's a design problem.

Other data:

  • We can not use different colors for each button.
  • We can not show the products with a rollover on each button, it must be a click.
  • The buttons are inside a sensitive flexbox

readability: scripts or scripts, which are more readable when used in number ranges (for North American Internet users)?

The correct use of em and in.

The em dash (- U + 2014) is used to indicate a sudden interruption in thought ("I was thinking of writing a – what time did you say the
Movie started? "), a statement in parentheses that deserves more
attention that the parentheses indicate, or instead of two points or
semicolon to link the clauses. It is also used to indicate an open range,
as of a given date with no end yet (as in "Peter Sheerin
[1969–] He was the author of this document. "), or vague dates (as a substitute for
the last two digits of a four-digit year).

Two adjacent em dashes (a 2-em hyphen) are used to indicate the missing letters in a word ("I just do not care").

Three adjacent em dashes (a 3-em script) are used to replace the author's name when a repeated series of works is presented in a bibliography, as well as to indicate a complete word missing in the text.


The dashboard (- U + 2013) is used to indicate a range of almost anything with numbers, including dates, numbers, game scores,
And pages in any type of document. It is also used instead of the word.
"a" or a dash to indicate a connection between things, including
geographic references (such as the Mason-Dixon line) and routes (such as
The commuter train New York-Boston).

It is used to divide compound compounds, where at least one pair is already divided into dashes. The Chicago Style Manual also states that "When one of the components of a compound adjective contains more than one word" should be used instead of a hyphen. Both rules are clear to indicate exactly what the compound is modifying.

Conclusion: use a script

Source

What type of source (s) offers the maximum readability on screen for consumption in smartphones in Africa?

I know that Africa is very large and very diverse, a continent and it does not look like anything to a single country, and the hardware of cell phones is probably not uniform.

However, if it is known, what type of source would be optimal for electronic books intended for consumption in smartphones in Africa?

c # – Way to hide the logic behind the class for better readability of the method and the refactor class to follow the SRP

I have an algorithm to create a version for an entity and then I save that version in an entity below 2:

1) Variant

2) Category

IEntityVersion interface
{
GetVersion string ();
}

public class EntityVersion: IEntityVersion
{
public string GetVersion ()
{
zero return
}
}

Public interface IVariant
{
Empty process (variant model, chain connection chain);
}

public abstract class BaseVariant: IVariant
{
private read-only IEntityVersion _entityVersion = new EntityVersion ();

Empty public process (variant model, chain connection string)
{
try
{
Transform();
string variantVersion = _entityVersion.GetVersion ();
using (var myConnection = new SqlConnection (connectionString))
{
myConnection.Open ();
using (var transaction = myConnection.BeginTransaction ())
{
try
{
VariantRepo.UpdateVariantVersion (
my connection,
transaction, model.VariantId, variantVersion);

CategoryRepo.UpdateCategoryVariantMapping (
my connection,
transaction, model.CategoryId, variantVersion);

transaction.Commit ();
}
capture (Exception)
{
transaction.Rollback ();
DeleteStep1Data ();
}
}
}
}
capture (Exception)
{
// registry error
}
}

empty abstract void DeleteStep1Data ();
Transformed abstract protected void ();
}

Public class variant
{
public int VariantId {get; set; }
public int CategoryId {get; set; }
}

public class VariantRepo
{
public static void UpdateVariantVersion (SqlConnection sqlConnection,
Transaction SqlTransaction, int variantId, string version)
{
// save the logic here
}
}

public class CategoryRepo
{
public static void UpdateCategoryVariantMapping (SqlConnection sqlConnection,
Transaction SqlTransaction, int categoryId, string version)
{
// save the logic here
}
}

I have 2 derived types (Aggregate calculator Y AdditionCalculator) each having their own implementation of Transform Y DeleteStep1Data methods

public class AggregateCalculator: BaseVariant
{
void protected void DeleteStep1Data () // Are you violating the SRP?
{
launch new NotImplementedException ();
}

Override Protected Override Override ()
{
launch new NotImplementedException ();
}
}

public class AdditionCalculator: BaseVariant
{
void protected void DeleteStep1Data () // Are you violating the SRP?
{
launch new NotImplementedException ();
}

Override Protected Override Override ()
{
launch new NotImplementedException ();
}
}

I feel like the Process The method is doing too much work and if it were possible to hide the logic related to the saving of the version behind EntityVersion class so that the Process The method seems simple.

Step 1 Y Step 2 are synchronized so that if there is an error in Step 2, He called the DeleteStep1Data Method to erase all data saved in Step 1.

I also feel like my 2 derived classes. Aggregate calculator Y AdditionCalculator they handle more than 1 responsibility, that is, they execute a transformation and they also delete the data stored during the transformation process, although I am not sure if this is true or not.

Is there a possibility to refactor the previous code to improve readability and manage the SRP?

[GET][NULLED] – Readable – Blogging WordPress Theme Focused on Readability v2.3.0

[​IMG]
[​IMG]

[GET][NULLED] – Readable – Blogging WordPress Theme Focused on Readability v2.3.0

readability: to what extent is the blank text on a medium to light gray background objectively a bad practice?

I made the mistake of openly criticizing a web page because they asked me for an opinion. I ruled negatively. To what extent is the designer guilty of my unfavorable criticism?

Legibility judged objectively?

Here intrinsic and external factors intervene, such as monitors and eyes.

The small text, from 8 to 10px, white, in a solid tone of gray, which is somewhere between 10 and 35%, still made me fall a "star" … probably because the LCD helped me. The viewing angle of the screen, the density of pixels, maybe even the reflection of the screen could have influenced me. However, am I to blame or is this supposed to be avoided?

Since I have a slight astigmatism, I should not appreciate small sources that are too thin or light. But actually I use this configuration at this time for my desktop environment, with supbixel processing enabled as a necessity to render the font correctly, it is very thin. I'm not blind

Is it sustainable that one should not have to weigh such external factors, if one adheres to good practices, as a greater contrast between the text and the fund?

There was also no real need to choose such a clear gray. What finally gave me the impression of being careless, while the author could have tried to keep things warm and cozy with his choice of colors.

Relevance issues

The thing is that the user is not reading a poem with this configuration. I'm talking about the menu items that will only be read really until the user learns instinctively in the third word of the row.

Personally, I think readability is important. But good practices are not rules and I can not penalize the author because he violated Article X. Is this still somehow objectively A misstep from a UX perspective or is it rather that I was prone to simply "finding fault" subjectively, frustrated by not being able to read some words at a glance? To what extent is the white text on a light gray background objectively a bad practice?

Bonus question in the same line:

This menu was also hidden unnecessarily from the view, until it was invoked by a click. This superfluity made me fall another star, since it gets in the way of efficient interaction. Except, it's just an additional click. However, making a furore in the dynamics for the sake of having dynamics can be done without getting in the way.

The same question. Did I hold a valid resentment? Should the author get it or rather be offended?