by ars · 13y ago · 0 comments
Especially if you program in multiple language it can be jarring to switch styles for each language.
I think that flexibility of style has been getting less and less favor recently : a lot of languages are starting to "force" some elements (such as indentation) , and go has done the most intelligent thing ever and ships with a formatter so that there's only 1 "right" way to write things.
Formatting issues is the source of so much bike-shedding, despite that it really shouldn't be much of a productivity sink in 99.9% of situations.
Take C# and the BCL. C# is a language but you'd be hard pressed to avoid using the BCL in any meaningful C# program.
String.Format("Hello {0}", stringVariable);
All (nearly all?) the function names in the BCL are UpperCamelCase, and a lot of C# code follows that as a convention.Repeat for class names, interfaces prefixed with I, public properties etc.
But if I'm writing code for someone else I try to follow the language's conventions if possible. Especially if it's a library that will be combined with other libraries and application code that does follow native conventions.
After all, it's also jarring to write code in one language that has to use multiple styles because it integrates libraries that weren't consistent with the common language conventions.