Every now and then people get into silly arguments about which programming language is “faster.” I always ask, faster for what? Faster compile-run-test cycle, faster to write correct programs, faster to run…? Besides, each language is tuned for certain usage patterns, making like to like comparisons impossible.
Category Archives: Java
How the main thread is created in Java
To create a thread in Java you create a Thread object and call its start method. This raises the question, how is the very first thread of an application started? If it’s created calling the start method, which thread calls it?
Where Java system properties come from
The reference implementation of Java, OpenJDK, has been open source since a long time now, which means we can look under the covers and see the minute implementation details of anything we find interesting or the API doesn’t fully specify. For example, let’s have a look at how the system properties like file.encoding, os.name and …
Sorting a linked list
For God’s sake, don’t try sorting a linked list — Steve Yegge Why would it be a bad idea to sort a linked list? A few things come to mind: To locate the nth item you have to go through the n-1 items that precede it. This makes the formulation of many sorting algorithms unusable …
Java and File Names With Invalid UTF-8
On Unix systems – Linux and OS X included – file names can be arbitrary binary data with very few limitations. This means that in order to make sense of the name a character encoding must be used. Recently UTF-8 has become the default encoding on many systems, but sometimes you have to deal with …