News for hackers. Stuff that matters.
Re:On the Impact of Programming Languages on Code Quality by dragonwriter on Wednesday June 05, 2019 @04:44PM (#20108931)
> Like Smalltalk, they're forced to do this to catch the errors that would've been caught by type annotation.

Very few of the unit tests I've written for Ruby/Python catch errors that would be caught by typical type system use in C/Java/etc. (Haskell, maybe, but...) The main thing I miss in dynamic languages vs. static is the more powerful automatic testing possible when test specs can leverage type information (e.g., QuickCheck/ScalaCheck), not an absence of need for testing.

Re:On the Impact of Programming Languages on Code Quality by larzang on Wednesday June 05, 2019 @09:20PM (#20110720)
Yeah it's easy to see writing in dynamic languages with optional typing and static analysis tools (e.g. JS with TS/Flow, PHP with phpstan or psalm), the type analysis finds all kinds of different and subtle problems that unit tests probably wouldn't catch. Large integration tests often would, but are even harder to write exhaustive cases for.

Types just make everything easier to do right the first time.

Re:On the Impact of Programming Languages on Code Quality by joshlemer on Wednesday June 05, 2019 @05:05PM (#20109127)
I've only ever done property based testing in Scala, but I thought it was pretty popular in dynamic languages like clojure and erlang. What would prevent it from working in Ruby/Python?
Re:On the Impact of Programming Languages on Code Quality by dragonwriter on Wednesday June 05, 2019 @05:11PM (#20109183)
Without type information already in the code (for parameters, etc.) there would be a lot more overhead in setting it up; it's possible, but higher marginal friction in the ideal case.

Plus, AFAIK, no one has written the libraries, making it even higher marginal friction in practice even more than than is true in the ideal case.

Re:On the Impact of Programming Languages on Code Quality by ramchip on Wednesday June 05, 2019 @08:12PM (#20110349)
Type information generally isn’t used when doing property testing in Elixir, and Python has a very mature library too (hypothesis). If there’s a difference in popularity, it could just be culture. The Erlang/Elixir community is rather fanatical about reliability.
Re:On the Impact of Programming Languages on Code Quality by dragonwriter on Friday June 07, 2019 @04:18AM (#20122628)
Hypothesis uses the same type annotations as Python's optional typechecker as a tool to select appropriate input data generators without additional test-specific description. That's a fairly common feature of property-based testing tools; I don't know for sure, but I wouldn't be surprised to find that hypothesis and mypy tend to be used in the same segments of the Python community.
Re:On the Impact of Programming Languages on Code Quality by darkmarmot on Wednesday June 05, 2019 @06:35PM (#20109820)
We use property testing with Elixir (erlang VM) -- and it would translate perfectly well to Ruby or Python. I also think it's a community difference, not a technical one.