Live data from Hacker News

Why C Is Obsolete

softdevtube.com

61–70 of 75 posts

Re: Why C Is Obsolete

#61
post #26

Earlier quoted context omitted.

Then again, browsers are written in C++ and so are almost all GUI apps. We spend most of our time with software that is developed in C++, probably for a good reason

so are almost all GUI apps This claim is clearly false on Mac OS X and X Window platforms, and disputable on Windows, with the increasing share of .NET apps.

[deleted]

Re: Why C Is Obsolete

#62
post #16

Earlier quoted context omitted.

With that argument you could invalidate any high-level language construct. They're all just "specialized syntax" of classic idioms in Assembly.

Exactly. And nobody thinks that for loops are "magic".

No, but for loops are simple. Classes are not that simple. Of course, no feature really is "magic". But there are a lot of features that may be easy to use but hard to deeply understand. Take for example the attr_accessor method that Ruby uses to make variables pseudo-public. Most beginners coming from Java think that it is a language keyword, similar to "public". In fact, it just writes getters and setters for you. Of course, everyone could just write their getters and setters themselves, but this is just what language is: A way to abstractly tell a machine what to do. And if you don't know how it works (and maybe even don't need to know), you can call it "magic".

Re: Why C Is Obsolete

#63
post #11

I agree on Bjarne's opinion here -- it would be nice if C and C++ had merged at some point. Unfortunately, the reason why this hasn't happened is inherent: C++ is so utterly complex (the C++11 standard contains more than 1300 pages of highly compressed language legalese) that especially in the embedded systems domain many vendors just don't have the time and resources to build a C++ compiler. And being caught in this…

"This also allows myths like C++ being too inefficient for embedded systems programming to live on in industry."

You just proved that it is too inefficient... too complex to efficiently implement dev tools for use with (some) embedded device's to-market development cycles in a timely fashion.

Re: Why C Is Obsolete

#64
post #47

Earlier quoted context omitted.

>In my experience, the overall effect of C++ on a project is negative. YMMV. Curious: What's your domain? In video games where there are a lot of "objects" floating around that can really benefit from polymorphism, the type checking that C++ can do that C can't really gives you a huge development bonus. Of course I'm saying this having moved past C++ for 99% of the development into an elegant and tiny scripting langu…

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 to zero.

And even ignoring LuaJIT2 -- they probably took less time and got higher quality overall by going through Lua (assuming programmers were equally versed in Lua and C++, and the infrastructure was reasonable) -- it's easier to iterate and debug with Lua than it is with C++.

Re: Why C Is Obsolete

#65
post #32

Earlier quoted context omitted.

> Why code this all by hand when the language can do it for you at no penalty? The only penalty I see in C++ for using classes or polymorphism is that it produces longer symbol names (w/ the type mangling) There are other penalties which people who write C++ are oblivious to. For example, switching the class of an established object in runtime: Suppose you have two compatible class layouts (same field order and types…

>In my experience, the overall effect of C++ on a project is negative. YMMV. Curious: What's your domain? In video games where there are a lot of "objects" floating around that can really benefit from polymorphism, the type checking that C++ can do that C can't really gives you a huge development bonus. Of course I'm saying this having moved past C++ for 99% of the development into an elegant and tiny scripting langu…

> Curious: What's your domain?

I switch every couple of years. Most recently: Image analysis; previously: Big data analysis; Before that: financial mathematics ("quant") and trading systems. If I go back long enough to '91-95: Game programming (SNES and PC); although I've been somewhat involved in game programming and related projects as late as 2008.

> In video games where there are a lot of "objects" floating around that can really benefit from polymorphism, the type checking that C++ can do that C can't really gives you a huge development bonus.

Only if your logic is written in C++ as well. In the projects I was involved with, most of the logic was actually data driven or scripted, and C++ contributes much less in that scenario.

I don't deny C++ has its uses. But it also has a lot of drawbacks. Whether or not the net is gain or loss compared to $LANGUAGE, is subjective. For me with $LANGUAGE=C, it is negative. YMMV.

Re: Why C Is Obsolete

#66
post #60

Earlier quoted context omitted.

"""This claim is clearly false on Mac OS X and X Window platforms, and disputable on Windows, with the increasing share of .NET apps.""" Actually it is not. On OS X tons of programs, and especially the very largest, most popular ones, are in C++ (think: Photoshop and the Creative Suite, MS Office, and lots of Apple's own: Safari (webkit) is C++, Final Cut and Logic are C++, etc. Don't confuse the front-end UI code (C…

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++?

Re: Why C Is Obsolete

#67
post #42

Earlier quoted context omitted.

I used this argument for Java, but it's the same with C++. If I can deliver a first version 2 months before the C++ version gets ready, I'll have two months to optimize market-tested algorithms before you hit the market. I may even have time to rewrite the sensitive parts in C. If we are talking gadgets with embedded software, you may use a less powerful hardware and offer a cheaper product, but you'll have to amorti…

"""I used this argument for Java, but it's the same with C++. If I can deliver a first version 2 months before the C++ version gets ready, I'll have two months to optimize market-tested algorithms before you hit the market. I may even have time to rewrite the sensitive parts in C.""" Yeah, the only problem with that logic is that it never happens. (Except in the server space, where it doesn't matter what language you…

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 in C, I am old enough to remember (and have used) technically successful OSs written in things like Smalltalk, Lisp, PL/M and Algol.

Like I said, C makes sense for a lot of things. It's just not as important as it was 20 years ago.

Re: Why C Is Obsolete

#68
It seems to me that what Bjarne likes about C++ over C is its provision of copious quantities of syntactic sugar - turning things that are perfectly expressible in C into supposedly more 'natural' formulations. I suppose if you like cancer of the semicolon, C++ may be the right place for you, but in my opinion if you really want abstraction you should be using lisp (the simple, unbound syntax makes every function you implement act like an extension of the core language), and otherwise you should use C.

Of course, I'm atypical - when I'm not writing in C it's because I'm writing asm.

Re: Why C Is Obsolete

#69
post #67

Earlier quoted context omitted.

"""I used this argument for Java, but it's the same with C++. If I can deliver a first version 2 months before the C++ version gets ready, I'll have two months to optimize market-tested algorithms before you hit the market. I may even have time to rewrite the sensitive parts in C.""" Yeah, the only problem with that logic is that it never happens. (Except in the server space, where it doesn't matter what language you…

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 need is "a browser and a text editor" good for you. I need: a media player, a text editor, a word processor, an IDE, a chat client, Evernote, Dropbox, Skitch, Photoshop, VMWare Fusion, and some other stuff besides...

Re: Why C Is Obsolete

#70
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++?

His argument is that if he's using a Mac, a lot of them are written in Objective-C.

And if he's using Gnome in Linux, most are written in C.

But for Windows apps, commercial apps, cross platform and games, C++ leads by far.

Post reply on HN