Hacker News new | ask | show | jobs
by Nelson69 5447 days ago
Have you ever debugged a class that used free instead of delete?

I can't help but think that people that suggest this stuff simply look at lists of features and see "lambda" and think C++ has somehow been modernized. Still fundamentally, it's producing machine code and fundamentally it has a fairly limited runtime and compared to what a LISP coder thinks of when he thinks of closures you might not want to call what C++ has 'closures.' Maybe the fact that the article referenced "lambdas and closures" is what throws me off... that's two features, right? haha The posts that mention C++'s cross platform nature also kind of make me laugh, it's sort of true, it's also remarkably easy to make it not true, just using "int" somewhere will break it some cases and if one of your platforms in Visual C++, then you'll probably have 2 code bases #ifdefed in to one, you can make it work but you have to do some work.

C++ probably won't die, not exactly that languages just die. Microsoft is all in with it, and many other organizations use it. It seems like we are in an era where there is more freedom to match the tool to the job than ever before and I can't imagine starting a medium or large scale project in C++ when Java and .NET are both still very viable. I can't imagine any serious C++ web app development, I can easily see some Ruby, Python or something other calling a chunk of C++ code, but I just can't see it rendering javascript and html in any serious way, it makes very little sense. Now VMs, runtimes, browsers, they'll likely continue to have some C++ in them for some time. It's a fine tool for some jobs. I also find is puzzling, the OpenJDK is GPL, simply Oracle's ownership somehow suggests Java is ending? If that's really what matters, then pretty clearly Go and Objective-C are what the future is, just looking at corporate ownership and momentum.

From a feature matrix? Sure C++ is the next big thing. From reality? I think and hope that it's future use shrinks and becomes more specialized.

1 comments

I don't think there are many people that have debugged a class that used free instead of delete as there is simply no reason to write the word "free" in a C++ code base.

Even if this somehow happened, allocators include protection at least in debug mode that will let you know when you're doing something obviously wrong.

Writing int won't break your program, I don't see why it would, unless you're making assumptions about range - which you shouldn't. If you need an integer of a certain length there is stdint.h