5 ms·
You seem to also not know what "not statically typed" means. It certainly does not mean "not properly scoped".
by obua 5y ago
You seem to also not know what "not statically typed" means. It certainly does not mean "not properly scoped".
- ReleaseCandidat 5y agoYes, of course. But you see that no scope keywords exist in Python. But there exists `+` to concatenate strings (too).
- fragmede 5y agoKeywords like namespace, no; but functions and classes and modules provide for a lot of scoping opportunities.
- ReleaseCandidat 5y agoThe problem is `fop` should be `foo`: foo = 5 fop = 6 Keywords like `let` solve this problem: let foo = 5 fop = 6 # error
- ErikCorry 5y agoOr := for declaration like Go and Toit
- ReleaseCandidat 5y agoYes, or another symbol instead of `=` for assignment, like `<-` (F#)
- deathanatos 5y agoNot entirely: let foo = a(); let foo = b(foo); let fop = c(foo); let foo = d(foo); (Which is valid, e.g., in Rust.)
- TheEzEzz 5y agoYou do get a warning, though. And most Rust projects I've seen usually adhere to 0 warnings.
- renox 5y agoI hate variables shadowing, I'm very surprised that they allowed it in Rust, I saw an unpected behaviour caused by variable shadowing in C++ (global variable hidden by member variable) just last week..
- Too 5y agoA good IDE has many other safety nets for that error. Auto completion, highlight matching variable, gray out unread variables and warning of unused assignment. I’ve written lots of python and can’t recall ever having this issue. More likely is a logic typo of two similar variables like length_x vs length_y, where a “let” wouldn’t have saved you anyway if both are already defined. JavaScript, pre strict TS, on the other hand, where missing var implied global was a real motherload of bugs. Or kotlins “val” vs “var” changing semantics completely…wow. But those are different concepts from basic definition I know.
- wruza 5y agoI left python around the times of 2/3 drama, are nonlocal and global not there anymore?