dolittle-obsolete / DotNET.Fundamentals

Reusable, fundamental abstractions and building blocks
http://www.dolittle.io
MIT License
4 stars 8 forks source link

Null free lists #280

Closed jakhog closed 4 years ago

jakhog commented 4 years ago

Introducing some mutable and immutable null free lists that we will use a few times in Runtime.

┆Issue is synchronized with this Asana task

einari commented 4 years ago

Would it make sense to throw ArgumentNullException for all input parameters being Null on any method in these types of lists? That would make it very consistent.

jakhog commented 4 years ago

Not sure I quite understand. Do you mean the methods like Contains,Remove, etc. ?

einari commented 4 years ago

I was thinking about all methods taking an item as a parameter. Not sure it makes sense, but at least it would be very consistent - if you try to pass null to it in any way it would throw an exception.

jakhog commented 4 years ago

Hmm, it would make sense both ways - just different sense. The current implementation is permissive, so you could pass it along to other code reading it without worrying too much about exceptions. But that might not be necessary.