Ruby's Strings and What Java Can Learn From Them
Ruby's Strings aggregate a collection of bytes and an encoding, allowing for IO to avoid transcoding, regular expressions to execute against raw bytes, and 7-bit strings to be compactly represented. Only the last item has been adopted by Java. To make matters worse, most Java APIs depend on Java's string representation, making them incompatible with alternative languages like Ruby. We'll explore the advantages of Ruby's string compared to Java's and discuss options for improving Java's string support in the future.