Click here to Skip to main content
15,915,603 members
Home / Discussions / .NET (Core and Framework)
   

.NET (Core and Framework)

 
QuestionGenerics instead of parameters? Pin
Sander Rossel13-Apr-11 7:55
professionalSander Rossel13-Apr-11 7:55 
AnswerRe: Generics instead of parameters? Pin
jschell13-Apr-11 8:39
jschell13-Apr-11 8:39 
GeneralRe: Generics instead of parameters? Pin
Sander Rossel13-Apr-11 11:51
professionalSander Rossel13-Apr-11 11:51 
AnswerRe: Generics instead of parameters? Pin
dasblinkenlight13-Apr-11 11:56
dasblinkenlight13-Apr-11 11:56 
GeneralRe: Generics instead of parameters? Pin
Sander Rossel13-Apr-11 19:50
professionalSander Rossel13-Apr-11 19:50 
GeneralRe: Generics instead of parameters? Pin
dasblinkenlight14-Apr-11 5:40
dasblinkenlight14-Apr-11 5:40 
GeneralRe: Generics instead of parameters? Pin
jschell14-Apr-11 9:09
jschell14-Apr-11 9:09 
AnswerRe: Generics instead of parameters? Pin
MicroVirus14-Apr-11 1:42
MicroVirus14-Apr-11 1:42 
The other posts have already given a good answer to your question, so all I'd like to add is:

When first reading the code, your version of the code is clearer (to me). It's very clear that you are adding what's in the parameter.
In your co-workers example, I'd think AddToList does something with adding "Key" to a list, and I wouldn't readily be able to figure out what the generic is doing there in that function.
Same with the deletion: your code makes it clear *what* you are deleting, whereas the alternative leaves it unclear to me what is actually being deleted. Though it is less confusing with the delete than with the add.

So, for first time readability, I'd use your code too.
Combining that with the previous comments: either leave your code as it is, or use your code for adding and the co-workers code for removing (so you get the compile-time type checks).

Best Regards,
MicroVirus
AnswerRe: Generics instead of parameters? Pin
Prasanta_Prince16-Apr-11 4:37
Prasanta_Prince16-Apr-11 4:37 
AnswerRe: Generics instead of parameters? Pin
ToddHileHoffer20-Apr-11 10:47
ToddHileHoffer20-Apr-11 10:47 
GeneralRe: Generics instead of parameters? Pin
Sander Rossel20-Apr-11 10:51
professionalSander Rossel20-Apr-11 10:51 
AnswerRe: Generics instead of parameters? Pin
David Farrow29-Apr-11 5:26
David Farrow29-Apr-11 5:26 
GeneralRe: Generics instead of parameters? Pin
Sander Rossel29-Apr-11 7:45
professionalSander Rossel29-Apr-11 7:45 
GeneralRe: Generics instead of parameters? Pin
David Farrow29-Apr-11 8:20
David Farrow29-Apr-11 8:20 
GeneralRe: Generics instead of parameters? Pin
Sander Rossel29-Apr-11 9:05
professionalSander Rossel29-Apr-11 9:05 
QuestionData security: Encryption? Hashing? Which method? Pin
Gregory Gadow13-Apr-11 4:14
Gregory Gadow13-Apr-11 4:14 
AnswerRe: Data security: Encryption? Hashing? Which method? Pin
Not Active13-Apr-11 5:00
mentorNot Active13-Apr-11 5:00 
AnswerRe: Data security: Encryption? Hashing? Which method? Pin
#realJSOP13-Apr-11 5:03
professional#realJSOP13-Apr-11 5:03 
GeneralRe: Data security: Encryption? Hashing? Which method? Pin
Pete O'Hanlon15-Apr-11 9:20
mvePete O'Hanlon15-Apr-11 9:20 
AnswerRe: Data security: Encryption? Hashing? Which method? Pin
Prasanta_Prince16-Apr-11 4:46
Prasanta_Prince16-Apr-11 4:46 
QuestionLatest Third party .Net Tools and Architecture [modified] Pin
Prasanta_Prince13-Apr-11 3:36
Prasanta_Prince13-Apr-11 3:36 
AnswerRe: Latest Third party .Net Tools and Architecture Pin
Not Active13-Apr-11 4:01
mentorNot Active13-Apr-11 4:01 
AnswerRe: Latest Third party .Net Tools and Architecture Pin
Simon_Whale13-Apr-11 4:20
Simon_Whale13-Apr-11 4:20 
AnswerRe: Latest Third party .Net Tools and Architecture Pin
Abhinav S19-Apr-11 4:36
Abhinav S19-Apr-11 4:36 
Question.Net remoting Pin
Helfdane12-Apr-11 3:37
Helfdane12-Apr-11 3:37 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.