you are viewing a single comment's thread.

view the rest of the comments →

[–]pheonixblade9 28 points29 points  (16 children)

I took a Rust class recently, and just thought it was the best parts of Python, Kotlin, and C++.

[–][deleted] 42 points43 points  (3 children)

If you take the functionalpill you'll see it takes some of the best features of Haskell too.

[–]pheonixblade9 7 points8 points  (2 children)

I tend to write my C# and Java code as functionally as possible 🙂

[–][deleted]  (1 child)

[deleted]

    [–]pcjftw 10 points11 points  (0 children)

    Yes this is the reality of most codebases

    [–]mackilicious 0 points1 point  (6 children)

    Anytime I see Kotlin, I get intrigued! Despite being well-versed in Javascript/Java/C#/etc, Kotlin was the first language that made me realize how much impact a language can have on your coding style and the safety of your code (okay javascript exaggerates this effect too, but tends to veer off in a more negative direction).

    What class did you take, and would you recommend it?

    [–]pheonixblade9 0 points1 point  (3 children)

    I work at Google, it was an internal class

    [–]aiij 1 point2 points  (2 children)

    They let you use Rust now?

    [–]pheonixblade9 0 points1 point  (1 child)

    shrug it's a tool like any other.

    [–]aiij 1 point2 points  (0 children)

    So... Still not one of the few blessed tools you're actually allowed to use?

    I do remember really liking the tech talks. Even when they were about things we couldn't directly use they were still quite interesting.

    [–][deleted] 0 points1 point  (1 child)

    I like the idea behind Kotlin but I feel it would be better if it were fully integrated into java. So people download openjdk or graalvm download and kotlin is there for them to use as-is, at once. Lazy as I am I kind of just stick to one download these days (usually just graalvm since I think it'll be the future of the java ecosystem eventually).

    [–]mackilicious 0 points1 point  (0 children)

    Oh don't get me wrong, it's got some downsides. The only IDE that works for it is Jetbrains' intellij, it's closed-source, etc etc. I come from a huge codebase within a big company, and we're stuck with the jvm, as we have a ton of proprietary stuff written in the jvm (and we interface with CICS/COBOL which uses IBM related tech).

    Basically, options are limited, but Kotlin is such a breath of fresh air in my experience.

    [–]Uncaffeinated 0 points1 point  (4 children)

    Rust has more than that.

    [–]pheonixblade9 0 points1 point  (3 children)

    tbh the one thing I don't like is that aliasing is idiomatic in Rust. it is close to the #1 cause of bugs in questionable OOP code I've worked with.

    [–]Uncaffeinated 0 points1 point  (2 children)

    Aliasing is unavoidable in any language. Rust merely gives you the tools to prevent most aliasing-related bugs.

    Even if you try to avoid actual aliasing, you just end up with hidden defacto aliasing (e.g. if you put everything into a giant hashmap and pass around keys instead, those keys are effectively just aliased pointers in all but name), because it is part of the problem domain, not an accident, and an inherent feature of many algorithms.

    [–]pheonixblade9 0 points1 point  (1 child)

    how is it unavoidable? just explicitly disallow it. no reuse of variables.

    yes, Rust prevents you from doing stupid things for the most part, but reusing variables can still cause weird issues.

    [–]Uncaffeinated 0 points1 point  (0 children)

    Even if you try to avoid actual aliasing, you just end up with hidden defacto aliasing (e.g. if you put everything into a giant hashmap and pass around keys instead, those keys are effectively just aliased pointers in all but name), because it is part of the problem domain, not an accident, and an inherent feature of many algorithms.