Suggestion: Java default imports for streams and functional interfaces


#1

The current templates for Java all start with imports for java.util.*, java.io.*, and java.math.*. It would be really helpful (especially for Clash of Code speed/reverse) if that could also include java.util.function.* and java.util.stream.*, which contain the functional interfaces and helper classes for functional/stream programming.

The one that always seems to trip me up is java.util.stream.Collectors.


#2

While we’re at it, remove the default import for java.io.*;
There’s almost nothing in there that’s useful for CodinGame other than possibly Input/OutputStreams. However, since almost everyone uses Scanner, they’re only useful for the madlads who try out ridiculous things (sorry if I offended anyone).


#3

import java.io.* is useless.
import java.math.* is even more useless.

All functions in Math are static. So when cosine is needed, write Math.cos(x). When square root is needed, write Math.sqrt(x). No need to import java.math.*

CG should consider removing them from the java template.

Optional for adding streams as these are not my must-have classes.


#4

java.math.BigInteger/BigDecimal are occasionally useful. And I don’t really care that there are unused imports. It’s just really annoying to constantly have to (manually) add the imports for streams and functional interfaces, since I’ve started using them fairly frequently.