• 1 Post
  • 22 Comments
Joined 1 year ago
cake
Cake day: June 28th, 2023

help-circle
  • Oscar@programming.devtoProgrammer Humor@programming.devBrace Style
    link
    fedilink
    English
    arrow-up
    8
    ·
    edit-2
    29 days ago

    Linux uses 8 spaces. Excerpt from the official style guide:

    Tabs are 8 characters, and thus indentations are also 8 characters. There are heretic movements that try to make indentations 4 (or even 2!) characters deep, and that is akin to trying to define the value of PI to be 3.

    Rationale: The whole idea behind indentation is to clearly define where a block of control starts and ends. Especially when you’ve been looking at your screen for 20 straight hours, you’ll find it a lot easier to see how the indentation works if you have large indentations.

    Now, some people will claim that having 8-character indentations makes the code move too far to the right, and makes it hard to read on a 80-character terminal screen. The answer to that is that if you need more than 3 levels of indentation, you’re screwed anyway, and should fix your program.

    In short, 8-char indents make things easier to read, and have the added benefit of warning you when you’re nesting your functions too deep. Heed that warning.

    The reasoning seems sound, but I still prefer 4 personally.












  • I use debian 12 on my work laptop. I agree with your points but I still use it because I want the fundamental system to be stable, and then any software I want to be more up-to-date I build from source (tmux, alacritty, neovim) or download separately (vscode/slack/joplin).

    I used to use ubuntu because it worked so well with my hardware ootb, but I got tired of snap.


  • I will sound really nit-picky buy the biggest thing keeping me away from using KDE is that accent-colored bar on each window in the taskbar, and the different coloring of open/focused/minimized windows. I want it sleek but not cluttery.

    I’ve tried about a dozen themes but I couldn’t find any that got rid of that and looked good. I tried fixing it myself but editing svg files was too difficult for me.

    I hope plasma 6 adds more options for this but I’m not holding my breath.


  • Something i especially appreciate about winget us that it will “index” (or whatever you want to call it) software that was installed outside of it. For example if I install app XYZ through an .msi setup file, I can update it using winget.

    So it seems I can also use scoop or chocolatey to install new software and then keep managing them through winget.





  • I haven’t gone though it in detail but something that stood out to me is the complexity of process_content().

    If you at some point end up with a large function, or if you have deeply nested blocks, it can help readability to split it up into smaller functions with more clear goals, even if they are only called once. In your case you could keep process_content() as a sort of parent function for calling smaller ones.

    I’m guilty of large functions too because it’s easier to just add stuff to a single function while developing and debugging, but before I submit stuff I tend to go through and clean up by doing this.

    Though I guess this is sort of opinionated too!