[-] UlrikHD@programming.dev 4 points 1 year ago

Please follow our Code of Conduct when interacting with our instance. Hate speech violates section 3.5 and in this instance is severe enough to lead directly to a temporary ban instead of the usual warning. Repeated offences may lead to a permanent ban.

[-] UlrikHD@programming.dev 3 points 2 years ago

That should actually work great, in the absence of being part of the API, thanks! Funnily enough the copilot autocomplete suggested that when I was formatting the url param.

[-] UlrikHD@programming.dev 3 points 2 years ago

The person has previously been warned to stopped posting links to the site. They've now been given a temp ban, if that doesn't deter them, they'll be given a permanent ban and we might ban the site from our instance.

[-] UlrikHD@programming.dev 2 points 2 years ago* (last edited 2 years ago)

There's way more to a game's look than textures though. Arguably ray tracing will have a greater impact than textures. Not to mention, for retro games, you could just generate the textures beforehand, no need to do it in real time.

[-] UlrikHD@programming.dev 2 points 2 years ago

Please refrain from using personal insults in this community. You're free to express your opinion, but personal insults does nothing but make the community more toxic. c/programming is a gathering ground for both inexperienced and experienced programmers, so this level of lashing out is uncalled for.

[-] UlrikHD@programming.dev 3 points 2 years ago

Nobody would ever say "Asian" when referring to the south east Asians powers though. Call it European colonial powers or something. It gets tiresome being lumped in with destruction caused by Britain, France, etc... when your own nation was nothing but potato farmers at the time.

[-] UlrikHD@programming.dev 3 points 2 years ago

Depends on the file, very simple files may only warrant npp, but VSCode for more complex stuff where live preview may come in handy.

[-] UlrikHD@programming.dev 2 points 2 years ago

Stockholm syndrome from whatever the convention is for your daily programming language. Long live snake case 🐍

[-] UlrikHD@programming.dev 2 points 2 years ago

Just be a decent human being and use type hints in python, problem solved.

[-] UlrikHD@programming.dev 3 points 2 years ago

putting thumbnails in the file selection dialog

Could you elaborate what you by this?

[-] UlrikHD@programming.dev 2 points 2 years ago

Language specific communities

[-] UlrikHD@programming.dev 3 points 2 years ago* (last edited 2 years ago)

Obviously this is opinionated and I won't pretend it's the only correct way, but a few things that stood out to me was.

  • inconsistent use of type hinting. You type hint the "elem" arg for process_content and nothing else. Personally I use type hints religiously, but at the very least I would type hint every arg. The type may be obvious to you now, but it may not in 6 months, or for others who want to contribute.

  • while on the topics of type hints, you use "#" to comment the purpose of each function, but you really should use docstrings instead. Text editors supporting python will then use the docstrings to show users the description of each function without you having to jump to the declaration to read the description. It's particularly useful when you got multiple modules. For some IDEs like pycharm, the same format works on variables too.

  • You should wrap up your bottom infinite loop in if __name__ == '__main__': to avoid getting locked if you down the line want to reuse the class/module and import it into another file.

And the most opinionated point of them all:

  • I would recommend running a linter like pylint to warn about potential code smells. E.g. you're redefining the python built-in "id", no exception types are specified in your try blocks, too many branches and statements in process_content() which would probably benefit from being segmented into smaller functions, lines that are twice as long as the recommended length, wrong import order, etc... (these are purely pylint feedback)

I assume the setup is the same with GitHub's ci, but with GitLab you can automate pylint to check the the code with this:

  image: python:3.10
  script:
    - pip install pylint
    - pylint *folder*```
view more: ‹ prev next ›

UlrikHD

joined 2 years ago
MODERATOR OF