• 0 Posts
  • 45 Comments
Joined 1 year ago
cake
Cake day: June 12th, 2023

help-circle



  • Writing good comments is an art form, and beginner programmers often struggle with it. They know comments mostly from their text books, where the comments explain what is happening to someone who doesn’t yet know programming, and nobody has told them yet that that is not at all a useful commenting style outside of education. So that’s how they use them. It usually ends up making the code harder to read, not easier.

    Later on, programmers will need to learn a few rules about comments, like:

    • Assume that whoever reads your code knows the programming language, the platform and the problem domain at least in general terms. You are not writing a teaching aid, you are writing presumably useful software.
    • Don’t comment the obvious. (Aside from documentation comments for function/method/class signatures)
    • Don’t comment what a line is doing. Instead, write your code, especially names for variables, constants, classes, functions, methods and so on, so that they produce talking code that needs no comments. Reserve the “what” style comments for where that just isn’t possible.
    • Do comment the why. Tell the reader about your intentions and about big-picture issues. If an if-statement is hard to parse, write a corresponding if clause in plain English on top of it.
    • In some cases, comment the “why not”, to keep maintenance programmers from falling in the same trap you already found.

  • I have been sort of following Wayland’s development for over 10 years now. I have been using Wayland for over 2 years now. I have been reading and watching various lengthy arguments online for and against it. I still don’t feel like I actually know it even is, not beyond some handwavey superficialities. Definitely not to the extent and depth I could understand what X11 was and how to actually work with it, troubleshoot it when necessary and achieve something slightly unusual with it. I feel like, these days, you are either getting superficial marketing materials, ELI5 approaches that seem to be suited at best to pacify a nosy child without giving them anything to actually work with, or reference manuals full of unexplained jargon for people who already know how it works and just need to look up some details now and then…

    Maybe I’m getting old. I used to like Linux because I could actually understand what was going on…











  • waigl@lemmy.worldtoLinux@lemmy.mlMacOS Accessibility Cursor
    link
    fedilink
    English
    arrow-up
    4
    ·
    6 months ago

    If it was, I don’t think it was a default. I had been using Windows 7 for quite a while back in the day, and I cannot remember ever seeing something like this. On the other hand, I can certainly remember losing track of where on my monitors my mouse cursor was on various occasions…


  • waigl@lemmy.worldtoLinux@lemmy.mlMacOS Accessibility Cursor
    link
    fedilink
    English
    arrow-up
    20
    arrow-down
    2
    ·
    6 months ago

    FWIW, this entire comment section:

    https://lemmy.world/post/1940961?scrollToComments=true

    Back to the to the topic, yes, Linux is not technically Unix by pedigree. In practice, it doesn’t matter that it isn’t and it wouldn’t matter if it were, both for this issue in particular and for most others you are likely to encounter.

    The actually relevant technology here is the graphics subsystem, and MacOS’s Cocoa has always been radically different from anything else in the Unix/Linux space. There is no relation whatsoever to either X11 or Wayland. The only thing worth “porting” here is the basic idea. Which is pretty neat, though. Let’s hope Apple hasn’t patented it.



  • Using “they” when you haven’t yet established the group you are referring to in context feels weird and kinda wrong, especially if it’s about a group of inanimate objects. It really looks like the word should have been “there”, but they just mistyped and then didn’t catch the error in the editing process or didn’t bother to correct it.

    That’s what I think is wrong here. I’m not 100% sure that this grammatically wrong, but it sure feels like it. Might depend on what the page before this one said.


  • waigl@lemmy.worldtoLinux@lemmy.mlUSB webcam lagging only in Zoom?
    link
    fedilink
    English
    arrow-up
    13
    ·
    edit-2
    7 months ago

    I also wondered for quite some time why my Logitech C920 webcam seemed to be using much lower framerates (which could be perceived as “laggy”) in Linux as compared to Windows. It turns out it was transmitting uncompressed YUV frames by default, and for that, the bandwidth of my USB port just wasn’t enough. (Maybe in USB C it would be enough, but this webcam isn’t USB C.)

    It worked like a charm after I manually set the format to H.264 in OBS. (“Like a charm” meaning it was transmitting 1920x1080 at 30 fps.) Unfortunately, I don’t know how to do that in an application-agnostic way, but maybe someone else here can enlighten us. Worst case, install https://github.com/umlaeute/v4l2loopback and pipe your webcam stream through OBS…

    I think it’s possible that this is the same problem that you have run into.