foreach vs someList.ForEach(){}
There are apparently many ways to iterate over a collection. Curious if there are any differences, or why you’d use one way over … Read more
There are apparently many ways to iterate over a collection. Curious if there are any differences, or why you’d use one way over … Read more
In Java, it’s possible to have methods inside an enum. Is there such possibility in C# or is it just a string collection … Read more
Are there any best-practice guidelines on when to use case classes (or case objects) vs extending Enumeration in Scala? They seem to offer … Read more
I’m new to programming. Can someone explain what .map would do in: params = (0…param_count).map 8 Answers 8
I am finding some difficulty in accessing mutable dictionary keys and values in Objective-C. Suppose I have this: NSMutableDictionary *xyz=[[NSMutableDictionary alloc] init]; I … Read more
I’m looking for the standard idiom to iterate over an NSArray. My code needs to be suitable for OS X 10.4+. 8 Answers … Read more
Is there a function that I can use to iterate over an array and have both index and element, like Python’s enumerate? for … Read more
I know that PHP doesn’t yet have native Enumerations. But I have become accustomed to them from the Java world. I would love … Read more
How can you enumerate an enum in C#? E.g. the following code does not compile: public enum Suit { Spades, Hearts, Clubs, Diamonds … Read more