robinm

joined 1 year ago
[–] robinm@programming.dev 7 points 6 months ago

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

[–] robinm@programming.dev 2 points 6 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.

[–] robinm@programming.dev 8 points 6 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".

[–] robinm@programming.dev 1 points 6 months ago

A fun read but it really seems that his writting style is hit or miss!

[–] robinm@programming.dev 10 points 6 months ago

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

[–] robinm@programming.dev 2 points 6 months ago

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

[–] robinm@programming.dev 2 points 8 months ago* (last edited 8 months ago)

It's so anoying that at $WORK we have multiple git repos with symbolic link that points above their respective .git to each other and need to be in sync. So of course git workree and git bisect don't work that well…

[–] robinm@programming.dev 5 points 8 months ago

For those who don't know (I assume you do), you can git bisect run some_command and git will automatically run git bisect until it finds the falty commit. It's amazing.

[–] robinm@programming.dev 30 points 8 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.

[–] robinm@programming.dev 2 points 8 months ago

I reread that article every years for a few years. Each time my understanding of git improved significantly.

[–] robinm@programming.dev 3 points 8 months ago

I reread that article every years for a few years. Each time my understanding of git improved significantly.

[–] robinm@programming.dev 11 points 8 months ago (2 children)
view more: ‹ prev next ›