Not to be confused with patriotism.
Nationalism is an ideology which emphasises the distinctiveness of a nation and usually points to its statehood. Nationalist movements arose with the development of capitalism and the state. In the nineteenth century, Karl Marx supported some nationalist movements because they were historically progressive in that they served the class interests of the rising bourgeoisie in its struggle against the traditional aristocracy. In the twentieth century, nationalism was, and still is, associated with movements for self-determination and ethnic cleansing.
Marxists generally do not support nationalist movements. Certainly communism will allow the fullest linguistic and cultural diversity, but this cannot be achieved through nationalism. Marxism explains how workers are exploited and unfree, not as particular nationalities, but as members of a class. To be in an oppressed minority at all it is usually necessary to first belong to the working class. From this perspective, identifying with the working class provides a rational basis for political action. The objective is a stateless world community of free access. Given that nationalism does nothing to further this understanding, however, it is an obstruction to world socialism.