

I really wish kscript would catch on. Kotlin is an excellent language and I have enjoyed using it for some utility scripts.


I really wish kscript would catch on. Kotlin is an excellent language and I have enjoyed using it for some utility scripts.


Kscript catches dependencies and compiled output. First run compiles, second is fast.


I thought it was clear that I was responding to “if you forget to assign a value to one of them, since the object constructor will likely assign an unknown default value.”
I’m not defending the article.


That depends entirely on how the object is constructed. Plenty of implementations use object.new() and you’re expected to fill in the blanks.
That’s because some languages simply do not give a shit about data types. They’re just like “your opinion man” and can even vary at runtime which creates lots of exciting errors as you’re pointing out. Enjoy writing lots of type-checks.
In a language that does care about types you can control that and don’t worry about it.
Besides, even if you have a constructor that takes parameters, it’s essentially the same as calling a function. Get it wrong and stuff breaks.
data class UserRequest {
val id: Int,
val name: String
}
No guesswork. All values must be provided and none can be ‘null’. Well designed languages help you avoid such problems. Poorly designed languages facilitate it.


if you forget to assign a value to one of them, since the object constructor will likely assign an unknown default value.
This bit - in a language that cares about types that should either not be possible or difficult to do by accident.


If you’re using a language that cares about data types that’s not possible.
And it works - scotus in their infinite stupidity decided they can’t judge whether something is a national security issue or not.