News for hackers. Stuff that matters.
Re:Why Kotlin is my next programming language (2015) by Bromskloss on Saturday June 18, 2016 @08:17PM (#11931228)
What is it that makes you not having to write so many tests?
Re:Why Kotlin is my next programming language (2015) by smt88 on Saturday June 18, 2016 @08:27PM (#11931251)
A decent type system
Re:Why Kotlin is my next programming language (2015) by StavrosK on Saturday June 18, 2016 @08:30PM (#11931263)
Without looking, I'm guessing static typing.
Re:Why Kotlin is my next programming language (2015) by iends on Saturday June 18, 2016 @08:30PM (#11931261)
Static typing.
Re:Why Kotlin is my next programming language (2015) by Bromskloss on Sunday June 19, 2016 @04:16AM (#11932233)
Is the reasoning that you then don't have to test what happens if you pass a parameter of the wrong type to a function?
Re:Why Kotlin is my next programming language (2015) by bbcbasic on Sunday June 19, 2016 @04:44AM (#11932293)
The compiler guarantees it won't happen. Such a test would be a test of the compiler and in my opinion unnecessary. And in Haskell at least... impossible. You can't write the the test because IT won't compile!
Re:Why Kotlin is my next programming language (2015) by Bromskloss on Sunday June 19, 2016 @05:16AM (#11932352)
I understand that. My question is if that is the kind of tests that people have in mind when they say that static typing requires fewer tests.
Re:Why Kotlin is my next programming language (2015) by bbcbasic on Sunday June 19, 2016 @05:31AM (#11932373)
I can't speak for anyone else but I believe so yes.
Re:Why Kotlin is my next programming language (2015) by iends on Monday June 20, 2016 @09:47AM (#11937971)
Yes. When writing JS you have to explicitly do a lot more validation.