4 ms·
>/* aIgnoreCase = */ true Very interesting, is that comment inserted automatically by an IDE?
by iqanq 5y ago
>/* aIgnoreCase = */ true
Very interesting, is that comment inserted automatically by an IDE?
- matsemann 5y agoA nice way to tell what the random bool parameter does, without having to declare a variable with ignoreCase=true first and pass in to self-document. But at least JetBrains IDEs show inline the parameter names, and multiple languages have named parameters, which for booleans at least is a nice thing.
- nerdponx 5y agoThis is a great reason why programming languages should support named arguments.
- _moof 5y agoThis is standard practice in a lot of places because bare Booleans in parameter lists don't communicate anything useful to the reader. Don't know if there are IDEs that automate it though. (In most languages one should avoid designing functions that take Booleans like this in the first place and use a flags/options parameter instead.)
- nyuszika7h 5y agoIn Python, you can just specify `foo=bar` when invoking the function, or even better, make `foo` a keyword-only argument.