[-] FizzyOrange@programming.dev 2 points 7 months ago

adding RSSI might only work on newer devices, since classic pebbles are just Bluetooth and Bluetooth le

I don't follow. It's extremely unlikely that the actual hardware doesn't give you RSSI.

[-] FizzyOrange@programming.dev 2 points 1 year ago

Definitely a promising language, and I tried to write something with it a year or so ago. It's clearly still in the "research language" phase though; "hello world" took about 2 minutes to compile.

[-] FizzyOrange@programming.dev 2 points 1 year ago

Yeah I agree. Presumably they don't do that though because you'd end up with pages of nothing but ).

I never understood why they don't add just a little syntactic sugar. You don't need much to take it from a mess of brackets to something comprehensible.

[-] FizzyOrange@programming.dev 2 points 1 year ago

What makes you think it's making a pointer? Nobody said anything about that.

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

Haha this is also the classic Linux experience. Any complaints about stuff not working properly get met with "It works for me" and "You're doing it wrong". Oh and don't forget "did you submit a bug report?" and "if you don't like it, fork it!".

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

The only way you know before doing it is through experience. If you don't already know you can make a prototype, or just guess and go for it - you might have to change it later though.

I would recommend prototyping when the cost of correcting a wrong decision later is going to be really high.

The other option if you don't have experience is just to copy what other people have done.

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

And there's a reimplementation of Git in Rust. Not sure how complete it is though.

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

I agree, those are fantastic icons. Very clear.

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

Well they still have runtimes, but yes they can be pretty minimal.

You're still shipping a load of libraries that come for free with JS though, e.g. with Rust WASM string formatting and unicode support always ends up being annoyingly huge, and that's built in to JS engines. There's also collections (Map, Set), etc.

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

I can give you some basic Python set-up advice (which is hard-won because nobody tells you this stuff):

  1. Use pyproject.toml, not requirements.txt. It's better and it's the recommended way.
  2. Always use type annotations. I saw you used it a bit - well done! But just use it everywhere. Add declarations & type annotations for your class member variables. You'll thank me later! Also prefer Pyright to Mypy; it is far far better (and the default for VSCode).
  3. I would recommend using Black to autoformat your code. It's easily the best Python formatter. You can automate it using pre-commit.
  4. ALWAYS PUT MAIN IN A FUNCTION. You should not run any code at a global scope. Do it like this:
def main():
  ...

if __name__ == "__main__":
    main()

There are two reasons:

  1. Generally it's good to keep variables to the smallest scope possible. Putting everything in a global scope will just mean people start using it in their functions, and then you have a mess.
  2. Any code you put in a global scope gets run when you import a module. Importing a module should not have any side effects.

Other minor things:

  1. Path has a crazy/neat override of the / operator so you can do Path("foo") / "bar" / "baz.txt".
  2. Don't use assert for stuff that the user might reasonably do (like not choosing a background image). assert is meant to be for things that you know are true. You are asserting them. Like "hey Python, this is definitely the case".
  3. TK is an ancient shitty GUI toolkit. I would recommend QT instead (though it will probably be more pain to set up).
[-] FizzyOrange@programming.dev 2 points 2 years ago

Python is going to die eventually. It's too slow and the infrastructure is too painful for it to survive super long term.

It's ridiculous popular now though so it's going to take decades to die down.

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

Never to be seen again...

Seriously though this feels a lot like those books that start with "How to read this book" sections.

view more: ‹ prev next ›

FizzyOrange

0 post score
0 comment score
joined 3 years ago