programming Programming Looking for a system/application language that is better than C/C++
Jump
  • "Initials" by "Florian Körner", licensed under "CC0 1.0". / Remix of the original. - Created with dicebear.comInitialsFlorian Körnerhttps://github.com/dicebear/dicebearDR
    DrDeadCrash
    2 weeks ago 90%

    C# is a great language, I don't know much about game dev but I know unity and godot game engines have good support for c#. You can target Windows/Linux/Mac on all the common architectures. All the build tools are available on the command line if that's your thing.

    8
  • politics politics Harris unveils plan for 28% capital gains tax, softening Biden's proposal for 40% rate
    Jump
    zed Zed Introducing Zed AI
    Jump
  • "Initials" by "Florian Körner", licensed under "CC0 1.0". / Remix of the original. - Created with dicebear.comInitialsFlorian Körnerhttps://github.com/dicebear/dicebearDR
    DrDeadCrash
    4 weeks ago 71%

    Problem is, programmers don't want AI. We want better tools that address the issues of complexity and abstract requirements management.

    3
  • csharp C Sharp Option Result library for c#
    Jump
  • "Initials" by "Florian Körner", licensed under "CC0 1.0". / Remix of the original. - Created with dicebear.comInitialsFlorian Körnerhttps://github.com/dicebear/dicebearDR
    DrDeadCrash
    1 month ago 100%

    I very much disagree with this, Null Reference Exceptions have been a huge problem in c#. Nullable reference types are a partial fix, but the question of "how do I 'return' an error from a statically typed method" is not answered there.

    2
  • csharp C Sharp Option Result library for c#
    Jump
    csharp C Sharp Option Result library for c#
    Jump
    csharp C Sharp Option Result library for c#
    Jump
  • "Initials" by "Florian Körner", licensed under "CC0 1.0". / Remix of the original. - Created with dicebear.comInitialsFlorian Körnerhttps://github.com/dicebear/dicebearDR
    DrDeadCrash
    1 month ago 100%

    The operator being applied to the ResultObject will always resolve to the Generic type that was specified as 'T in IResult<T>. If the function is not successful the resolved value will be whatever value was supplied to the ResultObject constructor, the opt.None property will true and the opt.Some property will be false.

    1
  • csharp C Sharp Option Result library for c#
    Jump
  • "Initials" by "Florian Körner", licensed under "CC0 1.0". / Remix of the original. - Created with dicebear.comInitialsFlorian Körnerhttps://github.com/dicebear/dicebearDR
    DrDeadCrash
    1 month ago 100%

    The example is simplified, but I dislike returning null in my own code. The function will always execute, left or right doesn't matter it's mapped across in the ResultObject class.

    The function must return an IResult<T>, the ResultObject analyzes the IResult<T> checking for IFail or IOk. If it's IOk the value of type T is retrieved from the Value property of the IOk<T> object and returned, the Some property defaults to true. If the IResult<T> is an IFail, Some is set to false, it copies the message from the IFail object into the ResultObject, and returns the value the was supplied to its constructor.

    I'm just sharing something I find useful, and I hope I can make it useful for others as well. Thanks for the questions.

    2
  • csharp
    C Sharp DrDeadCrash 1 month ago 94%
    Option Result library for c#

    A collection of tools for dealing with nulls, failures and the generic type issues that arise in this domain. https://github.com/Andy3432344/SafeResults I'm the author, let me know what you think! *Edit: updated to show GitHub link, sorry!

    17
    13
    csharp C Sharp Question regarding generic type and Type
    Jump
  • "Initials" by "Florian Körner", licensed under "CC0 1.0". / Remix of the original. - Created with dicebear.comInitialsFlorian Körnerhttps://github.com/dicebear/dicebearDR
    DrDeadCrash
    2 months ago 100%

    Here's a real world side project example of how I handle this situation:

     public IResult<T> GetResourceValue<T>(string path)
        {
            string err = $"{typeof(T).FullName} is not available from this Resource ({nameof(FileSystemResource)})";
    
            switch (typeof(T))
            {
                case Type t when t == typeof(DriveInfo):
                    return (IResult<T>)new Ok<DriveInfo>(BackingValue);
                case Type t when t == typeof(DirectoryInfo):
                    err = $"Directory path invalid: {path}";
                    var dir = new DirectoryInfo(path);
    
                    if (dir.Exists)
                        return (IResult<T>)new Ok<DirectoryInfo>(dir);
                    break;
                case Type t when t == typeof(FileInfo):
                    err = $"File path invalid: {path}";
                    var file = new FileInfo(path);
    
                    if (file.Exists)
                        return (IResult<T>)new Ok<FileInfo>(file);
                    break;
            }
            return new Error<T>(err);
        }
    

    You said elsewhere that it feels like you're doing something wrong if you have to check for every type just to use a Generic. I think you're right in thinking along those lines. There should be a minimal number of types to check, and Ideally limited via a type constraint.

    Here's example that includes a constraint:

        public IResult<T> GetValue<T>() where T : struct =>
            typeof(T) switch
            {
                Type t when t == typeof(int) && value <= int.MaxValue =>
                 (IResult<T>)new Ok<int>((int)value),
                Type t when t == typeof(uint) && value <= uint.MaxValue && value >= uint.MinValue =>
                 (IResult<T>)new Ok<uint>((uint)value),
                Type t when t == typeof(byte) && value <= byte.MaxValue && value >= byte.MinValue =>
                 (IResult<T>)new Ok<byte>((byte)value),
                Type t when t == typeof(sbyte) && value <= (int)sbyte.MaxValue =>
                 (IResult<T>)new Ok<sbyte>((sbyte)value),
                Type t when t == typeof(short) && value <= (int)short.MaxValue =>
                 (IResult<T>)new Ok<short>((short)value),
                Type t when t == typeof(ushort) && value <= ushort.MaxValue =>
                 (IResult<T>)new Ok<ushort>((ushort)value),
                Type t when t == typeof(long) && value <= long.MaxValue =>
                 (IResult<T>)new Ok<long>((long)value),
                Type t when t == typeof(ulong) => (IResult<T>)new Ok<int>((int)value),
                _ => new IntegerError<T>()
            };
    
    1
  • politics politics Pete Buttigieg fact-checks a GOP congressman to his face at House hearing
    Jump
    jetbrains JetBrains All popular IDEs (and most apps) seem stuck in a single-monitor paradigm. When are we going to get an IDE that sets the bar for working with multiple monitors? For inspiration, look at multi-monitor
    Jump
  • "Initials" by "Florian Körner", licensed under "CC0 1.0". / Remix of the original. - Created with dicebear.comInitialsFlorian Körnerhttps://github.com/dicebear/dicebearDR
    DrDeadCrash
    3 months ago 100%

    I use fancy zones for windows, and I have a zone that compromises one 4k screen and half of two others. That zone is for my VS window, two main code panes in the center and one off to each side.

    It doesn't remember the layout of the tool windows... I'll have to look into the save/apply functionality you mentioned.

    I prefer VS over vs-code, but in VS the window/tabs are bulky and slow compared to vs code which makes this all more annoying. First world problems though...

    Edit: using VS 2022 on win 10

    1
  • jetbrains JetBrains All popular IDEs (and most apps) seem stuck in a single-monitor paradigm. When are we going to get an IDE that sets the bar for working with multiple monitors? For inspiration, look at multi-monitor
    Jump
  • "Initials" by "Florian Körner", licensed under "CC0 1.0". / Remix of the original. - Created with dicebear.comInitialsFlorian Körnerhttps://github.com/dicebear/dicebearDR
    DrDeadCrash
    3 months ago 100%

    Not OP, but in agreement. I like to split out multiple vertical panes in VS, and I put the edges of the panes at the edge of the monitors. It's tedious to position them manually, and different tool windows run when debugging so I have to reposition the pane boundary's again whenever switching between run/design time. It would be nice if it detected the edge of the monitors and kept the scroll bars and break-point column on the correct sides of the split.

    3
  • politics politics Justice Department won't prosecute Garland for contempt, says refusal to provide audio wasn't crime
    Jump
  • "Initials" by "Florian Körner", licensed under "CC0 1.0". / Remix of the original. - Created with dicebear.comInitialsFlorian Körnerhttps://github.com/dicebear/dicebearDR
    DrDeadCrash
    3 months ago 96%

    In 2008 Americans elected a black man president, and the Republicans lost their shit and went scorched earth.

    25
  • technology Technology Decentralized Systems Will Be Necessary To Stop Google From Putting The Web Into Managed Decline
    Jump
  • "Initials" by "Florian Körner", licensed under "CC0 1.0". / Remix of the original. - Created with dicebear.comInitialsFlorian Körnerhttps://github.com/dicebear/dicebearDR
    DrDeadCrash
    4 months ago 100%

    The relatively new Nostr protocol is a very interesting decentralized option. It uses relay servers to provide a secure connection between two (or more) clients which maintain the data, nothing is "stored" on the relay.

    1
  • politics politics AT&T paid bribes to get two major pieces of legislation passed, US gov’t says
    Jump
    politics politics New US climate rules for pollution cuts ‘probably terminal’ for coal-fired plants | Experts say only ‘handful of plants’ will likely survive, and only Trump and lawsuits could save them
    Jump
    politics politics Kristi Noem Now Banned in More Than 90 Percent of All South Dakota Tribal Lands
    Jump
  • "Initials" by "Florian Körner", licensed under "CC0 1.0". / Remix of the original. - Created with dicebear.comInitialsFlorian Körnerhttps://github.com/dicebear/dicebearDR
    DrDeadCrash
    4 months ago 100%

    [their children] don’t have parents who show up and help them.

    [their leadership] focuses on a political agenda more than they care about actually helping somebody’s life look better.

    Every accusation is an admission...

    2
  • politics politics Aileen Cannon overseeing Trump case is "governmental insanity"—Attorney
    Jump
    technology Technology TikTok sues the US government over ban
    Jump
  • "Initials" by "Florian Körner", licensed under "CC0 1.0". / Remix of the original. - Created with dicebear.comInitialsFlorian Körnerhttps://github.com/dicebear/dicebearDR
    DrDeadCrash
    4 months ago 100%

    Lol

    What is the social security system was run by China?

    That's your great analogy. This is a social media company. Gtfoh

    4
  • technology Technology TikTok sues the US government over ban
    Jump
  • "Initials" by "Florian Körner", licensed under "CC0 1.0". / Remix of the original. - Created with dicebear.comInitialsFlorian Körnerhttps://github.com/dicebear/dicebearDR
    DrDeadCrash
    4 months ago 83%

    It's a bad analogy. Mass surveillance (continuous collection of everyone's data) has very little to do with the number we use to track social security payments.

    4
  • technology Technology TikTok sues the US government over ban
    Jump
  • "Initials" by "Florian Körner", licensed under "CC0 1.0". / Remix of the original. - Created with dicebear.comInitialsFlorian Körnerhttps://github.com/dicebear/dicebearDR
    DrDeadCrash
    4 months ago 76%

    We're talking about individuals' personal data stored by social media companies being accessible to others (governments, in this case). This has nothing to do with social security.

    The problem is that the data is accessable, but that's not being addressed. This is an improper fix to an actual problem, just facts.

    9
  • technology Technology TikTok sues the US government over ban
    Jump
    politics politics After Ukraine Aid Vote, Republicans Braced for Backlash Find Little
    Jump
    politics politics After Ukraine Aid Vote, Republicans Braced for Backlash Find Little
    Jump
    programming Programming Naming Functions: When Intent and Implementation Differ
    Jump
  • "Initials" by "Florian Körner", licensed under "CC0 1.0". / Remix of the original. - Created with dicebear.comInitialsFlorian Körnerhttps://github.com/dicebear/dicebearDR
    DrDeadCrash
    5 months ago 100%

    I agree that report and record are different. To me record means it's preserved in some managed way.

    The implementation has the ability to vary quite widely from simply printing to stdout, logging to a file, writing to a queue / database, and yet the same name will continue to reflect all those possibilities

    This makes it sound like the intent goes beyond logging, but not so far as recording. That's how I come to 'report' as the correct verb.

    4
  • lemmyconnect Connect for Lemmy App Connect sometimes make my phone freeze / hang
    Jump
  • "Initials" by "Florian Körner", licensed under "CC0 1.0". / Remix of the original. - Created with dicebear.comInitialsFlorian Körnerhttps://github.com/dicebear/dicebearDR
    DrDeadCrash
    5 months ago 100%

    I just experienced this issue, my phone froze for maybe 30 seconds then came up with the pop-up like you said.

    I have a new Motorola think phone.

    2
  • politics politics Letitia James to Begin Claiming Donald Trump's Properties
    Jump
    technology Technology On a huge election year for the world, Meta will shut down CrowdTangle, it's tool for election integrity observers without replacement
    Jump
    technology Technology On a huge election year for the world, Meta will shut down CrowdTangle, it's tool for election integrity observers without replacement
    Jump
  • "Initials" by "Florian Körner", licensed under "CC0 1.0". / Remix of the original. - Created with dicebear.comInitialsFlorian Körnerhttps://github.com/dicebear/dicebearDR
    DrDeadCrash
    5 months ago 91%

    CrowdTangle is Meta's tool for election integrity, they're shutting it down without a replacement.

    20
  • politics politics Is this the least productive congress ever? Yes, but it’s not just because they’re lazy
    Jump
    programming
    Programming DrDeadCrash 11 months ago 84%
    Is anyone else stuck on overhead?

    I work for a services company, and we're not getting much right now. Just wanted to ask about work availability across the board.

    13
    7
    lemmyconnect
    Connect for Lemmy App DrDeadCrash 1 year ago 83%
    Some communities say No Posts

    ![error no posts](https://programming.dev/pictrs/image/08a7646f-463d-433a-9bed-f9eb34e83aa2.png) I have an active post in vscode right now, which I made in browser, but cannot see anything when viewing the community with Connect. Any ideas?

    4
    2
    vscode
    VS Code DrDeadCrash 1 year ago 83%
    FSI Start

    Hi everyone, I'm trying to try out F# via FSI in VS Code (Windows 10) I have Ionide for F# installed, and have used it before, but now every time I try to start it I get a message "FSI :Start resulted in an error", it goes on to helpfully report "the option has no value". dotnet is in path, dotnet works great. FSI? nothing. I also have the .net workload installed for visual studio 2022 (if that matters). I started up my Linux VM (KDE Neon) fired up vs codium and tried FSI Start...same error! So no tinkering in f# for me tonight. Does anyone have an idea what's happening, across two environments? Google is no help...

    4
    6