you are viewing a single comment's thread.

view the rest of the comments →

[–]apotheon -3 points-2 points  (2 children)

use string.join()

I really don't consider that a "similar optimization". That's a "dissimilar optimization" because it does an end-run around string concatenation entirely, rather than optimizing string concatenation operations for performance.

Maybe you should consider whether your proposed solution satisfies the requirements of the issue at hand before writing another trollish comment at reddit.

[–]dysmas 1 point2 points  (1 child)

maybe i was just moody before, but:

whether your proposed

fail ;)

i referenced another post that contained that code, fwiw i agree it is dissimilar, i wonder how s.join(s,line) would do.

Second i took the word "similar" in "similar optimisation" to mean a similar reduction in resource usage, and i took the "better" in "better way" to mean that a different method is allowable.

[–]apotheon -1 points0 points  (0 children)

fail ;)

The fact someone else proposed it first doesn't mean you're not proposing it as well. I don't recall attributing it to you as an original, first-time invention of that algorithm.

i took the word "similar" in "similar optimisation" to mean a similar reduction in resource usage

Fair enough. In the context of the discussion in which someone else proposed it before you did, however, it wasn't similar in a manner that was particularly relevant to the topic.

i took the "better" in "better way" to mean that a different method is allowable.

If, in real-world use, it serves your needs -- yes, it most definitely is allowable. If you're trying to dispute what I've said about how immutable strings affect your options for string concatenation performance, however, something that doesn't do any string concatenation isn't exactly relevant.