Naddiseo/dart-sprintf

Why did you take class approach?

Closed this issue · 2 comments

I'm just curious. You could define just a function, but defined class PrintFormat. Why?

I didn't know dart when I wrote the library (it had only been announced a few months prior) so there wasn't a lot of idiomatic code to look at for inspiration. At the time I was using a lot of OOP design to solve things, and so it transferred over to dart. I also didn't know the scoping rules very well, so classes allowed me to encapsulate internal state without haven't to worry about access. I'd probably solve it differently if I were to rewrite it.

Thank you very much for a kind explanation!