I've been using Mathematica for a long time, so I have a habit of using some of the older functions even when newer, better ones have been added to replace them.
StringForm is one such function. I have the habit of using it with Print as the Mathematica analog of C's printf when I need debugging output. Today, when I found myself typing Print[StringForm[ ... once again, the thought "why am I not using Row?" occurred to me. Indeed, why not?
Row has been in Mathematica since ver. 6. It looks to me it can do anything that StringForm can do and a lot more. However, WRI has not deprecated StringForm, so I wonder: should Row always be used in place of StringForm? Or is there still some use cases where StringForm is better?
Rowas a more generic function that allows you to form a row of arbitrary items for visual appearances (e.g. strings and images) andStringFormas a more low level function that's useful in injecting values into a boilerplate message. In writing debugging messages, I findStringFormeasier to use because I can read the text in one go, rather than being broken as inRow– rm -rf♦ Dec 26 '12 at 3:40StringFormto format the output ofDate[]. But nowDateis deprecated and we haveDateString... So it's definitely true thatStringFormis not nearly as central to formatting asRowis. – Jens Dec 26 '12 at 3:46Rowwould seem to be preferred if you want to style words or phrases in Italic, Bold, etc., or with varying color or size or font family, for then you can useStyle. – murray Dec 26 '12 at 21:48MessageusesStringForm, so I think it can't be deprecated. – Sjoerd C. de Vries Dec 26 '12 at 22:25StringForm["x = ``", Style[1/3, Red]]yields aString, which looks the same asRow[{"x = ", Style[1/3, Red]}]but different thanRow[{"x = ", Style[1/3, Red]}] // ToString. Sometimes you might want aString(to put into string functions, I suppose); sometimes it might suit your style, such as the use rm -rf mentioned. – Michael E2 Dec 27 '12 at 20:39