Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

nonsense

this line has zero readability

you're not writing code for compilers, you're writing code for people



I prefer inferred types when available. Then an IDE and compiler can get together to provide further details when needed. Honestly f: MyStupidInterface = myStupidMethod(); doesn't tell me much more.


The era of strong vs weak typing debate has passed. Adopt strong typing, like a professional, or fade into the 90s web. Harsh but fair.


practically all modern strongly typed languages are adopting or already had type inference from day one, allowing you to do things like var. They give up nothing in terms of strong typing to do so. Forcing people to write manual boilerplate does not equal professional, what a strange take.


The engineering trade-offs are paid somewhere, better in an objective space than a subjective one.


i dont know what you mean by this?

Fundamentally, this is a story of technology getting better (type inference in compilers) so humans can do less work. We're not pushing the work to some other human place. We're not losing anything in safety, and we're gaining in readability, boilerplate and expressiveness. Its progress!


Noone is arguing for weak typing. They're arguing for type inference. They're not even slightly the same thing


The era of not knowing the difference between static typing, strong typing, and type inference is past. I'm the sort of professional who likes to learn computer science.


> you're not writing code for compilers, you're writing code for people

i agree, thats why i don't want to clutter my code with annotations designed for the compiler, not humans. Type inference is a _good_ thing for readability.


You can just the type hints in the IDE for bad code like the above example. But glancing through my code, that is never an issue in practice because code reviews should have caught the poorly named variable and method.

Since the actual size of the code base isn't an issue in the modern world, I personally like that the Kotlin ecosystem discourages the use of esoteric names and non obvious abbreviations. Once you write and read enough of it you stop making poor choices.


Nonsense is doing compiler work yourself, even bigger nonsense is duplicating for zero reason.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: