3 ms·
Perhaps I can state a point simpler than another poster. "this is an unnecessary copy...this is inefficient...I wouldn't have to do this if I were writing in C
by scott_s 13y ago
Perhaps I can state a point simpler than another poster.
"this is an unnecessary copy...this is inefficient...I wouldn't have to do this if I were writing in C"
You should then ask yourself: does the inefficiency matter? Will it make the program noticeably slower? If not, then you can safely ignore the lack of machine efficiency and embrace the gain in programmer efficiency.
- nathanb 13y agoA valid question...sometimes it does. Sometimes it doesn't. Sometimes you think it won't, and then it does and you have to do some herculean things later to make it scale. Also, I think it's a fallacy to say that higher level languages necessarily mean more programmer efficiency. When I'm doing network programming in C, here's what it looks like: * Define a struct whose field layout matches the wire format * Cast the incoming buffer to that struct * Done By contrast, Ruby requires me to marshal data and painstakingly extract each field...all because it tries to abstract away the fact that memory is a flat array of bytes. Yeah, much of the time I'll be more productive in a higher-level language. But there are problem domains where that is not the case.