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

help-circle


  • 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.


  • 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.






  • Ephera@lemmy.mltoOpen Source@lemmy.mlGIMP 3.0 Released
    link
    fedilink
    English
    arrow-up
    23
    ·
    15 days ago

    GIMP is generally geared towards photo-editing, so if you have an existing image, you can use GIMP quite well to e.g. cut out parts of it or to apply effects.
    It’s not really geared towards digital painting or creating new images from scratch, like Krita and presumably IbisPaint are.



  • Well, I can throw in another for free:

    distro Kate kwrite
    openSUSE true false

    But yeah, interesting list. These days, KWrite is basically just Kate with different configuration, if I understand correctly, so it always feels like you might as well go with Kate. In my opinion, KWrite is also not particularly easier to use, since basic editing works the same, but I guess, that can be disagreed on.

    I do like that Kate is pre-installed. Imagine Windows, but rather than notepad.exe, you get Notepad++ out of the box. Now imagine that to also be a whole lot better and then that’s what it feels like to have Kate on fresh installations.
    You can just start coding something right away, without it being necessary to install a different editor.




  • Hmm, I wonder what the idea with the Rust interface is. There is already a Rust wrapper for the C library libgit2 (libgit2-sys) and a well-maintained library with a nicer/Rustier API on top of that (git2).

    I’d expect libgit2 to be pretty much just an API around the code that’s within Git anyways. So, is the Rust interface that again, just in Rust?
    I guess, you don’t need to take the route through libgit2, so potentially less things that can break there? Maybe they can somehow offer a nicer Rust API when they have internal access? Or maybe they’re just thinking, we want to official support Rust anyways, so might as well move the maintenance work into our code base?



  • Which is why making code readable is so very important. Our juniors and students will think we’re ridiculous, when we spend a long time cleaning up some code or choosing the least misunderstandable name for a type. But you fuck that up and then others, as well as your future self, will be wasting many more minutes misunderstanding what your code does.


  • Spamming comments is rather controversial, especially in high-level languages. Problem is, they only show up in one place, so they’re just not very useful, but also have a high chance of becoming inaccurate over time. In particular when you spam them to explain relatively trivial stuff, people will stop reading them, meaning they won’t update them.

    The ‘what’ can be documented with meaningful variable/function names, log/error/assert messages and perhaps most importantly unit/integration tests (which should be understood like a specification that checks automatically that it’s applied correctly).

    Comments are indispensible for explaining the ‘why’, though, whenever that is not obvious.