Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Redundancy in C#?

Take the following snippet:

List<int> distances = new List<int>();

Was the redundancy intended by the language designers? If so, why?

like image 820
Esteban Araya Avatar asked Sep 26 '08 02:09

Esteban Araya


People also ask

What is redundancy and examples?

Redundancy is when we use two or more words together that mean the same thing, for example, 'adequate enough'. We also say something is redundant when a modifier's meaning is contained in the word it modifies, for example, 'merge together'. When we write, we should try to be as clear and concise as we can be.

What is redundancy in line coding?

code which is executed but has no external effect (e.g., does not change the output produced by a program; known as dead code).

How do I reduce code redundancy?

Plan to design and write modular code from the beginning of a project, and enforce DRY principle results. If the modules are small and reusable from the design phase, the resulting code is much likelier to be DRY. Code reviews also help reinforce the DRY principle and reduce code redundancy.

What is redundancy of the source?

Redundancy in information theory is the number of bits used to transmit a message minus the number of bits of actual information in the message.


1 Answers

You could always say:

 var distances = new List<int>();
like image 173
Nescio Avatar answered Oct 28 '22 23:10

Nescio