• 15 Posts
  • 765 Comments
Joined 5 years ago
cake
Cake day: May 31st, 2020

help-circle
  • Ephera@lemmy.mltoProgrammer Humor@lemmy.mlJava Bros
    link
    fedilink
    English
    arrow-up
    5
    ·
    5 hours ago

    Eh, I’d argue that Java and C# are in the niche of having few features. While I don’t like this niche, Java having even less features makes it stand out more in this niche. If you’re looking for a language with more features than that, then there’s so many more feature-rich choices than C# that I just don’t feel like you’d choose C#, unless you want Java with integration into the Microsoft ecosystem.


  • Well, it certainly wouldn’t be the first time that I call some code unnecessarily hard to read and others call it pythonic.

    I understand that truthiness has an advantage when you don’t have static types, because it deals somewhat reasonably with most types, and then that is why many experienced Python programmers tend to use it. But I maintain the position that it therefore necessarily also makes it harder to read the code, because you necessarily provide the reader with fewer hints as to what is actually in that variable. It is very much like code using lots of generics in statically typed code.

    As for if Enum.empty?(var), I actually prefer that to checking the length. That syntax in particular, I find a bit too complex – my preferred version is if var.is_empty() – but I still think it makes it easier to read than a length check.
    Of course, there’s the nuance that it’s more syntax to remember for actually writing the code. And in particular in dynamically typed languages, your editor may not be able to auto-complete that, so I can understand just not bothering with the extra syntax and doing len == 0 instead. It’s fine.


  • Ephera@lemmy.mltoLinux@lemmy.mlHow I use Kate Editor
    link
    fedilink
    English
    arrow-up
    6
    ·
    edit-2
    2 days ago

    renaming symbols, presenting documentation, formatting files,

    Yes, these are supported via the Language Server Protocol (LSP). I’ve mostly been using it with the Rust LSP server (rust-analyzer) and well, it typically works, but sometimes you have to tell it to restart the LSP server and stuff (which isn’t a huge ordeal, but don’t expect everything to always work as well as in a full-fledged IDE).
    I believe, for formatting, there’s also some non-LSP support.

    showing code diagnostics beyond syntax errors (for example code smells or so),

    This is supported in principle via LSP, too, but it depends on the specific LSP server, how much info it provides. The Rust compiler gives out relatively much on its own, which is passed on by the LSP server, but you can apparently also configure it to use the linter on save.

    have AI integration (explain this, rewrite this, replace this with prompt output, …),

    Not out of the box. There’s a way to define “External Tools”, which basically allows you to run commands and pass arguments to them and then use their output. For example, you should be able to define an External Tool, where you can select some text, then press your keyboard shortcut for that tool, so it sends the selected text to that tool and then it takes the command output and inserts it instead of the selected text.
    While this is a powerful concept, I don’t know, if you hit limitations at some point.

    specific framework integrations (reactjs, django, actix, …),

    Nope, except where this might be covered by LSP. But there’s no obvious way to just install additional plugins, for example. You get about thirty built-in plugins and that’s it.

    and stuff like expanding macros in C/C++ and Rust?

    Well, expanding macros is also possible with the Rust LSP server. Don’t know about other languages.



  • Yeah, I’m talking less deep than that. Plenty programming beginners will be reading Python code. And personally, I’m a fulltime software engineer, but just don’t do much Python, so while I had it in the back of my mind that Python does truthiness, I would have still thought that var must be a boolean, because it’s being negated. Obviously, a different variable name might’ve given me more of a clue, but it really doesn’t reduce mental complexity when I can’t be sure what’s actually in a variable.



  • To perhaps lean more into why complex carbs are useful:

    Your body can’t really not digest something you’ve eaten. Once it’s in your stomach, it will be broken down and gets put into your blood. With the simple carbs, you get a lot of blood sugar very quickly and your body then has to deal with that. It does so by producing insulin, which tells the rest of your body to take sugar out of the blood. It’s put into either a limited, temporary storage (glycogen) or, once that’s full, into more permanent storage (body fat).
    Eating lots of sugar can also lead to your body producing too much insulin, which will cause too much sugar to be taken out of the blood, so you often have a high and then a crash/low after ingesting sugary foods.

    Ideally, you want blood sugar to always stay at a reasonable level, where it can supply your brain and muscles, but where your body does not have to start storing lots of it. And that’s where complex carbs are neat, because they don’t get broken down all at once, when they’re in your stomach/intestines, meaning their sugar enters your blood at a more sustainable rate. By eating them instead of sugar, you’re less likely to put on fat and less likely to have a crash.











  • Yeah, I’m building more-or-less an alternative to make. Major difference is that I’m not using shell commands, but rather users will define their build code in Rust …because it’s intended to be a build tool for Rust applications (beyond what cargo does).

    Thanks for the comment, though. So far, I haven’t limited inputs to just be files, so I don’t actually assume to have a last-modified timestamp. Rather, my assumption is that I can get some value which changes when the input changes. In the case of a file, that’s the last-modified timestamp, but theoretically, it could also be a hash. But that means I have to store these values to be able to detect a change. Being able to just say that one thing is newer than the other without storing anything, that is pretty cool and might be worth changing my assumption for.