r1veRRR

joined 2 years ago
[–] r1veRRR@feddit.de 3 points 2 years ago

Ironically, I learned Rust first, and later looked at Go. I found a lot of the syntax needlessly "different". That being said, it's still a decent language. Point being, a lot of the weirdness subsides once you understand why it's there.

Personally, I don't actually care about the lifecycle and memory management stuff. What I like about Rust is:

  • An enforced error type that is very convenient to use with the ? operator. No more err != nil spam, but same amount of safety
  • ADTs with a host of wonderful features, like exhaustive match statements. Go enums are horrendously basic, let's be honest
  • NO NIL!! Non existence is expressed with an Option type that, like the error type, comes with many conveniences
  • Generics from the start, meaning you don't have older code that throws away type safety anywhere
  • Traits/Interfaces can be implemented for foreign/external types and types can implement external interfaces (duh)
  • Great tooling, good formatting tools, good LSP, that kind of stuff. Golang has that too

Why learn Rust? For the same reason everyone should learn different languages. To learn new concepts and see new perspectives on old problems. It'll make you a better developer even in your previous languages.

[–] r1veRRR@feddit.de 55 points 2 years ago (6 children)

Compiler checked typing is strictly superior to dynamic typing. Any criticism of it is either ignorance, only applicable to older languages or a temporarily missing feature from the current languages.

Using dynamic languages is understandable for a lot of language "external" reasons, just that I really feel like there's no good argument for it.

[–] r1veRRR@feddit.de 1 points 2 years ago

And that one single line that makes zero FUCKING SENSE AND YOU SPENT 5 DAYS TRYING TO FIX IT!!! That definitely needs a comment so the next idiot (aka you in 6 months) doesn't think "what useless shit is this? Let's delete this!".

[–] r1veRRR@feddit.de 3 points 2 years ago (1 children)

For bigger projects, anything with MANDATORY types is a must for me. Optional, not compiler checked hinting doesn't cut it.

Not that i hate the language, but I do hate the tooling around it. I don't think I've ever had a pleasant experience with setting up a Python project. And all the data stuff is just wrappers for code in other languages, making the packaging story even uglier, even harder.

[–] r1veRRR@feddit.de 3 points 2 years ago

In my experience it HEAVILY depends on the language you're using. Nothing beats Intellij for Java or Kotlin, but Rust and Go feel at home in any editor.

I know that LSPs and DAPs somewhat take care of these, but the following are often easier in IDEs:

  • Refactorings, including really smart language specific ones
  • Support for fancy frameworks. For example, Intellij can analyse all annotations for Dependency Injection or Spring stuff, and will then tell you exactly how everything connects on a higher "framework" level. Arguably, this is a solution to a problem Enterprise Java created
  • Debugging is easier
  • In general, stuff works "well enough" out of the box. As a fan of Neovim, I've definitely been frustrated a lot the first time I had to set something up
  • Fancy integrations, for example linking frontend code calling backend code directly, or an entire little Database Manager builtin, with magic SQL code completion
[–] r1veRRR@feddit.de 1 points 2 years ago

Yeah, well, that's just Python for you. List usages is now an LSP feature for most languages, so will work with "lesser" editors too.

All that being said, I use Intellij with Java daily, so I can see where you're coming from. But for example Rust or Go works wonderfully with Neovim (or VSCode).

[–] r1veRRR@feddit.de 2 points 2 years ago (1 children)

What do you gain from that approach, compared to comments, and appropriate whitespace? If you spread out your function over three, you now potentially have triple the moving parts. You have to manage in- and output, and you have to hope noone coming after you sees your subfunction, and assumes it's there for using.

[–] r1veRRR@feddit.de 2 points 2 years ago (1 children)

We used to have a Python guy at my work. For a lot of LITTLE ETL stuff he created Python projects. In two projects I've had to fix up now, he used different tooling. Both those toolings have failed me (Poetry, Conda). I ended up using our CI/CD pipeline code to run my local stuff, because I could not get those things to work.

For comparison, it took me roughly zero seconds to start working on an old Go project.

Python was built in an era where space was expensive and it was only used for small, universal scripts. In that context, having all packages be "system-wide" made sense. All the virtual env shenanigans won't ever fix that.

[–] r1veRRR@feddit.de 5 points 2 years ago (1 children)

I agree, yet I also see no good universal alternative. Every language has a nice tool to do things in it's ecosystem, but the moment you need to coordinate two languages or go beyond simple stuff, make is the only good option.

[–] r1veRRR@feddit.de 1 points 2 years ago (1 children)

PHP the language has become pretty nice, but I recently had to work with a PHP CMS deployment, and it was an absolute pain to do. PHP frameworks seem to still exist in a world where you manually upload code to a manually configured server running apache. Dockerizing the CMS (uses Symfony) is/was an absolute pain.

[–] r1veRRR@feddit.de 5 points 2 years ago

And then it turns out some horrendously ugly piece of plastic (like the Kinesis Advantage 360) is better for actually using.

[–] r1veRRR@feddit.de 6 points 2 years ago

I use Lemmy for the "general" undirected browsing when I'm bored. I also increased the friction by removing Reddit from my bookmarks, and adding Lemmy.

I do still use Reddit for the smaller communities that have no realistic alternative on Lemmy.

view more: ‹ prev next ›