Live data from Hacker News

Modern C++ for C Programmers: part 5

ds9a.nl

81–82 of 82 posts

Re: Modern C++ for C Programmers: part 5

#81
That SmartFP class is not safe to use, it doesn't implement or block the copy constructor so you might get two objects pointing to the same FILE*. (rule of five vs rule of zero)

The article does mention this, but only very briefly and only gives one of the two solutions without much explanation behind and it isn't exactly easy to find it in the article even if you know what you are looking for. Search for deleter in part 2 of the article to find it.

Re: Modern C++ for C Programmers: part 5

#82
post #70

Earlier quoted context omitted.

Working with Python lately I very much got to like the interactive REPL and its immediate feedback. I actually think I forgot how to program in C. It lacks almost every data structure I'd deem useful to getting complex and mixed problems solved quickly. C++ provides many things and is useful if you are in a tight spot or you want/need the speed. If Rust keeps evolving at a quick pace I think I'll look into it a lot i…

Why wouldn't D work on microcontrollers? Runtime is too big? GC too difficult to avoid? Even in -betterC territory?

Compiling the hello world with -betterC yields a binary of size 8.2K. Seems small but when your microcontroller has 8K of program space that's just untenable. Of course those small micros are getting rarer nowadays when a large AVR and ARM micros are cheap, but there is still an entire range of minimal microcontrollers that are extremely limited in resources.
Post reply on HN