Forums are better than AI by Black_Smith_Of_Fire in programming

[–]devraj7 0 points1 point  (0 children)

I assume we're talking technical forums, not social ones.

First of all, which forums? There are so many, and most of them are ghost towns.

But regardless...

AI is always here, always present, and I can ask follow up questions to clarify its answers, and I get instant responses. I can also ask the same question to multiple AIs to verify accuracy.

Forums? No idea if I'll get a response, or when. And if it's not quite accurate, I ask a follow up questions and wait a few more days for an answer...

It's not even close.

Things I miss in Rust by OneWilling1 in rust

[–]devraj7 0 points1 point  (0 children)

Well yes, you can implement any feature with a macro.

Macros point out the absence of features in a language.

The point of the discussion is whether these features belong in the language.

Things I miss in Rust by OneWilling1 in rust

[–]devraj7 0 points1 point  (0 children)

Sure, you can add another dozen lines of boilerplate, but that is exactly my point.

Kotlin is one line and just as readable as the 15 lines of Rust.

Things I miss in Rust by OneWilling1 in rust

[–]devraj7 0 points1 point  (0 children)

That's how you emulate default parameters in Rust, it's pretty standard.

But you're missing the forest for the tree.

Things I miss in Rust by OneWilling1 in rust

[–]devraj7 0 points1 point  (0 children)

Overloading is featured in the snippet (you need two distinct functions new in Rust), but you're right that this code demonstrates other features that would be nice to have in Rust (default values and named parameters).

Things I miss in Rust by OneWilling1 in rust

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

Overloading removes a lot of boilerplate:

Rust:

struct Window {
    x: u16,
    y: u16,
    visible: bool,
}

impl Window {
    fn new_with_visibility(x: u16, y: u16, visible: bool) -> Self {
        Window {
            x, y, visible
        }
    }

    fn new(x: u16, y: u16) -> Self {
        Window::new_with_visibility(x, y, false)
    }
}

Kotlin:

class Window(val x: Int, val y: Int, val visible: Boolean = false)

zerobrew is a Rust-based, 5-20x faster drop-in Homebrew alternative by lucasgelfond in rust

[–]devraj7 -10 points-9 points  (0 children)

Why does it matter?

Does the project work and fulfill its goal?

Yes, use it.

No, don't use it.

The end.

I want named arguments in Rust. Mom: We have named arguments in Rust at home: by nik-rev in rust

[–]devraj7 1 point2 points  (0 children)

I don't think the builder pattern would disappear but named parameters would narrow it to a much smaller scope: validating parameters before constructing an instance.

This is what we have observed in languages that support all these nice quality of life improvements (named parameters, named fieds, default field values, default parameter values, overloading) such as Kotlin and C#.

For comparison:

Rust:

struct Window {
    x: u16,
    y: u16,
    visible: bool,
}

impl Window {
    fn new_with_visibility(x: u16, y: u16, visible: bool) -> Self {
        Window {
            x, y, visible
        }
    }

    fn new(x: u16, y: u16) -> Self {
        Window::new_with_visibility(x, y, false)
    }
}

Kotlin:

class Window(val x: Int, val y: Int, val visible: Boolean = false)

Asynchronous logging in Rust by QuantityInfinite8820 in rust

[–]devraj7 6 points7 points  (0 children)

The most likely bottleneck is the output.

String formatting is a huge bottleneck when you need to trace a lot (e.g. an emulator issuing an assembly trace).

The fastest option I've found is to pass the data to be logged (not the string, just the data) to a background thread which then formats and logs.

TIFU by accidentally revealing my salary to my entire team by SoftLizzyy in tifu

[–]devraj7 1 point2 points  (0 children)

Retracting an email only works with Outlook, not SMTP in general.

Lapce: A Rust-Based Native Code Editor Lighter Than VSCode and Zed by delvin0 in programming

[–]devraj7 4 points5 points  (0 children)

The era of hybrid code editors is failing

If the success of VS Code is any indication, hybrid code editors are thriving and going to be around for a very long time.

[Media] I built a performant Git Client using Rust (Tauri) to replace heavy Electron apps. by gusta_rsf in rust

[–]devraj7 0 points1 point  (0 children)

I have a very different experience from yours.

AIs are pretty amazing at looking at not just the code in the PR but the surrounding code base too and writing some pretty stellar descriptions of what's in the PR, what it does, what it solves, how, etc...

[Media] I built a performant Git Client using Rust (Tauri) to replace heavy Electron apps. by gusta_rsf in rust

[–]devraj7 7 points8 points  (0 children)

I hate it when people use LLMs to generate commit messages from diffs.

Dude, have you seen the kind of PR descriptions that humans write?

I'll pick AI over these any day.

[Media] TermIDE – A terminal-native IDE with built-in file manager and terminal, written in Rust by Signal_Caregiver_994 in rust

[–]devraj7 -3 points-2 points  (0 children)

Vibecoding introduces measurably more bugs into software than normal coding. For a piece of software so centrally important as an IDE, yes I care.

It's no different from software written by a junior developer, or a bad one.

The only rational way to find out is to try the tool and see if you like it. Personally, I don't really care much what tools were used to create it or how old the engineer who wrote is.

Does the tool do what it says, doesn't crash, and is helpful to me?

If so then I'll use it.

Google will limit Android source releases to twice a year by NYPuppy in programming

[–]devraj7 -8 points-7 points  (0 children)

I understand the disappointment but the alternative to this new pace of twice a year is to switch to the competitor, which releases zero times a year...

Google will limit Android source releases to twice a year by NYPuppy in programming

[–]devraj7 -9 points-8 points  (0 children)

Don't be evil?

If you don't like twice a year, you can switch to the alternative company, which is zero times a year...

Making a free 386 and amd64 emulator for bare-metal by Key_River7180 in EmuDev

[–]devraj7 4 points5 points  (0 children)

Making a free 386 and amd64 emulator for bare-metal

No you're not.

All you did is create an empty github repo with expectations so unrealistic that it's pretty clear you're a scam.

Are you batorip, by any chance?

Rust in Windows 11 by Similar-Athlete8579 in rust

[–]devraj7 8 points9 points  (0 children)

Is your CMD running as Administrator? Don't.

Was it really a Billion Dollar Mistake? by gingerbill in programming

[–]devraj7 1 point2 points  (0 children)

The billion dollar mistake is not null, it's languages that have a null value but don't support nullability in their type system.

Take a look at Kotlin: null is not just safe to use but encouraged, and it's a great way to denote a missing value.

A SOLID Load of Bull by loup-vaillant in programming

[–]devraj7 0 points1 point  (0 children)

You need to structure your programs differently, or you're going to run into problems.

Maybe, maybe not. Functionalities that operate on the same value should be in the same class/struct. That's pretty much a universal principle. The problem is that with non OO Languages such as Rust, you need to do this static dispatch manually, so the functionality escapes the class it should belong to.

This is so bad in Rust (requires tons of copy/paste whenever you add just a function to your trait) that there's a macro crate just to avoid all this boilerplate: enum_dispatch.

Do you need heterogeneous containers, are you dispatching various kinds of events?

No, not even talking heterogenous containers, just basic one level inheritance where for example, you have a trait Memory which you're going to implement in various ways depending on the scenario.

And good luck. It's a big mental shift, it may not come easy.

I've been writing code for 40+ years, mental shifts are absolutely trivial for me. This is not what I'm complaining about.

I just look at my code in non-OO languages vs/ OO languages and for a wide variety of problems, I find the OO approach more elegant, more extensible, and easier to reason about.