3 ms·
Java's type system is extreme with its checked exceptions. Try C# instead. I can see the value of checked exceptions for robustness but if you're just prototypi
by Too 13y ago
Java's type system is extreme with its checked exceptions. Try C# instead. I can see the value of checked exceptions for robustness but if you're just prototyping something it drives you nuts.
The specified classes for arguments is a good thing since you dont have to dig through piles of documentation or code review every method you use to understand their behavior.
What do you expect the arguments of the following function to be: 1. A file descriptor, or 2. A path to a file that will be opened by the function?
def print_log(file):
...
One could argue it's bad naming convention but i see shit like this way too often to think it can be solved by conventions. Documenting doesn't work either for the same reason, documentation becomes more boilerplate than specifying types in a type safe language btw.
Contrast this with the C# equivalent
void PrintLog(File file)
{ ... }
Bang!, You instantly know that the file parameter is a File-object and you can focus your mind on more important things.