• 82 Posts
  • 1K Comments
Joined 2 years ago
cake
Cake day: June 15th, 2023

help-circle
  • You mean alignment of arguments or multiline strings in example? If they are not on their own line, then it does not matter to me. If they start on their own line, then mixing spaces and tabs isn’t a good idea to me. In example for function calls with a bit more complex calls and multiple arguments, I put them in their own line each. They are indented and therefore indentation level plays. If they are on the same line, I never align them and if I would, it would be spaces. In general:

    function() {
    ....var = 1
    ....another_var = 2
    ....indented(arg, arg2, arg3)
    ....indented(arg, 
    .............arg2, 
    .............arg3)
    }
    


  • That’s not entirely true. Because even if you buy a strong PC, you have to make choices, depending on the game. It’s just the fps and settings we are talking about are higher floor. In example on PC people can enable RayTracing, which tanks the fps a lot. Do you go for 120 fps or 60 or maybe lower fps with higher fidelity and RayTracing in example.

    So the question to answer is still the same, its just on PC we have a bit more individual choices to make.

    Edit (added): Most people don’t have the strongest PC anyway. Look at the Steam hardware survery, most have common graphics cards like the 4060 in example. Or look at handheld PCs and laptops, with fixed hardware. And as said, even in high end with lots of money people need to make cuts in fidelity or performance; just on a higher level in that case. So your question applies to PC as well.


  • I think this question also applies to PC. Why? Because we are limited too. I try to reach 120 fps and consider it performance mode when dialing back quality settings, and enabling upscaling to reach that. If not, 90 fps is also pretty good. For certain games, 60 fps feels like what you describe of 30, but that does not apply to all games. There are single player rpgs played with a gamepad, that I would even consider playing at 30 fps if there is no other option. The problem is, games are not designed to be played with that low fps, as the input latency increases.

    I’ll compare this to the Switch, playing Zelda (emulated with Yuzu). Breath of the Wild on original Switch is designed to be played at 30 fps. Playing it on my PC like that felt like a slideshow, but one can get used to it. If I didn’t had the 60 fps patch, it would still be fine at 30. The next game in the series, Tiers of the Kingdom, was not stable at 60, so I was “forced” to play at 30. And after some time playing it felt pretty good and not upsetting like in the first few minutes.

    What I mean by that is, performance mode if possible, I would sacrifice quality. But not too much, because at some point the image looks really bad.



  • But this can lead to over engineering simple stuff. Which makes the code harder to read and maintain and more error prone. Especially if you don’t need all the other stuff for the class. Worse, if you define a class then you also tend to add more stuff you don’t use, just in case it might be useful.

    A simple variable name is sometimes the better solution. But it depends on the situation off course. Sometimes a new class make things more clear, as it abstracts some complexity away. Yeah, we need to find a balance and that is different for every program.


  • My rule of thumb is, use short names if the context makes it clear. But do not make names too long and complicated (especially with Python :D). For me having unique names is also important, so I don’t get confused. So not only too similar names are bad, especially if they all start like “path_aaa”, “path_bbb” and such, then the eye can’t distinguish them quickly and clearly. And searching (and maybe replace) without an IDE is easier with unique and descriptive names.

    Sometimes its better to come up with a new name, instead adding a modification and make the name longer. This could be in a for loop, where inner loops edit variables and create a variation of it. Instead adding something like “_modified”, try to find what the modification is and change from “date” to “now” instead “date_current”.






  • You don’t need to understand a command in order to copy paste an alias or Bash function. Especially newcomers could tend to do it, without knowing what the command actually does. We are also in a posting with helpful commands, so its double harmful. And you doubling down without adding any sort of disclaimer shows you don’t care.


  • There is an expression, Linux isn’t free it costs you your time.

    Just because someone said it does not make it true and certainly, I don’t have to live after that expression. It kind of is a catch all phrase to justify (or not to justify) everything. It could also be used as an argument for “Vibe Coding” (I hate that term…).

    I mean this argument about Linux does not apply to every single application (you apply it right now here to some random Python script). In example Windows, MacOS, Android, nothing is free and costs you your time. The question is, how you want spent your time. And I enjoy writing programs and scripts for various reasons.

    I personally think reinventing the wheel is great. Why? It makes you learn and do it. It makes you less dependent. The end result might not be the most polished one, but also if nobody reinvents the wheel, then we have no competition. Sure you should not reinvent everything, there is a balance act to make. And this balance is different for everyone else.


  • BTW, I’m not saying the way I am going and doing this is the right one. In the end I use additional packages when needed, BeautifulSoup as an example to make life really easier. But that is something specific to that script. Stuff like click and argparse is more than a single script, because when I switch to click then all my future scripts would depend on it. And I feel more comfortable with a solution that is already built-in (stdlib) if its not too bad.

    I don’t see click as a required package that I really need. And that is also true for many other packages, such as requests one.


  • Lemmy is a far better platform for discussions than Discourse in my opinion. The tree like sub-reply threads in each post (the Reddit concept) is preferable over a single thread of replies. You don’t need to cross quote and for readers no need to read the quote to see who and to what the reply is about. I don’t like Discourse discussion platforms at all.

    However, Discourse has a few features that fits well for a discussion platform. I like the tags and Trust system of it.


  • I use external packages for compiled languages. For scripting languages like Python, it makes it ab it harder to use. Because people are forced to install dependencies. I don’t like that (unless its a shell script, but that is by its nature a dependency hell).

    And for Python, I usually deliver the script as a single .py file, without requirements or special instructions, no typical file structure as well. And your argument just because other popular packages use a specific library does not mean I have to use it too. I don’t care what libraries other popular packages use, at least in context to my program / script.



  • It supports both and depending on the situation its more procedural or more object oriented. Do you consider the standard library as part of the language and are you forced to use it? Then certainly the object oriented parts of the language would be forced to use and therefore it is object oriented. Or do you only evaluate the language and its features itself? In that case, Python supports object oriented programming with classes and objects, but you are not forced to use it.

    Are we talking about the language features itself or the produced programs with it in the real world?

    So regardless if you look at the language itself or the common standard library that most Python programs use, objects and classes are an part of the language. Even if you write simple procedural scripts, does not take away that Python itself is a more object oriented programming language.


  • Nice. There is a reason why the standard library of Python does not get rid of optparse. optparse was I think marked to be removed in the future, but its no longer deprecated and will stay in the library.

    Click looks good and I would have looked in more detail. The problem to me is, it is a dependency. I usually write and try to write Python programs without external library dependency, unless it is absolutely necessary (like GUI or BeautifulSoup). Click “might” be a better alternative, but it is “only” something that does it a little bit better. This is not a reason for me to use an external library.