345 reputation
212
bio website
location Canada
age 25
visits member for 2 years, 7 months
seen Mar 13 at 0:15

Apr
25
awarded  Nice Question
Nov
8
awarded  Notable Question
May
10
awarded  Popular Question
Jan
11
awarded  Popular Question
Dec
14
awarded  Yearling
Jun
8
awarded  Caucus
Apr
27
awarded  Nice Question
Apr
27
comment Is it inefficient to concatenate strings one at a time?
I don't care about language for the purpose of this question. The use of stringbuilder behind the scenes in some languages explains why it may not be inefficient to concatenate an entire list of strings, which answers my question. This answer did however explain that joining a list could potentially be hazardous, and recommended stringbuilder as an alternative. I recommend adding the compiler's use of stringbuilder behind the scenes to your answer, in order to avoid possible reputation loss or misinterpretation.
Apr
27
accepted Is it inefficient to concatenate strings one at a time?
Apr
27
comment Is it inefficient to concatenate strings one at a time?
@Caleb Oh yea I always thought malloc was doing some type of OS memory request behind the scenes, but that makes a lot more sense as I also recall that the OS pages a bunch of memory for each application which can be used up and re-sized.
Apr
27
comment Is it inefficient to concatenate strings one at a time?
@Caleb The OS is involved in ALL memory allocation. Failing to follow this rule is a type of memory leak. The exception is when you have hard-coded strings in the application; those get written as binary data within the generated assembly. But as soon as you manipulate (or perhaps even assign) a string it needs to be stored in memory (that is, memory must be allocated).
Apr
26
comment Is it inefficient to concatenate strings one at a time?
Yea I agree that this is definitely an area where a compiler could theoretically realize that you're trying to add a bunch of strings together and then optimize as though you were using a string builder. However this is hardly a trivial thing to do, and I do not think it's implemented in any modern compilers. You just gave me a great idea for an undergraduate research project :D.
Apr
25
awarded  Editor
Apr
25
revised Is it inefficient to concatenate strings one at a time?
deleted 38 characters in body
Apr
25
asked Is it inefficient to concatenate strings one at a time?
Apr
25
comment Dealing with estimates as a junior programmer
@ratchetfreak This is definitely a programmer thing. I had a similar experience on an internship even though I had vast prior programming experience, since the system we worked on was so huge.
Apr
24
awarded  Commentator
Apr
23
comment What is the minumum code/operations to have in a separate thread?
10 million hard-coded constants is an extremely unlikely use case and would constitute as an exception. However if it is a "data set" that you are mining somehow, I'd consider that "variable" for the purpose of my answer. If you wish you can edit my answer to change the wording, but I think I was clear enough.
Apr
23
answered What is the minumum code/operations to have in a separate thread?
Feb
14
asked Should Sequence Diagrams be Specific or Abstract?