3 ms·
I wonder whether all those gymnastics were more prudent than simply writing a C module to filter questions and feeding the results back to the C# web app. Opini
by cookiecaper 15y ago
I wonder whether all those gymnastics were more prudent than simply writing a C module to filter questions and feeding the results back to the C# web app. Opinions?
- jcheng 15y agoI was thinking the same thing. This problem seems extremely well suited for C/C++, and C#/.NET makes it very easy to call directly into native libraries.
- sams99 15y agoI agree this is a totally valid option, trouble is we have no c experts on core team so it would raise the cost of maintaining. Also the code is fairly complex, moving to structs was fairly simple compared to a c port.
- cookiecaper 15y agoSounds like the perfect opportunity for someone to become a C expert. Something like this just throws up a lot of red flags. If Microsoft changes some of the methodology in its GC or further demotes structs, your solution may fall apart. It just sounds like something that requires tight manual memory management to get right and remain stable.
- melling 15y agoJeff doesn't know C. Should he learn C was an ongoing topic in Jeff and Joel's StackExchange podcast, which was actually somewhat entertaining. Time for another episode.
- rbanffy 15y agoWhich episode was that?
- melling 15y agoIt has been a while so I can't remember. They were getting people to do the transcripts for their shows. http://meta.stackoverflow.com/questions/19244/community-podcast-transcription-project-idea http://meta.stackoverflow.com/questions/19244/community-podc... If your Google-Fu is good.
- chadgeidel 15y agoOr, at the very least perhaps drop to unmanaged code?
- dbattaglia 15y agoWell, in essence what they did is just store their tag data right on the stack, using CLR structs (which are pretty similar to a C struct or c++ struct/class - allocated on the stack by default). I guess they could have also wrote their own memory allocator, but I'm not so sure it would have been any simpler than the custom allocator they would have implemented in C#, had they went with the AllocHGlobal route. And then they would still have to deal with data marshaling between their native and managed code. Not saying that is necessarily a problem, but it's not always trivial either (especially marshalling custom struct types without causing boxing).