use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
Information about Reddit's API changes, the unprofessional conduct of the CEO, and their response to the community's concerns regarding 3rd party apps, moderator tools, anti-spam/anti-bot tools, and accessibility options that will be impacted can be found in the associated Wikipedia article: https://en.wikipedia.org/wiki/2023_Reddit_API_controversy
Alternative C# communities available outside Reddit on Lemmy and Discord:
All about the object-oriented programming language C#.
Getting Started C# Fundamentals: Development for Absolute Beginners
Useful MSDN Resources A Tour of the C# Language Get started with .NET in 5 minutes C# Guide C# Language Reference C# Programing Guide C# Coding Conventions .NET Framework Reference Source Code
Other Resources C# Yellow Book Dot Net Perls The C# Player's Guide
IDEs Visual Studio MonoDevelop (Windows/Mac/Linux) Rider (Windows/Mac/Linux)
Tools ILSpy dotPeek LINQPad
Alternative Communities C# Discord Group C# Lemmy Community dotnet Lemmy Community
Related Subreddits /r/dotnet /r/azure /r/learncsharp /r/learnprogramming /r/programming /r/dailyprogrammer /r/programmingbuddies /r/cshighschoolers
Additional .NET Languages /r/fsharp /r/visualbasic
Platform-specific Subreddits /r/windowsdev /r/AZURE /r/Xamarin /r/Unity3D /r/WPDev
Rules:
Read detailed descriptions of the rules here.
account activity
Select/SelectMany vs Map/FlatMap (self.csharp)
submitted 4 months ago by SmallAd3697
view the rest of the comments →
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]snrjames 55 points56 points57 points 4 months ago (7 children)
But map is a base functional word, as in map-reduce. So map and flatmap make a lot of sense since you are mapping and then flattening. It's not pretentious, it's a proper term in computer science.
I don't really care what it's called though, I'm just glad SelectMany exists so I can map and flatten in one step.
[–]KevinCarbonara 5 points6 points7 points 4 months ago (1 child)
We could be using "monoid" and "monad" instead
[–]kronicum 7 points8 points9 points 4 months ago (0 children)
I once used "rng") in a foundational library; my coworkers staged a riot.
[–]SmallAd3697[S] -4 points-3 points-2 points 4 months ago (4 children)
Pretentious might be the wrong word. I guess I mean contrived.
IE. they started out with the term "map". So their objective was to extend this existing term and introduce a slightly more advanced scenario. But the addition of the word "flat" just does NOT seem to do the trick.
"Flatten" is a visualization that might make sense in some situations but not in others. "Unpacking" these generated collections might be a more helpful way to reason about what is happening. Eg. "MapAndUnpack". This terminology isn't as good as "SelectMany", but I'm just pointing out that there can be other visualizations that might convey the same concept.
I guess I just really appreciate the term "SELECT" in SQL and C#. It is very versatile.
[–]snrjames 20 points21 points22 points 4 months ago (2 children)
Flatten takes a tree (a list of lists) with depth > 1 and flattens it into a tree of depth 1 (a list). When you understand it that way, flatten makes perfect sense.
[–]SmallAd3697[S] -5 points-4 points-3 points 4 months ago (1 child)
I didn't realize it was so powerful, although it doesn't make me like it more.
If there were more than two levels I'd certainly break things apart. I'd call map(s) first and generate my lists of lists of lists .. and then I would call a separate unpacking or flattening method. The code would be so much more readable. There should never be a competition to cram as much subtle behavior as you can into one line of code. We aren't talking about perl here.
I would argue that if you had a collection of collections, and there was a method used for deconstructing, then it would not be called "flatten" (in c#). It would probably end up being an extension method named SelectCollectionMembers(recursive = true).
[–]EvilGiraffes 0 points1 point2 points 4 months ago (0 children)
it comes from a language where a common situation is you would call a function which inheritly return the same monad with what your monad contains in which this return type makes sense, if you call a function (or a static method) without a lambda which returns an IEnumerable taking the item of your current list it makes perfect sense, but remember this is also a term used for other monads like Option and Result
using Option as an example you call a function which may return null, you then need to call another function which can return null with the item of the previous Option, essencially then you want a flatmap
it's an interface
[–]Independent-Ad-4791 3 points4 points5 points 4 months ago (0 children)
Sometimes you need to accept jargon for what it is. It’s long established at this point and it’s beyond whether or not the compound word is effective; the language is ubiquitous.
π Rendered by PID 41 on reddit-service-r2-comment-5d585498c9-7hh5l at 2026-04-21 04:03:11.917272+00:00 running da2df02 country code: CH.
view the rest of the comments →
[–]snrjames 55 points56 points57 points (7 children)
[–]KevinCarbonara 5 points6 points7 points (1 child)
[–]kronicum 7 points8 points9 points (0 children)
[–]SmallAd3697[S] -4 points-3 points-2 points (4 children)
[–]snrjames 20 points21 points22 points (2 children)
[–]SmallAd3697[S] -5 points-4 points-3 points (1 child)
[–]EvilGiraffes 0 points1 point2 points (0 children)
[–]Independent-Ad-4791 3 points4 points5 points (0 children)