   My paranoiac friend...
  Hi, im writing this cause i have a friend who have some fear about my programs, the thing is, he consider himself some kind of elite in the computer domain, but he never really programmed so know nothing about how things really happen "under the hood", while i've been programming for 8+ years now in c/c++ and know Delphi very well too. Here's some of the things that annoy the most:1-He's afraid of memory leaks. He think they can last over the duration of the program, and that he'll need to reboot for is memory to be available again...2-He seem to be afraid about anything that write to something, like files or registry keys/values// This is the most frustating point...3-He's very afraid of my winsock programs, (wich are very well coded imo). He seem to be afraid that some hackers may find a way into is computer... That is very anoying especially when you know you're program is done like every other programs available on windows using sockets... and he can't read my c++ code so it's useless to try to show him.4-This is less of a problem now, since he's got used i send him some programs, but he's was also afraid that viruses could have magically be written into my freshly build executables files because i've told him i had like one or two a couples of years ago. Of course i don't have viruses anymore so now he's more willing to accepts them, but im pretty sure he scans them for threats anyway...In general, this is a good idea but when the files been builds like 30 secs ago i dunno why he could think a virus could be in those, especially knowing that virus that replicate through .exe are really rare nowaday...5-He think .net is THE language everyone should adopt and that c++ should die beause it's "too complicated"... I think c# is good for normal application, with GUI, but for games, c/c++ really is the best choice because the language offer so much more, but he can't see it otherwise than a loss of time... And since i know delphi already, all i have to do is build some dll and interface some more dirty c++ code in it, the best of the 2 languages, then he tell me, "you could do the same in c#...", sure, but im not sure i want to learn another language especially when delphi do everything i can imagine, and the fact that you can build custom controls and stuffs is really a big + compared to .net imo. what do you think.Well, if you have anything to say that could help me show him he's wrong on some points, go ahead!   
Quote:Original post by Vortez1-He's afraid memory leaks last over the duration of my application, so he'll need to reboot...Not possible under desktop OSes (Windows, Linux). The worst that can happen is exhausting the page file. There should be no reason to reboot these days.Quote:2-He seem to be afraid about anything that write to something, like files or registry keys/valuesThis is done using exactly the same API as in C#. C++ doesn't offer anything magic in this respect.Quote:he seem to be afraid that some hackers may find a way into is computer...Whether in C++ or C#, same winsock.dll is used for both. So there is nothing one could do more in another. Remote root is theoretically slightly easier under unchecked memory models, but stack smashing was proven possible even in &#106avascript (interpreted language, checked memory, browser sandbox, process protection).Quote:especially knowing that virus that replicate through .exe are really rare nowaday...C# produces executables as well. A virus infects the executable itself and the OS-specific code, or it might just abuse the .exe extension. There is nothing that C# offers in this regard.Either way, the reply to original question of which is better is: C - none of the above. Web applications are the answer, this is why client-side development outside of iEcosystem is kinda meh these days.   ;  Your friend is clueless, if you're talking to someone without a clue , and they're trying to tell you otherwise , don't bother they don't want to learn , they just want to be right. However you are also wrong on a few points:2) Since i infer from your last point that he wouldn't mind this in .net he "kinda" has a point as you can choose to run a .net program without giving it any kind of file access and be safe on that side.3) Once again , assuming he's saying he'd be fine if it was a .net program, since .net exposes high level APIs it's harder to shoot yourself in the foot and cause low level bugs, i don't know how the winsoks wrappers look like (when i started .net WCF was already out) but i can see how it's easier to mess up on everything (including security) when you're having to poll a ressource for low level data that you're formating yourself vs having it all done automagically.5) .Net isn't a language , it's a platform that quite a few language can target, including some .Net specific version of C++. Also C++ doesn't offer "so much more", it offers different. C# offers more than C++ in some areas and the reverse is true, but my personal bet is that at time goes the areas in which C++ offers more (performance differences mostly) will both get smaller and less relevant while C#'s highter level of abstraction/productivity will matter more and more.Quote:Original post by Vortezthat you can build custom controls and stuffs is really a big + compared to .net imo. what do you think.You can do that in .net too, and if you want to use WPF you can do quite a lot more than you could hope to do in other APIs that i'm aware of.   ;Quote:Original post by Vortezfor games, c/c++ really is the best choice because the language offer so much moreWhat does C offer that C# does not?What does C++ offer that C# does not?I would say C# offers much more "productive stuff" like functional features (lambdas and closures) while C++ offers much more "interesting low level stuff" like memory management, but that's just my opinion.   