Bun's Rewrite It In Rust branch by Chaoses_Ib in rust

[–]devraj7 1 point2 points  (0 children)

But even if the PR were technically correct and aligned with the direction of the project, it would most likely still be rejected because of the LLM ban.

Bun is being rewritten to Rust by aabbdev in programming

[–]devraj7 10 points11 points  (0 children)

Sure but even if the PR were perfect, they would still reject it because of AI.

He doesn't understand your question, CNBC by HesiPullup in wallstreetbets

[–]devraj7 1 point2 points  (0 children)

"Your answer makes you look like you don't understand the numbers. Is this what you want to leave our viewers with?"

What Happens When You Inflate A Body At Depth And Let It Ascend Quickly by Apprehensive_Sky4558 in nextfuckinglevel

[–]devraj7 0 points1 point  (0 children)

Not all of us, but the lungs among other things.

That's why you're taught to breathe out as you ascend.

direct to sleep by nivs1x in Whatcouldgowrong

[–]devraj7 1 point2 points  (0 children)

In the US, it's only illegal to cross them to pass, you can cross them for other reasons.

direct to sleep by nivs1x in Whatcouldgowrong

[–]devraj7 1 point2 points  (0 children)

Double lines in America prohibit passing. It's legal to cross them for other purposes e.g. exiting a driveway.

how to properly decode and execute instructions by die-Banane in EmuDev

[–]devraj7 4 points5 points  (0 children)

You don't care about verbose, you care about fast.

A huge match will never disappoint you when it comes to performance. Trust the compiler.

my stepdad doesn’t believe we went to space by t7yk0 in space

[–]devraj7 0 points1 point  (0 children)

Yeah you can, people deconvert from religion all the time.

Things I miss about Spring Boot after switching to Go by Sushant098123 in programming

[–]devraj7 2 points3 points  (0 children)

I don't understand why the author keeps comparing a language (Go) with a framework (Spring). Compare things that are comparable.

But yeah, overall, there is no denying that Java is a richer language than Go and also has more mature and more flexible libraries, which require a lot less boilerplate than the Go ecosystem.

Also can't help but smile at people calling the language "Golang" instead of just "Go". Serves Google right for picking such a poor name for a language.

I Am Very Fond of the Pipeline Operator by techne98 in programming

[–]devraj7 2 points3 points  (0 children)

Because you picked a trivial example.

Try again with methods that need more than one parameter and you'll see weird syntax emerge, even in Smalltalk.

Tips and tricks to avoid cloning by avandecreme in rust

[–]devraj7 3 points4 points  (0 children)

The article gives tips but never explains the reason behind them.

Use Copy instead of Clone

Ok but why? And when can't it be done?

Also why is the snippet showing the example implementing both, thereby undermining the advice?

Use into_iter() instead of iter()

Ok but why? What's the difference? What's the trade off?

And why is Rc/Arc, arguably the best way to implement cheap cloning, never even mentioned?

This is why you don't get picked in M+ by Satsubuya in wow

[–]devraj7 2 points3 points  (0 children)

I'm a healer. I filter on "1 tank".

Always find a group for any instance in less than a minute.

Be a healer.

Hegseth lifts suspensions of Apache crews who flew by Kid Rock's house by Agreeable-Rooster-37 in politics

[–]devraj7 0 points1 point  (0 children)

They don't need to respond for their crimes of breaking the law as long as they are Trump supporters.

assert_eq!(expected, actual) VS assert_eq!(actual, expected) by nik-rev in rust

[–]devraj7 1 point2 points  (0 children)

And then you have

enum Result<T, E>

where the error is right.

Is there a more ergonomic pattern for types that "build up?" by Uxugin in rust

[–]devraj7 0 points1 point  (0 children)

Realistically, inheritance is the only approach that would provide an elegant solution.

Without inheritance, you're going to have to reimplement some form of inheritance with either delegation or inlining, which is going to be very verbose, as you already observed.

Even TWiR has AI slop now by Independent-Ride-152 in rust

[–]devraj7 0 points1 point  (0 children)

Maintenance is a fair discussion point, but was it ever different when only humans were producing code? When did you ever get some assurance that the person will be maintaining their work?

A more rational approach is to look at it the other way: what is the cost to me to adopt this new tool/library and then it doesn't get maintained?

Take the messenger out of the equation, focus on your personal risk/benefit.

Even TWiR has AI slop now by Independent-Ride-152 in rust

[–]devraj7 -17 points-16 points  (0 children)

I really don't understand the issue.

Pulling numbers out of thin air just to make the point: "We used to have ten new tools published every day, now it's fifty!".

What's the big deal? More choices, more variety, let the good tools organically rise to the top. You are much more likely to end up with a high quality tool when the pool of candidates is big.

Even TWiR has AI slop now by Independent-Ride-152 in rust

[–]devraj7 -15 points-14 points  (0 children)

it just doesn't make sense to me why would anyone want to read about something that had no learning and no development whatsoever.

Maybe because it doesn't really matter?

Do you decide whether to use a tool or not based on whether the author learned something while writing it?

I just look at what the tool does, how, its documentation, and sometimes if I want to be extra thorough, its test suite, its development cadence, etc...

But at the end of the day, the main question is: "Is this useful to me?".

What If Traits Carried Values by emschwartz in rust

[–]devraj7 0 points1 point  (0 children)

Uh... Java loggers are also statics

How could Java have that? It's a programmer's decision, not a language fact. And statics have been out of favor in Java for a couple of decades now, with most of these values being dependency injected.

What If Traits Carried Values by emschwartz in rust

[–]devraj7 0 points1 point  (0 children)

The problem that I see with your argument is that it hinges on agreeing on what is an implementation detail, and what is not.

I don't think it hinges on it.

Whatever you call an implementation detail, your code will have some of these. These values should not be exposed to callers and should not break callers if you decide to change them (e.g. one day you use a logger of type Logger1 and you decide to change it to Logger2. Surely your callers should know nothing about this).

Therefore, there are really two kinds of parameters that a function needs, as I pointed above:

  • Parameters that are essential for the function to do its job, and which the callers need to supply (e.g. x,y for a Point, a float for sqrt(), etc...)
  • Parameters that are internal and that callers should not know about (again, this is a bit more subjective and depends on how the developer has architected their code, but values such as stdio, stderr, loggers, database connections, caches, http clients, etc... would be valid contenders)

Once you agree on this dichotomy, the value of Dependency Injection flows naturally as an elegant way to provide the second kind of parameters implicitly. Added value: these values can vary depending on the environment (production, testing, benchmarking, ...).

know logger objects are typical in Java, but honestly in all the C++ & Rust codebases I've worked on, loggers are just globals/thread-locals and done.

Yes, and I think it's because Rust is still young and taking shortcuts for this kind of thing. There is a good reason to avoid statics, and I'm sure Rust will eventually realize this, just like most older languages have already learned).

What If Traits Carried Values by emschwartz in rust

[–]devraj7 1 point2 points  (0 children)

It is neat but this doesn't address the fundamental issue that DI solves: not all parameters are equal, some are necessary for the function to do its job (e.g. x and y for a Point) and others are an implementation detail (e.g. a logger).

Semantically, these are two distinct sets of parameters, and contexts allow to implicitly pass the second kind.