Why string concatenation in loops is a bad programming strategy.

I’m finally back after a long vacation, thanks to the pandemic. Having said that, let’s go back to business.

Why string concatenation in loops (SCL) is a bad programming strategy.

String concatenation in loops (SCL), is often used in sequencing analysis; for instance, for finding complement and reverse complement sequences, for DNA to RNA translations, and so forth. It is also used for generating random sequences, and DNA data storing.

I’m currently writing an article on this subject. A little snippet follows:

“SCL is a common strategy because of its simplicity. In many programming languages, however, SCL is discouraged because generates a large number of temporary objects, consumes memory resources, and increases execution times. As sequences get larger, or if these are processed in batch mode, implementing SCL becomes a computationally inefficient strategy. “

I cannot wait to finish it and provide one-liner solutions, applicable across knowledge domains.

A search in Google for string concatenation in loops provides some reasons for avoiding SCL.

1 Comment

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s