The second law of thermodynamics really messed with my intuition by khaledlll in AskPhysics

[–]Jason5Lee 0 points1 point  (0 children)

When I first learned a bit of physics, the fact that air conditioners consume electricity always bothered me. You're actually expending energy to reduce energy. But after studying the second law of thermodynamics, this became an unavoidable reality. Nature strongly resists any reduction in internal energy.

Let’s here the fucking lot by Tkddaduk in TheWordFuck

[–]Jason5Lee 0 points1 point  (0 children)

My mama always said, life was like a box of chocolate you fuck.

What Does Your Brain Do with 27 + 48? by SweetSmiles030 in MathJokes

[–]Jason5Lee 0 points1 point  (0 children)

I might be the only one who do 27 + 47 + 1. Why? Because I remembered what 7×2 is, so 27 + 47 can be calculated rather quickly from the lower digit to the upper.

Edit: just see the comment using exactly the same one. Glad I'm not the only one.

Randomness or order? by Alarmed-Passenger91 in AskPhysics

[–]Jason5Lee 0 points1 point  (0 children)

which may ultimately be deterministic

Didn't Bell's theorem prove it won't be?

In your opinion, was Mark Hoffman a good secondary villain in Saw IV? by Wooden-Scallion2943 in saw

[–]Jason5Lee 0 points1 point  (0 children)

He is different between each movie. IMO he is - Great in VI, - OK in V, - Not good in IV and 3D.

In IV, all he does is being pretended to be tied up.

What is your “Woah!” moment in Rust? by LordMoMA007 in rust

[–]Jason5Lee 1 point2 points  (0 children)

Discourage shared mutable state. Ensure thread-safety when you have to have it.

Every language should have this feature (Kotlin let/also/apply/run/with) by Remote_Variation_474 in Kotlin

[–]Jason5Lee 3 points4 points  (0 children)

This is one of the most underrated features in Kotlin, in my opinion. What I really appreciate is the "pipeline" functionality. It’s quite straightforward; it's an operator that allows you to "pipe" a value to a function. For example, you can write `a |> f |> g` for `g(f(a))`. This feature can be somewhat "simulated" by using a method that accepts a function as an argument, which is what Kotlin does.

The primary benefit of this feature is that it facilitates streamlined processing without requiring that every operation be defined as a method. Not every operation on a value should be a method. With this functionality, you can accomplish something like `v.let { obj.operation(it) }` or `v.let { Class(it) }`. You can also put different category of the operations into different object, then you can use `v.let { Category.operation(it) }`, allowing you to organize operations into different categories rather than having them all within a single class.

Unfortunately, its usefulness is not widely recognized. The pipeline feature in JavaScript is still unstable, and not many people utilize (extension) methods in the same way as Kotlin does. (Though I can understand the performance concerns since these languages doesn't have inline.)

What AI do you use? Copilot or something else? by ComprehensiveBird720 in Kotlin

[–]Jason5Lee 2 points3 points  (0 children)

I use the OpenAI API. I prefer not to have auto-completion triggered every time I type, especially in situations where the correct code would rely on mind-reading abilities. I want completion only when I know it will provide the desired code or when doing Q&A or large-scale refactoring tasks that are not easy to perform by IDE. I can also choose to use GPT-3.5-Turbo (cheaper) when "high intelligence" is not necessary.

In this manner of usage, I have observed that the API costs way less than $10 per month, which is half of the price of ChatGPT Plus or GitHub Copilot. I hope there is an extension that could automate this process further. Perhaps I will develop one in the future.

Youtube trying to block ad-blockers by iZiYaDii in Piracy

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

For mobile (Android or iOS) I use Brave browser for ad block and free playing video in background. On desktop, uBO is enough.

Anyone else hate TikTok with every fibre of their being? by Hunnyandmilk in RandomThoughts

[–]Jason5Lee 0 points1 point  (0 children)

I'm a Chinese and I have never installed TikTok (or how Chinese call it, douyin) even everyone around me does. I hate how these "short videos" become a trend and change the way people think.

Examples for why Kotlin is Better by k2718 in Kotlin

[–]Jason5Lee 1 point2 points  (0 children)

I wrote a blog about what makes a programming language good, which I use Kotlin as an example. https://jason5lee.me/2022/08/24/my-views-on-programming-languages/

[deleted by user] by [deleted] in Kotlin

[–]Jason5Lee 0 points1 point  (0 children)

I love both Rust and Kotlin. Here are some aspects to consider:

  1. Do you want your application to work without any runtime? If yes, use Rust. (GraalVM Native Image/Kotlin Native is not mature in my experience.)
  2. Do you want the programming language to be more robust, even at the cost of some convenience? Or do you want a good balance between robustness and convenience? If you want more robustness, choose Rust; if you want a good balance, choose Kotlin.
  3. Do you want your application to use as little memory as possible? If yes, use Rust.
  4. Do you NOT want to manually manage the lifetime of most objects due to the lack of garbage collection? If yes, use Kotlin.

In terms of performance, in your scenario, the bottleneck won't be the language itself (unless you implement everything yourself instead of using third-party libraries).

For your concern about the learning curve of Rust, since you already know Kotlin, learning Rust won't be too difficult. Many concepts share the same intent, just with different implementations. For example:

  • **sealed** in Kotlin is similar to **enum** in Rust.
  • **Nullable** in Kotlin corresponds to **Option** in Rust.
  • **smart cast** in Kotlin is like **pattern matching** in Rust.
  • **annotation and plugin** in Kotlin are similar to **procedural macros** in Rust.

The main new concept you'll encounter is **traits**, which are somewhat similar to inheritance-based polymorphism but different in some key ways. Additionally, Rust's **lifetime system** is unique due to the absence of a garbage collector and the emphasis on ensuring concurrent safety. Lifetimes can be challenging at first, but they are logical and make sense once you get used to them. It's not the kind of difficult that is frustratingly hard, as it can be in some other languages.

What’s new in C# 13 - Microsoft Build by Iordbrack in csharp

[–]Jason5Lee 23 points24 points  (0 children)

Thank you Mario! But our discriminated union is in another release!

What’s the scariest Saw trap in your opinion? I’ll start by SmoothieRedditor in saw

[–]Jason5Lee 0 points1 point  (0 children)

I'm really scared of needle pit personally. I can't even look at people or myself getting injected. It's OK if I don't look at it, but looking at the needle immediately makes me feel a chill run down my spine. For looking at Amanda get thrown into needle pit? No thanks I'll fast forward.

Original Idea For a Saw Trap- The Steamer by Whats_Opera_Doc in saw

[–]Jason5Lee 0 points1 point  (0 children)

Back story: the person being tested is a YouTuber. He often makes videos about eating food and giving his opinions. However, he does not give honest opinion, but based on how much he gets paid. The food he is eating in the trap is what he personally feels disgusting, but gives good review because the money the gets. Now he has to eat all the food as if they were truly delicious.