pull down to refresh

Image source
I like Python a lot. But this fcking design decision is so annoying. I cannot tell you how many times I have tumbled over this now by accident.
15 sats \ 2 replies \ @franzap 5h
Python is a great language but I don't like the aesthetics (of the language and the community). I like working with beautiful things. Ruby is much better in this respect
reply
aesthetics of the language?
aesthetics and the community?
reply
0 sats \ 0 replies \ @k00b 4h
I would agree. Python is kind of like helvetica and Ruby is more like caligraphy. Meaning, there's something about Ruby's aesthetics that make it feel more like art.
reply
I didn't know this. I thought method params are newly instantiated and destroyed each function call.
Learn new things everyday.
reply
22 sats \ 0 replies \ @nikotsla 6h
Using mutable objects as default values is a bad idea. I think that's the premise, but yea... "default value" is odd.
reply
17 sats \ 0 replies \ @ek 6h
Interesting, I thought all this time this isn't limited to Python but a general reference vs value problem. However, Javascript doesn't express this behavior:
function surprise(myList = []) { console.log(myList) myList.push(1) } surprise() // prints [] surprise() // prints []
reply
5 sats \ 1 reply \ @k00b 4h
Why did they do this? I assume it's useful in some respect or maybe it's just easier for the interpreter.
reply
I can't tell you for sure why this decision was made but this concept is only strange to us coming from modern programming languages that have a strong separation between what is code and what is data .
An example of this is e.g. the let-over-lamda paradigm where you can change what a function does by calling it.
reply