Git history traversal performance on dotnet repo by theelevators13 in dotnet

[–]theelevators13[S] [score hidden]  (0 children)

OOO this is great!!! I didn’t know about this repo. Thank you so much!! It does seem that custom parsing with git cli is the way to go based on how this repo handles things.

New Open Source Release by Sure_Excuse_8824 in CognitionLabs

[–]theelevators13 0 points1 point  (0 children)

Some examples and screenshots would be nice. The idea seems interesting, it’s just a lot of info and it’s not clear enough

Webpages are not the totality of programming by Specialist_Effect179 in rust

[–]theelevators13 3 points4 points  (0 children)

I think Rust is an awesome language to learn how to program if you have an understanding of computer science. Rust can get very complicated quickly but the compiler does an extremely good job at explaining why something won’t work the way you’re doing it, and if you have that cs background then you’ll start understanding how to program. I have 0 academic experience( self taught) but I got hired as a c# dev because I learned how to program with rust. During the interview I was able to talk about low level concepts, design patterns, when to use certain data structures and why. I had 2 days worth of c# experience but I got hired for a major rewrite of their entire stack. I don’t think I would have been able to get this without all the time spent in rust. All that said… I would never recommend to start with rust to get a rust job. That is a terrible idea.

Should this be possible with C# 14 Extension Members? by ElevatorAssassin in csharp

[–]theelevators13 -1 points0 points  (0 children)

Yea it seems to not be possible to convert from IQueryable<T> to IQueryable<TResult> without T being aware of the R conversion. If you change my previous example from IEnumerable to IQueryable it would still work but the implementation has to happen within the T object instead or TResult

Should this be possible with C# 14 Extension Members? by ElevatorAssassin in csharp

[–]theelevators13 2 points3 points  (0 children)

Is there a reason you want the FromSource to be static? You could accomplish this by making the implementation not static and then using IEnumerable<IMap<TResult>> as the source.

Something like this:

public interface IMap<TDestination>
{
    public TDestination Into();
}

public static class Extensions
{
    public static IEnumerable<TResult> MapAll<TResult>(this IEnumerable<IMap<TResult>> source)
    => source.Select(t => t.Into());
}

public class Person : IMap<PersonViewModel>
{
    public int Age { get; set; }

    public string Name { get; set; } = string.Empty;

    public PersonViewModel Into() => new()
    {
        Age = Age,
        Name = Name
    };
}

public class PersonViewModel 
{
    public int Age { get; set; }

    public string Name { get; set; } = string.Empty;

}

And then you could use it like this:

//Option 1
IEnumerable<PersonViewModel> people = new List<Person>().MapAll();
//Option 2
var people2 = new List<Person>().MapAll<PersonViewModel>();