Ben Chuanlong Du's Blog

It is never too late to learn.

String vs Bytecode in Python

Comments

  1. Be careful that some functions return bytecode instead of string in Python 3.

  2. bytecode has similar APIs to str. Most string functions can be applied to bytecode as well.

String to Bytecode

String in Java

Comments

  1. String is a immutable class in Java. Extensive operations on strings (e.g., + in a big loop) is usually very slow before Java 7 (the + operator is optimized by the compiler automatically starting from Java 7). To avoid this problem (in older versions of Java), you can use the StringBuilder