• 3 Posts
  • 576 Comments
Joined 3 months ago
cake
Cake day: March 23rd, 2025

help-circle
  • You can write comments, but you can’t make your colleagues read them. They don’t necessarily have to visit the originating file to read the docs.

    When do you need documentation? When you are down in the code or when you are sitting on the toilet browsing Confluence? If your goal is to make people read the documentation, then the documentation needs to be immediately there where you need it, not in some external thing like Confluence.

    Same goes with if your goal is to make people update the documentation. That’s much more likely to happen if the documentation is in a comment in the code than when you first have to go hunting to find the correct page in that steaming pile of mess that is confluence.

    Just be clear and explicit. Its not gaming; you dont have to care about losing a couple extra frames to type out a few extra characters. Most IDEs have sufficient autocompletes so it’s literally not even a problem in many cases.

    You still only got so much screen real estate, and having huge names means that your lines get very long at times, which makes everything really hard to read.


  • Tbh, creating new code just to shorten variable names is pretty bad practice. Don’t do that.

    Each line of code needs to be maintained, each line of code can contain bugs and reusing such a class in locations it wasn’t actually made for can cause more harm than good.

    And if you are adding external information (e.g. via a class) why not just add that information as inline documentation (aka comments) instead? Most IDEs can handle that so that if you hover over the variable/function name it will display the documentation. And pretty much all IDEs allow you to navigate to declaration with just one click, and there you find the necessary information.

    You example only gets worse if you keep nesting these things, so for example if I have:

    int sleepIntervalSeconds = 0;
    

    Then I immediately know:

    • It’s an int (not a double)
    • It’s an interval used for sleeping
    • It’s in seconds

    (Putting all that in a comment instead of the variable name is almost equally as visible via IDE)

    Instead consider your proposal, which would read like this:

    Intervals var.sleep = 0;
    

    I used var as the variable name since you abstracted the informations “sleep”, “interval” and “seconds” into other definitions.

    So now I still know it’s an interval used for sleeping, but both the real variable type and the information that it’s in seconds is gone. I have to navigate to the Intervals class/type to figure that out.

    IRL this often gets even worse, because Intervals probably doesn’t even contain the fields directly, but instead inherits from a Time class, which then inherits from some other class, and then you might get to the actual definition of the field.

    This is only amplified by using Mixins and other obfuscation goodness.

    If you have two options, and one option creates extra code, extra classes and extra code paths without reducing the complexity of the code significantly, than that’s the worse option.



  • squaresinger@lemmy.worldtoScience Memes@mander.xyz>:(
    link
    fedilink
    English
    arrow-up
    1
    ·
    15 hours ago

    I totally get your point.

    I think the rule of “cleared its own orbit” tried to be less arbitrary and failed horribly.

    A size threshold is clearly more consistent, but it’s purely arbitrary, while the “cleared its own orbit” rule at least has the appearence of not being totally arbitrary, even though it introduces just the problem you are describing.




  • squaresinger@lemmy.worldtoScience Memes@mander.xyz>:(
    link
    fedilink
    English
    arrow-up
    2
    ·
    17 hours ago

    The main issue here is that everything from a speck of dust to the massive black hole at the centre of the galaxis is pretty much the same thing on a large spectrum.

    You can clearly say that some grains of dust are something entirely different than a supermassive black hole, but it’s really hard to find solid cut-off points to categorize anything in between.

    So we started with a handful of arbitrary examples for each category, which was easy when we only had these examples, but with more and more discoveries the gaps between these examples are filled and it becomes a spectrum, and then it becomes iffy what exactly fits into which category.





  • squaresinger@lemmy.worldtoScience Memes@mander.xyz>:(
    link
    fedilink
    English
    arrow-up
    1
    ·
    17 hours ago

    You are confusing science (the process of discovering understanding of reality) with truth (how the world “really” is).

    “Real science” like you describe can almost by definition not exist. Science is costly, both in time and in money. People don’t just spend lots of time and money just because. For that kind of investment you need some kind of motive, some reason. And as soon as you have that, you are into politics and emotions.






  • The title is from the article.

    The problem is deeper than the title of some random article though. The basic currency of any reporting is attention, and that’s the case not only for media intended for the non-scientific public, but also for scientific papers.

    At the same time, a lot of science, especially basic research, is really boring. Because basic research is per definition without a real application (yet), and pretty much any research is years if not decades away from being commercially available.

    To get around this dilemma, every level of science reporting needs to be sensationalist. Every little thing needs to be a “break-through” that “will change the world”, otherwise it won’t get attention, and stuff that doesn’t get attention won’t get funding.

    But sensationalism is inherently counter-scientific, because it requires the authors to make claims that the science doesn’t support.

    So right within the core systems of modern science is a mechanic that rewards being non-scientific while punishing researchers that stick to dry science.

    And that’s a real problem because it means that a large portion (estimates are at ~30%) of scientific papers are just bogus, and an even larger portion (my cynical estimate is ~90%) of what makes it into non-scientific media is pure sensationalist garbage.