Worst ideas/features in programming languages?
glis-glis
andreas.fueglistaler at gmail.com
Mon Nov 1 09:45:10 UTC 2021
On Monday, 11 October 2021 at 15:59:10 UTC, Atila Neves wrote:
> * Worst features implemented in a non-toy language
Python: Assign operator meaning different things in different
context
`x = 3`
Can mean "create a new variable x with value 3" or "assign the
value 3 to variable x". This can hit you both ways, I had bugs
because I misspelled a variable and created a new variable
instead of assigning a new value to an existing one, and I
inadvertently changed the value of an existing variable instead
of creating a new one. Because of this, I am also very skeptical
of Rust's "variable shadowing" feature.
Python passing by reference unless it doesn't:
`i=1; j=i; j+=2 `
-> i = 1, j=3
`li=[1]; lj=li; lj += [2]`
-> li = [1,2], lj = [1,2]
> * Worst features (in your opinion) in D
- char[] pretends to be an array but is actually more like a
linked list
- lots of attributes and keywords
> * Features you'd like to see in D
- Cleaning up the attributes
- Making the language simpler, not more complicated
Concerning the "or" vs "||" discussion, as a non-native English
speaker, I learned programming as a teenager with barely any
English knowledge, and was attracted to the C/C++ syntax as it
depends less on English compared to Pascal's syntax.
An English-agnostic programming language would be nice to help
non-native English speakers to get into programming more easily,
but how would you replace keywords like "if", "while" or "for"?
More information about the Digitalmars-d
mailing list