Readit News logoReadit News
mrcsharp commented on Nullable vs. Nullable in C#   einarwh.no/blog/2025/08/2... · Posted by u/Bogdanp
angrysaki · 7 hours ago
>Also, the design of this this method doesn't seem to make much difference to me anyways:

``` var strs = source.SelectNotNull(it => it); ```

vs

``` var strs = source.Where(it => it != null); ```

Wouldn't the first be IEnumerable<TR> and the second be IEnumerable<TR?>

I imagine that's the main driver for creating SelectNotNull, so that you get the nonnullable type out of the Linq query

mrcsharp · 7 hours ago
> I imagine that's the main driver for creating SelectNotNull

Sure. And now we are fighting the compiler and in the process writing less efficient code.

The compiler gives us a way to deal with this situation. It is all about being absolutely clear with intentions. Yes, Where(..) in my example would return IEnumerable<TR?> but then in subsequent code I can tell the compiler that I know for a fact that TR? is actually TR by using the null forgiving operator (!).

mrcsharp commented on Nullable vs. Nullable in C#   einarwh.no/blog/2025/08/2... · Posted by u/Bogdanp
mrcsharp · 8 hours ago
As a side note: please avoid, as much as possible, putting `.Select(..)` before `.Where(..)`. You are wasting CPU cycles and memory space by forcing LINQ to map all the items and then filtering on the mapped value.

In most situations, you should be able to filter on the source enumerable before mapping making the whole thing more efficient.

Additionally, that `.Cast<TR>(..)` at the end should have been a dead giveaway that you are going down the wrong path here. You are incurring even more CPU and Memory costs as the `.Cast<TR>(..)` call will now iterate through all the items needlessly.[1]

Also, the design of this this method doesn't seem to make much difference to me anyways:

``` var strs = source.SelectNotNull(it => it); ```

vs

``` var strs = source.Where(it => it != null); ```

A lot of other LINQ extension methods allow you to pass in a predicate expression that will be executed on the source enumerable:

``` var str = source.First(it => it != null); ```

[1] https://source.dot.net/#System.Linq/System/Linq/Cast.cs,152b...

mrcsharp commented on Satya Nadella's Top GPT-5 Prompts   twitter.com/satyanadella/... · Posted by u/pykello
aurareturn · 16 hours ago
Apologies. Not referring to you specifically. Just general HN opinion. People here values data privacy far more than the general public.
mrcsharp · 16 hours ago
I didn't mean to sound aggressive, apologies for that as well.

Let me explain: in my view, he is doing a lot to try and hype up Microsoft's AI offerings and this latest attempt feels like the kind of thing an employee does to hit some arbitrary KPIs.

mrcsharp commented on Satya Nadella's Top GPT-5 Prompts   twitter.com/satyanadella/... · Posted by u/pykello
aurareturn · 16 hours ago

  This reeks of desperation.
Nah, I think this is the future. You may not like it because HN is very privacy focused and hate giving data away to companies. However, I think it's inevitable that people will want to feed all their work data (and probably personal as well) to an LLM and let it help. I think Nadella's examples are pretty spot on for what current LLMs can do for workers if the LLMs have access to work data.

I think it's exciting personally. I think companies who care about data privacy will run some kind of private inference cloud or private DGX racks.

mrcsharp · 16 hours ago
> You may not like it because HN is very privacy focused and hate giving data away to companies.

This is a big assumption from your side. Care to back it up? Where did I talk about Privacy?

mrcsharp commented on Satya Nadella's Top GPT-5 Prompts   twitter.com/satyanadella/... · Posted by u/pykello
mrcsharp · 16 hours ago
Is "How to be a decent human being and an innovative CEO" one of them?

This reeks of desperation.

mrcsharp commented on Windows 11 Update KB5063878 Causing SSD Failures   old.reddit.com/r/msp/comm... · Posted by u/binwiederhier
mrcsharp · a day ago
The latest as far as I know is that Phison couldn't replicate the issue. [1]

[1] https://wccftech.com/phison-dismisses-reports-of-windows-11-...

mrcsharp commented on SimpleIDE   github.com/jamesplotts/si... · Posted by u/impendingchange
mrcsharp · 9 days ago
Absolutely love this! I learned programming with VB.NET and it still holds a special place in my heart.
mrcsharp commented on FFmpeg moves to Forgejo   code.ffmpeg.org/FFmpeg/FF... · Posted by u/whataguy
mmaunder · 13 days ago
Why not GitHub?
mrcsharp · 13 days ago
Does it make a difference? More alternatives to Github is a good thing and alternatives mean nothing if no one is using them.
mrcsharp commented on Show HN: 1 Million Rows   1mrows.pages.dev... · Posted by u/ankitchhatbar
mrcsharp · 18 days ago
Doesn't even work. On a Galaxy Fold 6 in the unfolded position using Firefox and quickly scrolling past row #150 broke the rendering completely. So much for fast performance as advertised.

u/mrcsharp

KarmaCake day684August 10, 2019
About
meet.hn/city/au-Sydney/Sydney

Socials: - github.com/MrCSharp22 - https://blog.mrcsharp.dev

Interests: IoT, Programming, Technology, Web Development

---

https://blog.mrcsharp.dev/

View Original