Live data from Hacker News

Why C Is Obsolete

softdevtube.com

71–75 of 75 posts

Re: Why C Is Obsolete

#71
post #60

Earlier quoted context omitted.

You just proved the claim that there are many GUI apps written in C++ on OS X and X Window platforms, which is, incidentally, not the claim I find false. What I find false is the claim that almost all GUI apps are written in C++.

Can you find one app on your computer that is not written in c++?

Why, of course. What's more interesting, I can find only one GUI app on my computer that is (probably) written in C++, the web browser I use.

Why do you ask?

Re: Why C Is Obsolete

#72
post #64
post #47

Earlier quoted context omitted.

Hmm, a friend of mine from Criterion said that in two of the last games they did, they had to re-write the Lua parts (fairly significant) in C++ to get the framerate high enough as it's memory fragmentation was just too much. They went from ~34 fps to ~60 fps for 4 developer weeks re-writing the Lua code.

Ask them if they were using LuaJIT2; they probably didn't -- it's relatively new (only been stable enough for real work for less than a year). It is ludicrously fast. It usually loses to optimized C / C++, but by no more than 10-20% -- and you have essentially no restrictions whatsoever on the Lua features you use; Furthermore, it's FFI makes interoperating with C / C++ a superfast breeze, dropping the FFI overhead t…

LuaJIT2 is awesome, but it still uses the Lua 5.1.4 garbage collector, so if the problem was GC related (i.e., memory fragmentation), then LuaJIT2 wouldn't help much.

OTOH, changing how you do things in Lua CAN be a big help in not generating garbage. I love the ability to ignore memory allocation in Lua, and I'm annoyed that I have to deal with thinking about it, but at least it's pretty straightforward.

Also, depending on the game, you can nuke your Lua allocation every level/section/other segment, allocating Lua memory from a memory pool. That can also help a lot with fragmentation.

But if you're doing a game that's one continuous experience, you have no choice but to be careful with managing memory. Again, it CAN be done from within Lua (think object pools), and that could be easier than porting to C++. And with LuaJIT 2, it would likely be fast enough in that case.

Re: Why C Is Obsolete

#73
Actually, after having used it for ten years, I think C++ is the language which should be deemed obsolete. We don't need such a complex language anymore.

Long live C!

Re: Why C Is Obsolete

#74
post #67

Earlier quoted context omitted.

Desktop apps are becoming a niche. I used to have an e-mail client, a spreadsheet, word processor, groupware, project management and an IDE installed on my machine. Now all I need is a browser and a text editor (although it's Emacs). It still makes sense to use C/C++/hand-tuned assembly for high-performance things like game engines, 3D modeling, audio/video processing and so on. While my current OS is written mostly…

"""Desktop apps are becoming a niche. I used to have an e-mail client, a spreadsheet, word processor, groupware, project management and an IDE installed on my machine. Now all I need is a browser and a text editor (although it's Emacs).""" People say that, but I don't see it. The Mac App Store has sold millions of apps already. And the iTunes App Store has sold a BILLION native (non browser) mobile apps. If you only…

> People say that, but I don't see it.

It all depends on where you look at. I can't remember the last corporate software piece I saw being delivered as a desktop application.

Stand-alone software for iOS has one advantage over web applications in that users sometimes face lack of connectivity. The Facebook app, IIRC, is delivered as a standalone app, but, in reality, is nothing but a web application. It's not alone and there are definite advantages to their approach. Most software appears to be entertainment - games, social thingies etc. They are the kind of games one would expect to be delivered as a Flash application within a brorser on a desktop.

I am not familiar enough with the Mac App Store, but, while there are some more "serious" offerings, in line with the desktop apps I mentioned, most of them appear to be, again, games and other entertainment related stuff. That and front-ends to net-centric applications such as Evernote.

Re: Why C Is Obsolete

#75

Earlier quoted context omitted.

"""Every person uses a different subset of C++, but that subset varies from a group to the other. You cannot therefore "remove features of C++"""" Actually you can. You don't remove them from the existing language that is, you make a better language with bs/redundant removed. While "every person uses a different subset of C++" is true, it's not like everything someone uses is equally beneficial to have in a language.…

Perhaps I would understand better what you're trying to say if you were to give me an example of a controversial feature.

Multiple inheritance.

Operator overloading.

Doing non-atomic work in constructors (allocating memory, doing file I/O, etc.).

RTTI

Template metaprogramming

... and more

Post reply on HN