←back to thread

2024 points randlet | 1 comments | | HN request time: 0s | source
Show context
js2 ◴[] No.17516019[source]
Background ("PEP 572 and decision-making in Python"):

https://lwn.net/Articles/757713/

replies(2): >>17516132 #>>17516693 #
jcelerier ◴[] No.17516132[source]
> The problem with the C-style of assignments is that it leads to this classic error: if(x = 0) {...}

yeah, if you code on 20 years old compilers with no warnings. GCC 4.1 warns about this (with -Wall) and Clang 3.4 warns about this too, without any warning flag.

replies(4): >>17516174 #>>17516220 #>>17517715 #>>17518178 #
Waterluvian ◴[] No.17516174[source]
I think that having strong opinions on how others should be developing software is how communities become toxic like this.

"Shooting yourself in the foot is your fault for not using a linter that detects accidental misuse of assignment!"

replies(3): >>17516217 #>>17516742 #>>17516875 #
jcelerier ◴[] No.17516217[source]
> I think that having strong opinions on how others should be developing software is how communities become toxic like this.

Depends on what you think the answer to "is programming an art or a science" is. People who build bridges are absolutely subject to "strong opinions" on how to build bridges. I am of the opinion that shipping software to others when under a contract without using all the facilities available to prevent problems - linting, static type checking, etc - should be considered at best a breach of contract and ideally criminal negligence.

replies(4): >>17516414 #>>17516463 #>>17516818 #>>17520374 #
woah ◴[] No.17516818[source]
Thinking that linting and static typing will stop all errors is foolish (although I prefer both, myself). Cargo culting "best practices" is often useless, and is sometimes used as a crutch by developers who are bad at the much more important and much less quantifiable things, like code readability and architectural simplicity.

Wanting your pet coding preferences to be enforced by criminal law is a sadomasochistic fantasy.

replies(2): >>17517481 #>>17520898 #
1. vehementi ◴[] No.17520898{3}[source]
> Thinking that linting and static typing will stop all errors is foolish

Did you reply to the wrong post?