robinm

joined 1 year ago
[–] [email protected] 6 points 1 month ago (1 children)

This post from 2022 was very interesting:

There are approximately 1.5 million total lines of Rust code in AOSP across new functionality and components [...] These are low-level components that require a systems language which otherwise would have been implemented in C++.

To date, there have been zero memory safety vulnerabilities discovered in Android’s Rust code.

https://security.googleblog.com/2022/12/memory-safe-languages-in-android-13.html

[–] [email protected] 0 points 4 months ago

Thank you! I didn’t realized that I was using my lemmy account and not my mastodon account.

 

Hello,

I’m trying to follow Lennard Poetting (@pid_[email protected]) from my programming.dev account without success.

On its user profile on mastodon.social, when I click on the “follow” button, then enter “programming.dev” (which is in the completion list) then “take me home”, I am redirected to https://programming.dev/authorize_interaction?uri=https%3A%2F%2Fmastodon.social%2Fusers%2Fpid_eins which is a 404 error.

I also tried to search for “@pid_[email protected]” directly from programming.dev, found it, but 0 toot, and no button to be able to follow it.

Am I doing something wrong? Is mastodon.social and programming.dev not federated?

[–] [email protected] 2 points 4 months ago

I absolutely agree that method extraction can be abused. One should not forget that locality is important. Functionnal idioms do help to minimise the layer of intermediate functions. Lamda/closure helps too by having the function much closer to its use site. And local variables can sometime be a better choice than having a function that return just an expression.

[–] [email protected] 8 points 4 months ago (3 children)

Good advice, clear, simple and to the point.

Stated otherwise: "whenever you need to add comments to an expression, try to use named intermediate variables, method or free function".

[–] [email protected] 10 points 5 months ago

I never understood why python won agaist ruby. I find ruby an even better executable pseudo code language than python.

[–] [email protected] 0 points 5 months ago

Awesome! It reminds me of that clip that uses the windows task manager to run doom on a 896 core CPU.

[–] [email protected] 30 points 6 months ago

Read your own code that you wrote a month ago. For every wtf moment, try to rewrite it in a clearer way. With time you will internalize what is or is not a good idea. Usually this means naming your constants, moving code inside function to have a friendly name that explain what this code does, or moving code out of a function because the abstraction you choose was not a good one. Since you have 10 years of experience it's highly possible that you already do that, so just continue :)

If you are motivated I would advice to take a look to Rust. The goal is not really to be able to use it (even if it's nice to be able able to write fast code to speed up your python), but the Rust compiler is like a very exigeant teacher that will not forgive any mistakes while explaining why it's not a good idea to do that and what you should do instead. The quality of the errors are crutial, this is what will help you to undertand and improve over time. So consider Rust as an exercice to become a better python programmer. So whatever you try to do in Rust, try to understand how it applies to python. There are many tutorials online. The official book is a good start. And in general learning new languages with a very different paradigm is the best way to improve since it will help you to see stuff from a new angle.

[–] [email protected] 0 points 6 months ago

I wasn't clear enough. But in a contry where the sun rise at 20:00, the weekday looks like:

  • day 1: Monday morning to Tuesday evening
  • day 2: Tuesday morning to Wednesday evening
  • day 3: Wednesday morning to Thurday,

And phares like "let's meet on Tuesday“ without hour indication could either mean end of day 1 or start of day 2. Likewise "let's meet the 20th” (assuming the 20th is a Tuesday) could either mean end of day 1 or beggining of day 2.

--

And alternative be to have

  • day 1 == Monday == “end of the 19th” to “the start of the 20th”
  • day 2 == Tuesday == “end of the 20th” to “the start of the 21st”
  • day 3 == Monday == “end of the 21st” to “the start of the 22nd”

Which solve the issue of "let's meet on Tuesday”, but not “let's meet the 20th”.

[–] [email protected] 0 points 6 months ago (3 children)

The issue is that the notion of "tomorrow" becomes quite hard to express. If it’s 20:00 when the sun rose, when does tomorrow starts? In 5 hours ?

[–] [email protected] 0 points 7 months ago

Interesting idea indeed. I've never used async yet, but I'm always surprised at how the problem space seems to be much more complicated than what it initially looks like.

[–] [email protected] 0 points 7 months ago

You shouldn't, it's short and interesting

[–] [email protected] 11 points 7 months ago

I would have liked a link to the LKLM thread. Usually they are quite informative

view more: next ›