Skip to content

The point of BinaryOperationInTimber lint rule #132

@bomiyr

Description

@bomiyr

Can you describe the benefits of using String.format instead of creating string with '+' sign?
As I understand, appending strings with '+' should be much faster because it will be compiled to StringBuilder operations, when String.format should at first parse string (for '%s', '%d' etc.) and only after that insert all parameters into proper places.
Also '+' is simpler, when String.format can be cause of problem during making changes (you must sure that all specifiers have right types (%d, %s) and all parameters are in proper places)
Also it's often simpler to read code with '+', (just my opinion)

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions