• 0 Posts
  • 11 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
    21 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.



  • It’s when you open a publicly facing port and map (forward) it to a local port your machine. In this case, it’s opened at the vpn provider’s public gateway. Otherwise, it would typically be opened in your router instead.

    You can then configure your torrent client to listen on that local port that the public port is forwarded to. I think generally the public and the local port are the same number when using VPN.

    If you do that, then others have the ability to initiate a connection to you instead of only you being able to initiate the connection to somebody else.

    When seeding/leeching to/from someone else, at least one of you needs a port open. So, if you always have one open, you allow yourself to connect to anyone on the network regardless if they have one open or not.

    Sorry if I confused you more, I’m not that great at explaining.









  • We had some issues in our CI where pipenv would sometimes fail to sync. It has recently gotten better, I think due to a fix of some race condition due to parallel installation. I think venv would be better suited for CI in general, since it allows the use of a simple requirements.txt file.

    The other thing is I think it is rather slow, at least on windows which most of my team uses.

    To conclude, I think as long as you aren’t having any trouble and it simplifies your environment, you might as well use it.