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

help-circle



  • Ephera@lemmy.mltolinuxmemes@lemmy.worldRust? Like what's on some metals?
    link
    fedilink
    English
    arrow-up
    110
    arrow-down
    1
    ·
    edit-2
    2 days ago

    It’s a programming language, which is particularly relevant for Linux, because it doesn’t require a runtime (separate program that runs the code). This allows it to be used in the kernel.

    But it also means that it’s very good for building libraries. With a small bit of extra work, virtually any other programming language can call libraries implemented in Rust (like you can with libraries implemented in C).
    Add to that, that Rust allows for performance similar to C and makes lots of typical C bugs impossible, and suddenly you’ve got folks rewriting all kinds of C libraries and applications in Rust, which is something you might have also heard about.






  • Wildly depends on the complexity of the feature. If it only takes 4 hours to implement, you might have good enough of an idea what needs to be done that you can estimate it with 1-hour-precision. That is, if you’re only doing things that you’ve done in a similar form before.

    If the feature takes two weeks to implement, there’s so many steps involved in accomplishing that, that there’s a high chance for one of the steps to explode in complexity. Then you might be working on it for six weeks.

    But yeah, I also double any estimate that I’m feeling, because reality shows that that ends up being more accurate, since I likely won’t have all complexity in mind, so in some sense my baseline assumed error is already 100%.


  • Well, I think your idea would be simpler, if we weren’t talking about Java.
    Pretty much everything is an object in Java. It’s only logical that a type would also be an object and have associated fields.

    Similarly, what you’re thinking of as “reference types directly” doesn’t make sense in Java, because it lacks many of the systems to make that actually usable like a type. What you get from .class is a Class object, which you can’t stick into a generic type parameter, for example.
    It basically uses reflection to give you e.g. the name of that type and you can also instantiate an object of that type, if no parameters need to be passed to the constructor function.

    And then, yeah, I think for explaining that you merely get an object which roughly describes the type, the separate .class field is a good idea.



  • I figured, I’d ruffle some feathers by saying that. 😅
    But yeah, I stand by my point. Just because your target users are capable of dealing with complexity, doesn’t mean you should be making use of that rather than simplifying usability, since your users have plenty other things they could be learning instead.

    I will caveat that I can see it becoming worth it to learn an intricate logic for a power user, when things fall into place and make sense at a higher level as you learn more about it.
    But in my experience, that’s just not the case with package managers. You need a few specific commands to be obvious and then the special cases can be obscure flags.


  • Arch’s package manager is pretty terrible.

    Here’s two commands. See if you can guess what they might do:

    pacman -S package_name
    pacman -Syu
    
    Solution

    The first command installs a package.
    The second command updates all packages.

    I believe, there’s some sort of logic to the letters, but man, most users seriously do not care. They just want to install, update and remove packages 99% of the time, so they shouldn’t need to learn that intricate logic for three commands.
    I guess, you could use pkcon to do that instead, but that doesn’t really help new users…


  • Well, it also avoids running instantiation code, which could be doing all kinds of things. In theory, it could have a side-effect which modifies some of your application state or issues a log statement or whatever.

    Even if it doesn’t do anything wild right now, someone could change that in the future, so avoiding running such code when it’s not needed is generally a good idea.


  • Ephera@lemmy.mltoProgrammer Humor@programming.devCode analyzer lore
    link
    fedilink
    English
    arrow-up
    15
    arrow-down
    1
    ·
    5 days ago

    I don’t believe there is much deeper of an explanation than “because the Java designers didn’t implement support for that”.

    That feature is called “types as a first-class value” and you need to implement some special casing or an entire system in the language to make it work. Telling devs there’s a special static variable .class is conceptually simpler to implement and understand.


  • Well, the thing is, if you’re developing a library, you usually do so, because you want it to be useful to people in the ecosystem.
    By putting it under the GPL, you limit that usefulness to only those projects which are willing to also put themselves under the GPL. From an idealist point of view, I certainly also would like to say that people not willing to put their software under GPL don’t need to be my users. But from a library author point of view, I might as well not write a library then, since no one’s going to use it then.

    Many open-source projects are under a permissive license themselves. I might disagree with their choice, but I don’t really want to exclude those from using my library. They’re still doing good things. I would love to exclude specifically any proprietary software from using my library, but that’s not really something you can require in your license without excluding all those permissive open-source projects.

    So, to answer your question, I actually don’t think people are being tricked into it. I thought about choosing GPL for my libraries for a while (all my applications are under GPL) and decided against it. Which is a personal choice that others can disagree with, but all I’m saying is, I know what I’m doing, I wasn’t tricked to use a permissive license.





  • I have this problem with Android. Google has turned the filesystem into unusable garbage, so you’re lucky, if you can launch a gallery app with a file path and it allows you to actually go through the images in that folder.

    And of course, that’s with a local file path, so the situation is completely hopeless when your images are on a network share. Unless the gallery app itself implements the network protocol, you’re out of luck.
    Wanna guess how often that happens? Yeah, it simply doesn’t. Even if it’s theoretically just a library, when you build it into the gallery app, that dev has to continually maintain and test it.