龙井是什么茶| 鲤鱼吃什么| 尿道口有烧灼感为什么| 高处不胜寒是什么意思| 局长是什么级别| 紫得什么| 血气方刚什么意思| 疏肝理气吃什么药| 脂肪燃烧是什么感觉| 蚂蚁搬家是什么意思| 吃什么东西下火| 宫腔灌注是治疗什么的| 鱼加思读什么| 尿分叉是什么原因| 心跳过缓是什么原因造成的| 囊性无回声是什么意思| 过期葡萄酒有什么用途| 室上速是什么病| ivu是什么检查| 嗓子疼感冒吃什么药| 不言而喻的喻是什么意思| 人工受孕和试管婴儿有什么区别| 女孩名字带什么字好听| 每天早上起床口苦是什么原因| 久卧伤气是什么意思| 梦见捡手机是什么意思| 夜盲症是什么意思| 刚怀孕吃什么对胎儿好| 疱疹挂号挂什么科室| 属鼠的贵人是什么属相| 热水器什么品牌好| 什么是碱性食物有哪些| 性欲是什么| 胎盘位于前壁是什么意思| 不怕流氓什么就怕流氓有文化| 甄嬛传什么时候上映的| 减胎对另一个胎儿有什么影响| 口腔溃疡是缺什么维生素| 脑供血不足吃什么药好得快| 感冒吃什么食物比较好| 身上长红痘痘是什么原因| 缺维生素b有什么症状| 博五行属性是什么| 痛风要吃什么药好得快| 一桌餐是什么意思| 常务副县长是什么级别| 风凉话是什么意思| 前列腺不能吃什么食物| 海带不能和什么一起吃| 今年为什么有两个6月| 运六月有什么说法| 粉玫瑰花语是什么意思| 介词后面跟什么| 什么样的长城| 健身前吃什么比较好| 什么是头七| 四级什么时候报名| 什么银行卡最好用| 黑咖啡为什么能减肥| 晚上吃什么有助于减肥| 才美不外见的见是什么意思| 迁移宫代表什么| 什么是匝道| 为什么会得霉菌感染| 心律不齐是什么症状| 梦见死人笑什么预兆| 醋纤是什么面料| 985是什么| 宫颈短是什么意思| 惊讶的什么| 狗跟什么生肖最配| 手术后发烧是什么原因| 刀纸是什么| 凭什么| 日生组成什么字| 碱和小苏打有什么区别| 肉蔻是什么样子| 七夕节是什么节日| 查血铅挂什么科| 五劳七伤什么生肖| 耳朵旁边长痘痘是什么原因| fabric是什么面料| 男属鼠的和什么属相最配| 异国他乡的意思是什么| 吃大米配什么菜| 碳酸氢根偏低什么意思| 咖啡伴侣是什么东西| 什么中药补肾最好| 血沉是查什么| 生殖器疱疹是什么原因引起的| 子宫肌瘤有什么危害| 排卵期是指什么时候| 头发不干就睡觉有什么危害| 剥苔舌是什么原因| 嗓子痒干咳是什么原因| 耳钉后面的塞子叫什么| 身体动不动就出汗是什么原因| 血红蛋白偏高说明了什么| 吃什么容易流产| 人间四月芳菲尽的尽是什么意思| 化疗能吃什么水果| 胸部周围痒是什么原因| 什么颜色有助于睡眠| 睡觉做梦是什么原因| 辅酶q10什么时间吃好| 什么东西能加不能减| 戒烟有什么好处| 生长因子是什么| 为什么会长口腔溃疡的原因| 什么快递可以寄宠物| 47岁属什么| 肝脏低回声意味着什么| 地球为什么叫地球| 柳枝什么的什么的| 喝益生菌有什么好处| 精神分裂吃什么药| 羊和什么属相最配| 看心脏挂什么科| 颈椎退行性病变是什么意思| 卤牛肉用什么部位| 特警属于什么编制| 没有胎心胎芽是什么原因造成的| 副脾结节是什么意思| 半夜两点是什么时辰| 直博是什么意思| 看膝盖挂什么科| 真菌是什么原因引起的| 酸橙绿是什么颜色| 芈月和秦始皇什么关系| 尿分叉吃什么药好得快| 致爱是什么意思| 三高是什么| 韩红和张一山什么关系| 欲钱看正月初一是什么生肖| 复刻鞋是什么意思| 举世无双是什么意思| 什么茶可以减肥| 淋病和梅毒有什么区别| 火气重吃什么降火| 糖精是什么| 男人吃什么补肾壮阳效果最好| 介入超声是什么意思| 红景天有什么功效| 甲烷是什么| 龙延香是什么| 仕女图是什么意思| 二黑是什么意思| 手抖是什么病的预兆| 砼为什么念hun| 蛾子吃什么| nt检查前需要注意什么| 治疗脚气用什么药| 中气是什么意思| 代谢不好是什么原因| 兔子肉不能和什么一起吃| 什么是皮炎| 门良念什么| 躯体形式障碍是什么病| 血糖高能吃什么主食| 什么方法可以快速入睡| 拉屎很臭是什么原因| 什么的流水| 骨是什么结构| 新生儿屁多是什么原因| 做什么业务员好| 心脏有问题挂什么科| 什么奶粉跟母乳一个味| 梦见别人打架是什么意思| 挽联是什么意思| 你的名字讲的什么故事| 掉头发补充什么维生素| 慢性肠炎有什么症状| 疣体是什么| 清谈是什么意思| 干咳喝什么止咳糖浆好| 什么是文员| 三点水一个条读什么| 山竹和什么不能一起吃| 梦见自己掉河里了是什么意思| 吃什么食物降低转氨酶| 缄默是什么意思| 棋逢对手下一句是什么| 少年班是什么意思| 通五行属什么| 大姨妈期间可以吃什么水果| 7.7是什么星座| 什么叫业力| 月经咖啡色是什么原因| 网络维护是做什么的| 海米是什么| 迷惑是什么意思| 殉葬是什么意思| hpl是什么意思| 农历五月初五是什么星座| 潸然泪下是什么意思| 二十年是什么婚| 鹅蛋和什么不能一起吃| 一什么事情| 速度是70迈心情是自由自在什么歌| 肥牛是什么肉| 睡觉为什么会流口水| 10月20是什么星座| 榴莲什么季节成熟| 出台什么意思| 什么床垫最健康| 什么叫胰岛素抵抗| 年轻人血压高是什么原因引起的| 日本为什么经常地震| 小白脸是什么意思| 鲸鱼用什么呼吸| 鼻子无故出血什么原因| 摩尔每升是什么单位| 女人晚上盗汗是什么原因| 疫情是什么| 胸疼挂什么科室| 骨质破坏是什么意思| 颉在姓氏里念什么| 为什么指甲有竖纹| 草字头加西念什么| 就义是什么意思| 阴囊瘙痒用什么药最好| 关税是什么| 约会去什么地方比较好| 低钠盐适合什么人吃| 加持什么意思| 眼压低是什么原因| 失业是什么意思| 炖牛肉放什么| 米加参念什么| 男性生殖系统感染吃什么药| es什么意思| 趋是什么意思| 白雪什么| 祸起萧墙是什么意思| 0型血和b型血生的孩子是什么血型| 摇滚是什么意思| 晓五行属什么| 什么动物最厉害| 总胆红素偏高是什么意思| 6月6日是什么节| 江苏龙虾盱眙读什么| 红肠是什么| 非布司他片是什么药| 二代身份证是什么意思| 维生素b6是治什么的| 突然抽搐失去意识是什么原因| 属鸡什么命| 很多条腿的虫子叫什么| 一什么见什么| 小壁虎的尾巴有什么作用| 96年出生的属什么| 亚瑟士和鬼冢虎的区别是什么| 兑卦五行属什么| 血氨高是什么原因| 低头什么节| 喝可乐有什么好处| 撑台脚是什么意思| 张信哲属什么生肖| 腮腺炎是什么原因引起的| oid是什么意思| 作陪是什么意思| 汗毛长是什么原因| 去医院看头发挂什么科| 氪金是什么意思| 百度

C++ in Coders at Work

百度 与此同时,由人民日报出版社出版、何伟社长担任主编的《破晓中国汽车品牌向上实录(2017)》新书发布隆重揭幕,《破晓》在收录中国品牌巡礼系列报道的精华内容基础上,同时集纳了行业专家的专论文章,对中国汽车企业以及中国乘用车企业的成长路径进行了全面展示,对企业面临的发展难题和瓶颈进行了深刻剖析,就行业未来趋势和前景提出了预判和建议,以此助力汽车产业健康发展和持续向上。

One of the topics I asked most of my Coders at Work interviewees about was C++. I am not an expert, or even a competent C++ programmer and recognize that my own opinions about C++ are not well-informed enough to be worth much.1 But C++ fascinates me—it’s obviously a hugely successful language: most “serious” desktop apps are still written in C++ despite the recent inroads made by Objective C on OS X and perhaps some C# on Windows; the core of Google’s search engine is written in C++; and C++ dominates the games industry. Yet C++ is also frequently reviled both by those who never use and by those who use it all the time.

That was certainly reflected in the responses I got from my Coders interviewees when I asked them about it. Jamie Zawinski, as I’ve discussed recently, fought tooth and nail to keep C++ out of the Netscape code base (and eventually lost). Some of that was due to the immaturity of C++ compilers and libraries at the time, circa 1994, but it seems also to have to do with his estimation of the language as a language:

C++ is just an abomination. Everything is wrong with it in every way. So I really tried to avoid using that as much as I could and do everything in C at Netscape.

Part of Zawinski’s issue with C++ is that it is simply too complex:

When you’re programming C++ no one can ever agree on which ten percent of the language is safe to use. There’s going to be one guy who decides, “I have to use templates.” And then you discover that there are no two compilers that implement templates the same way.

Note that Zawinski had started his career as a Lisp programmer but also used C for many years while working on Netscape. And he later enjoyed working in Java. So it’s not that C++ was either too high-level or too low-level for him or that he couldn’t wrap his head around object orientation.

Joshua Bloch, who also hacked low level C code for many years before becoming a big-time Java head, told me that he didn’t get into object-oriented programming until quite late: “Java was the first object-oriented language I used with any seriousness, in part because I couldn’t exactly bring myself to use C++.” He echoed Zawinski’s point about how C++ forces programmers to subset the language:

I think C++ was pushed well beyond its complexity threshold and yet there are a lot of people programming it. But what you do is you force people to subset it. So almost every shop that I know of that uses C++ says, “Yes, we’re using C++ but we’re not doing multiple-implementation inheritance and we’re not using operator overloading.” There are just a bunch of features that you’re not going to use because the complexity of the resulting code is too high. And I don’t think it’s good when you have to start doing that. You lose this programmer portability where everyone can read everyone else’s code, which I think is such a good thing.

Ken Thompson, who still mostly uses C despite working at Google which is largely a C++ shop, has had as long an exposure to C++ as just about anyone, having worked with with Bjarne Stroustrup, C++’s inventor, at Bell Labs:

I would try out the language as it was being developed and make comments on it. It was part of the work atmosphere there. And you’d write something and then the next day it wouldn’t work because the language changed. It was very unstable for a very long period of time. At some point I said, no, no more.

In an interview I said exactly that, that I didn’t use it just because it wouldn’t stay still for two days in a row. When Stroustrup read the interview he came screaming into my room about how I was undermining him and what I said mattered and I said it was a bad language. I never said it was a bad language. On and on and on. Since then I kind of avoid that kind of stuff.

At that point in the interview I almost changed the topic. Luckily I took one more try at asking for his actual opinion of C++. His reply:

It certainly has its good points. But by and large I think it’s a bad language. It does a lot of things half well and it’s just a garbage heap of ideas that are mutually exclusive. Everybody I know, whether it’s personal or corporate, selects a subset and these subsets are different. So it’s not a good language to transport an algorithm—to say, “I wrote it; here, take it.” It’s way too big, way too complex. And it’s obviously built by a committee.

Stroustrup campaigned for years and years and years, way beyond any sort of technical contributions he made to the language, to get it adopted and used. And he sort of ran all the standards committees with a whip and a chair. And he said “no” to no one. He put every feature in that language that ever existed. It wasn’t cleanly designed—it was just the union of everything that came along. And I think it suffered drastically from that.

Brendan Eich, the CTO of the Mozilla Corporation, whose Mozilla browser is written almost entirely in C++, talks about “toe loss due to C and C++’s foot guns” and when I asked him if there are any parts of programming that he doesn’t enjoy as much as he used to, he replied:

I don’t know. C++. We’re able to use most of its features—there are too many of them. It’s probably got a better type system than Java. But we’re still screwing around with ’70s debuggers and linkers, and it’s stupid. I don’t know why we put up with it.

At least among my interviewees, even the most positive comments about C++ tended to fall in the category of “damning with faint praise”. I asked Brad Fitzpatrick, who used C++ in college and again now that he’s at Google, whether he likes it:

I don’t mind it. The syntax is terrible and totally inconsistent and the error messages, at least from GCC, are ridiculous. You can get 40 pages of error spew because you forgot some semicolon. But—like anything else—you quickly memorize all the patterns. You don’t even read the words; you just see the structure and think, “Oh, yeah, I probably forgot to close the namespace in a header file.” I think the new C++ spec, even though it adds so much complexity, has a lot of stuff that’ll make it less painful to type—as far as number of keystrokes. The auto variables and the for loops. It’s more like Python style. And the lambdas. It’s enough that I could delude myself into thinking I’m writing in Python, even though it’s C++.

Dan Ingalls, who helped invent modern object oriented programming as part of Alan Kay’s team that developed Smalltalk, never found C++ compelling enough to use but isn’t totally adverse to using it:

I didn’t get that much into it. It seemed like a step forward in various ways from C, but it seemed to be not yet what the promise was, which we were already experiencing. If I had been forced to do another bottom-up implementation, instead of using machine code I would’ve maybe started with C++. And I know a couple of people who are masters of C++ and I love to see how they do things because I think they don’t rely on it for the stuff that it’s not really that good at but totally use it as almost a metaprogramming language.

Joe Armstrong, similarly, has never felt the need to learn C++:

No, C++, I can hardly read or write it. I don’t like C++; it doesn’t feel right. It’s just complicated. I like small simple languages. It didn’t feel small and simple.

And finally Guy Steele, who probably knows more about more languages than anyone I interviewed (or possibly anyone, period), has also not been drawn to C++. But he did go out of his way to try to say something nice about Stroustrup’s effort:

I have not been attracted to C++. I have written some C++ code. Anything I think I might want to write in C++ now could be done about as well and more easily in Java. Unless efficiency were the primary concern.

But I don’t want to be seen as a detractor of Bjarne Stroustrup’s effort. He set himself up a particular goal, which was to make an object-oriented language that would be fully backwards-compatible with C. That was a difficult task to set himself. And given that constraint, I think he came up with an admirable design and it has held up well. But given the kinds of goals that I have in programming, I think the decision to be backwards-compatible with C is a fatal flaw. It’s just a set of difficulties that can’t be overcome.

Obviously with only fifteen interviewees in my book I have only a sampling of possible opinions. There are great programmers who have done great work with C++ and presumably at least some of them would have had more enthusiastic things to say about it if I had spoken with them. But this is what I heard from the people I spoke with.


1. I think I once managed to read all the way through Stroustrup’s The C++ Programming Language and have looked at at least parts of The Design and Evolution of C++. But I have never done any serious programming in it. I have made a couple attempts to learn it just because I felt I should but in recent years I’ve mostly given up, thinking that perhaps Erik Naggum, scourge of Usenet, was right when he said: “life is too long to know C++ well.”

39 Responses to “C++ in Coders at Work”

  1. Isaiah Gilliland's avatar Isaiah Gilliland Says:

    I was wondering how you make money when you don’t program in C++? I too haven’t touched it but tried. I can’t stand the language. I feel most at home in Javascript, python, and any Lisp. I love Lisp but I don’t know how I can have a future on it.
    There is an idea going around that you can’t get anywhere if you don’t know C++. Which scares me because I’m 21, I just got married, and now I have a son. All the jobs I find are for C++, my father gets on my case for not using it, and now with a family I’m scared if I’ll be able to support them.
    For a person with a lot of responsibility who’s still basically in college, it’s pretty important.

    • jancajthaml's avatar jancajthaml Says:

      You develop CMS systems in J2EE of I don’t kno wolfram alpha core in Java (don’t mistake Java for Aplet) of you develop ATM machine on ARM chipset? C++ is dead and its not sustainable for larger projects.

  2. Peter Seibel's avatar Peter Seibel Says:

    Isaiah, while it may be easier to find a job using C++ than Lisp, there are lots of languages people get paid to use. Ultimately if you’re going to make a living as a programmer, there are a lot of things more important than knowing a particular language–if you know how to write good code in one language you can probably learn another language without too much problem, even C++. Good luck!

  3. Eric's avatar Eric Says:

    This C++ bashing is weird. C flourished on cheap hardware because you could write fast programs in it. C++ provided us with a better abtraction and organizing tool, and Moore’s Law allowed us to use it instead of C.

    During this current decade, I’ve often heard the term ‘hype’ to describe each new language that gains some mindshare. At least these languages are coming to prominence through a collective understanding of programming potential. Java’s introduction was true hype. For publishing companies, it was a bonanza. I don’t quite understand the push at universites, but it was obviously calculated. Fifteen years later, Java continues to be fantastically cryptic and heavy. Is it a good language? Arguably not. However, it had its place in the decade after its inception for creating an industry *around* solving problems with software.

    Any other (non-MS) language environments are by-and-large unstable, so it is not surprising that C++ still shows up in games or Google. However, I have no doubt that language choice is going to look very different over the next 5-10 years. Ragging on C++ seems passee.

  4. Ken Thompson on C++ « I, Geek Says:

    […] an interview for Coders at Work […]

  5. Coders at Work « Sean Voisen Says:

    […] it as “a garbage heap of ideas that are mutually exclusive.” (Peter Seibel has a more thorough list of interview quotes on the design flaws and challenges of working with […]

  6. C++ in Coders at Work « Interesting Tech Says:

    […] Read more here Posted in Uncategorized , interesting, science, tech | No Comments » […]

  7. aaron's avatar aaron Says:

    You seem to glance of the fact there is no alternative. C++ has it’s flaws but no one is better at what it does. The most interesting software needs to have good performance: search engines, video games, dsp, artificial intelligence, etc. You can write things in C, but then you loose great abstractions like templates, and organization techniques like namespaces. Not to mention, c++’s evils are well known, its tools are mature, and there are tons of libraries. I’d love to see C++ dethroned, it just hasn’t happened yet.

  8. Varun Khaneja's avatar Varun Khaneja Says:

    s/adverse/averse

  9. Erik's avatar Erik Says:

    While some keep whining about C++ others just get on with it, make great software and a lot of money…

    • Mike Taylor's avatar Mike Taylor Says:

      I’m not sure you can make a serious argument that Jamie Zawinsky, Joshua Bloch, Ken Thompson, Brendan Eich, Brad Fitzpatrick, Dan Ingalls, Joe Armstrong and Guy Steele (the people quoted as “whining about C++”) have failed to make great software.

    • Craig's avatar Craig Says:

      Yeah, those guys have all made great software and most are either very well paid or rich. Who are you? Have you got a lot of money are are you just sticking your chest out in a pathetic and desperate attempt to impress?

  10. Nick Mudge's avatar Nick Mudge Says:

    I am still curious what your personal opinion of C++ is.

    • Peter Seibel's avatar Peter Seibel Says:

      If that was addressed to me: I’ve never really learned it well enough to use in any serious way. And unlike some other languages that I’ve not gotten around to learning, I don’t particularly regret that or have any plans to rectify the situation.

  11. Markus Sandy's avatar Markus Sandy Says:

    It’s all just tools in a toolbox. Some people use the best suited tool they can for a given job, others just learn a few tools and try to use them everywhere. Either way, who gives a fuck?

  12. Nasos's avatar Nasos Says:

    It is very hard for me to understand how professional programmers with years of experience, think like that for C++. I have used many languages and I always find C++ the most appropriate for almost anything as long as you achieve a certain level of maturity. And nothing is hard in it, you just need to start studying it the correct way and invest a few months focused on it.

    If you want to start working on C++ the way C++ is meant to be programmed I would suggest to look no further and try “Accelerated C++”- DON’T SKIP THAT BOOK. If you want some more advanced topics look at Alexandrescu’s “Modern C++Design”, Vandevoorde and Josuttis “C++ Templates” and Abrahams “Template Meta-progamming” (which is free by the way and I mainly find it useful for the mentality behind the feature direction of the language rather for the content).

    Ignoring corporate choices by Apple, MS and Google, the only existing language that I can see rivaling C++ is D, that is actually just starting to become mature.

  13. Marsh Ray's avatar Marsh Ray Says:

    After having written hundreds of thousands of lines of C++, here are my opinions:

    The language is big and more complex than it needs to be.

    The subsetting issues are real, but this happens with any sufficiently-large system.

    The error messages from templates can be absurdly difficult to understand.

    There’s no other language that lets you write code with such high-level abstractions (e.g., its declarative, generative type system) *and* lets you reason about the actual machine code and its runtime performance.

  14. Pierre's avatar Pierre Says:

    I’ve made a good living with C++ (twenty years). I just avoid the unnecessary complexity. I’ve rarely found templates a boost to productivity. When it takes longer to understand something than it takes to write an alternative, I think we’ve reached the point of diminishing returns.

    MFC CStrings are 40 times slower than plain old char[]. The Standard Template Library strings are 200 times slower. You don’t care? How about your user having to wait 100 seconds instead of 0.5?

    The “Managed” C++ pointers (CLR) are ridiculous. Reminds me of the 28-cylinder Stratocruiser engines: the apotheosis of piston technology, they vibrated so much they broke away from the wings.

  15. Extern: C++ complexity and usability « Kissaki Blog Says:

    […] C++ too complex? A combination of all possible programming techniques, where you can only use a subs… […]

  16. Rob Thorpe's avatar Rob Thorpe Says:

    As Eric mentioned C++ was successful because of it’s back-compatibility and it’s hardware requirements. For many years on Windows, if you wanted to write a small, fast, graphical program in a high level language you only had two choices: VB and C++. That’s why they became so popular.

  17. Co++on Lisper's avatar Co++on Lisper Says:

    Peter, my long experience with C++ tells me that it is indeed an overly complicated language, in large because it is meant to be (mostly) backwards-compatible with C.

    I write this comment to tell you, however, that you should totally read D&E in full. It is a very interesting book, and Bjarne Stroustrup is a very clever chap. I’ve been reading Naggum posts, and I recall that his view of D&E and Stroustrup coincides with mine.

  18. Phu Nguyen's avatar Phu Nguyen Says:

    When reading and writing C++, I feel like I’m playing Barque music on an old organ. Many loose keys, the chords progressions deviate little, and the structure is tight just like verbose C++, strict types, and formal memory management.

    But it’s fun.

    It’s a different feeling than playing Debussy on a modern piano (Javascript/Lispish). They’re all fun, different, and not comparable. Languages shouldn’t be a pissing match between the right bags of features. If a deadline isn’t on the line, why not just use a language because that’s what you feel like playing with that day?

  19. Cowtowncoder's avatar Cowtowncoder Says:

    C++ may be a necessary evil; but places where it (or C, or other compiled-to-binary) language is needed has been and is shrinking. For example, there is absolutely no need to write search engines in C++; that is just due to inertia. Same will be true for databases; and eventually for all games (casual games already are moving on).

  20. Marthinus's avatar Marthinus Says:

    I am a developer and I know C++ quite well and to be honest I don’t even put it on my Resume. I don’t want C++ jobs, but C++ is so entrenched everywhere that I always end up coding in C++ for at least 25% of my coding time at a company. I can still live with the 25% but I would like it to be 0%

    Anyway in truth I loved C++ 15 years ago and then I discovered Delphi on the Win32 platform, the apps were as fast as native win32 C++ but the language was so much easier.

    Now I am a full time C# / Java developer and only need to touch C++ on certain projects.

  21. Bounce's avatar Bounce Says:

    I like C++. Or at least the subset I use. You can do truly awful things in it. Yet you can do truly awful things in C too, and there it’s a sport. To me it’s a
    toolchest with all sorts of weird stuff in it and moreover it’s got some things I badly miss in C. I use those. Should I not need them for a particular project, I’ll happily switch back to C just to make the dependencies less complex.Or awk. Or shell. Or whatever else would fit solving the problem better. But then, using g++, I usually turn the non-standard extensions off, crank up the warnings, and write code as clean as I can. This is quite different from what apparently “most” other programmers like to do. I’m not trying to max out the language. I’m trying to get a reliable program.

    As to netscape, having dug through mozilla code, I think they’d’ve been better off without using C++. There’s useful abstractions in C++ but if your programmers don’t understand how to use them, don’t use them. That’s not just netscape’s problem though.And, of course, way back when it just wasn’t mature enough so plenty of what would be straight-forward now got reinvented with autogenerated preprocessor magic and lots more of C style baling spit and wire and whatnots and thingamabobs and Stuff. Maybe a whiff of NIH in there too. But anyway.

    If your programmer base gets big enough it’s more or less time for a domain specific language concocted by a very few language implementing gods who have looked long and hard at the needs of the rest of the programmer base. In that respect C++ is but an exponent of the general folly.

    C++ error messages certainly suck. Especially if you’re using deeply nested templates as found in certain STL implemetnations. But then, I never understood why java had to dump several pages of backtrace on my screen when all that really matters is the first two entries (each spanning five to ten lines already, why?). And only a very few people ever need those, at that. The majority is just /users/ and doesn’t understand any of it. Best keep that to compile time then.

    My own run-ins with java weren’t very good though. So it was 1997 and the university had just turned to it for primary teaching because that was cool or something. The ink in the textbooks was barely dry and they were full of bugs — like this gem: “the goto keyword is reserved for future use”. And forgot to mention little things like how the java system, by design, will barf, fall over and die, if you so much as put two different public classes in the same file. Oh the offense!

    Or the final static main thing or just what that particular hack was. It felt arbitrary like C’s main — I happen to understand how object files and
    init routines do their thing, and with that, main is simply an arbitrary convention — but also trying to replace simple convention with some sort of object oriented shoehorning. I quickly gave up after that. C++ is quirky but doesn’t lie about it. Most every wart and gimmick has a perfectly good rationale behind it once you understand the technicalities. Though admittedly those technicalities can be… pretty technical.

    I’m just now trying to learn lisp — again, this isn’t the first attempt, having previously acquired an actual copy of the wizard book (those don’t exactly grow on trees around here) and having run head-long into the math requirements. But the thing that time and again gets me is the sheer arrogance of each and every time, every single implementation and tutorial or book or howto, sneaking in a requirement to also learn emacs. Well, sod that. I like vi. In my case, nvi. And it edits files just fine, thank you. I positively absolutely empathically very much really don’t care that emacs is supposed to be better. That barrier to entrance should just not exist. Talk about completely irrelevant hurdles to learn a _language_.

    In comparison, that seems like an amazingly easy fix. Yet in the how many years now that it exists, nobody saw fit to actually do it. Or a compromise such as to simply respect $VISUAL.

    The point? Just about every language has its weird things. Python has (“funky indentation for fun and profit”), ruby has (“memory leaks considered acceptable”), and, well, you could go on forever. I’ll say that for some reason C++ is very widespread and also quite often ill-understood. No grasp of how to make functional interfaces or even what OO really entails. Maybe too many essentially disinterested wage code grinders. In a sense maybe the new COBOL. The language doesn’t exactly make it easy to “get it”, though once you do it’s a fine toolshed. Maybe that’s what turns people off: There’s plenty good in there, it’s just not very obvious to get it out. As I-forgot-who said, there’s a small and elegant language buried in there that’s yearning to get out.

    • Alpheus's avatar Alpheus Says:

      With regards to editors–I’ve gone from vi to Kate (via KDE Linux) to Emacs, and I’ll likely be going back to vi soon. While I kindof like Emacs (and I like the description of it as “a good operating system in need of an editor), I find it interesting that Paul Graham of Viaweb fame, and Doug Hoyte (author of “Let Over Lambda”) use vi; indeed, Hoyte feels that Emacs distracts from the macro power of Lisp.

      So I, too, feel that tying Emacs to Lisp programming is a mistake…in much the same way as tying Java to Eclipse would be. Languages ought to be viewed independently from editors.

  22. Ed's avatar Ed Says:

    The one thing that amuses me, is that even long experienced c++ coders cannot generally pass c++ tests. Almost all the arguments miss the point by a country mile though. Coding is used to solve commericial domain problems, and not for any other reason in the main (sorry) c++ is simply not suitable for a commerical environment as far far too much effort is understanding how to get c++ to compile, run properly etc, and nothing like enough effort solving the actual domain problem, viz, expert c++ programmer, doesn’t understand the domain, fiance, engineering ,, whatever = a pile of crap. expert domain knowledge doesn’t know c++ too well = pile of crap. c++ simply gets in the way of solving business domain problems, by adding complexity subtlety plus and absolutely awful syntax, frankly it now looks like someone headbutted the top row of the keyboard whilst pressing the shift key.

    Me C/C++ dev for 15 years, now, manage developers, and stay well well away from code.

  23. Alpheus's avatar Alpheus Says:

    My own experience with C++ is kindof interesting. When I first started programming, I used BASIC on an Atari 800XL, and on a beast of a machine my Dad brought home from his work at Sperry-Univac. When I wanted to program a game, my dad suggested I learn C, and when I went to the library to look up a C book, I found “C++ Primer Plus” by the Waite Group.

    I fell in love with what was, at the time, a somewhat simple language; indeed, I liked C++ as much for the C syntax as I did C++ itself.

    In my first year of college, I used C++ in my computer classes, but explored other languages. The languages that intrigued me the most–Assembler, Forth, APL, and Lisp–were languages radically different from C; the languages I despised the most–Pascal, Modula-2, Ada–were like C, but changed the syntax in stupid ways.

    I then took a three-year break from college, but when I got back, I learned that the department switched to a weird new language–Java–but my anxiety was put to rest when I saw it had a strong C-ish feel to it.

    In my final year of college as an undergraduate, I discovered Python, and thought it was the last language I was ever going to use. I have since then used Perl, SQL, JavaScript, and PHP, and most recently I have wanted to learn Haskell, Common Lisp, Erlang, and Smalltalk.

    In the last couple of years, I have used C++ to optimize a hash algorithm; in doing so, however, I have had to sort through half-a-dozen “gotchas” that had nothing to do with my optimizations. Between that, and what I have been reading recently about other languages, I have been very loath to the idea of using C++, Java, or Perl.

    I’m now a PhD mathematician; as such, I really appreciate the power of abstraction–and so I am naturally attracted to languages like Lisp and Forth, that allow us to leverage abstraction in powerful ways. Languages like C++, Java and Perl, to the extent that they might allow abstraction, are painful to use–they put too many gotchas in the way of abstracting ideas–and this is a direct result of all the complexity required to express a simple idea.

  24. 188 Days to go - Vivec Entertainment Says:

    […] as much as I could and do everything in C at Netscape.The quote above is from an article called C++ from Coders at Work. It’s about how fucked up C++ is as a programming language. Quite a few very influential and […]

  25. aidenn0Jason's avatar aidenn0Jason Says:

    I know I’m commenting on an ancient post, but as someone who works in the embedded industry, I see a lot of C and C++. My opinion is that C++ and C really do take the same approach for feature design:

    For any given feature, what is the easiest way to specify it so that the compiler writers don’t have to do too much work.

    Now C is much more usable than C++ only because it has so many fewer features.

    In both languages you can very easily reason about the generated assembly for non-optimizing compilers, but C++ has many features that are painfully slow without more advanced optimizations, whereas the same is not true about C (though the scope of allowed optimizations are one place where people get tripped up with C).

  26. Oleg Alekseev's avatar Oleg Alekseev Says:

    Was postponed to the negative attitude of encoders with + +
    All this is merged into the post “C + + in Coders at Work”
    The only one who defended the C language was Ken Thompson and little Donald Knuth.

  27. Oleg Alekseev's avatar Oleg Alekseev Says:

    //amended the text
    After reading the book it was postponed to the negative attitude of coders with С+ +
    All this is merged into the post “C + + in Coders at Work”
    The only ones who who defended the C language was Ken Thompson and little Donald Knuth

  28. Unknown's avatar From Android to iOS: Coding | EP Studios Says:

    […] in some ways more elegant approach to adding objects to C than that of C++, which has become almost too complex to use. ?And thankfully when I took up Objective C the language had introduced ARC (automatic reference […]

  29. Not Impressed's avatar Not Impressed Says:

    I entered computing in the late 1980’s, which was probably a “golden-period” for learning to program. It was the first time that a programmer could have an entire machine to himself/herself, with very fast edit/compile/link/execute/debug cycles. Had I started a few years earlier, I would have been using punch cards. A few years later, and I would have been overwhelmed by the Internet revolution.

    I know that there are a lot of people who are reading this post would simply like for C++ to die. I am going to explain why those people feel that way, IMO, after pointing out a few mundane facts about C++.

    1. In C++, the Standard Library is technically not part of the language, whereas in languages like JAVA, the library is inseparable from the language. IMO, this is the biggest “drawback” in C++. I feel that the people who made STL were not given sufficient time to “find the classes” in C++. In fact, there are highly-useful container classes that I use every day that simply do not exist in STL. At the very least, the set of primitives should have been made complete. Again, I do not think this is the fault of the creators of STL. It takes time to have enough insight and perspective to “find the classes”. Even more, once those classes are found, one needs a huge amount of self-restraint to not get carried away with fantastic notion – I am talking about the separation of algorithms and objects here.

    2. Languages like JAVA/C#/Python/etc. are not really portable. Supporters of these non-C/C++ languages hijacked the interpretation of “portable” (no pun intended). By definition, and by precedent, portability meant that a language could be compiled and executed for pretty much any machine: past, present, and future. This is not true for the non C/C++ languages. Those languages often only run on one machine – the virtual machine in which they execute. Ironically, those virtual machines are often written in a truly-portable language, like C or C++. There are machines from the 1970’s that will run C/C++, but will not run Java. There are machines that will exist after 2020 that will run C++, but not Ruby.

    4. C++ is not “just another programming language”. It is impossible to be an excellent C++ programmer without being a good software engineer. And it is impossible to be an excellent software engineer without understanding computer architecture. Therefore, claiming to be an expert in C++ implies good knowledge of computer architecture. Claiming to be an expert in, say, Ruby, implies no such thing. Evidence of this fact can be seen in recent software-engineering job postings. The recruiter will often write: “Wanted C++/Ruby/Perl/Python programmer.” What is happening here is that the hiring manager actually wants a Ruby or Perl or Python programmer (since the company actually never uses), but they add “C++”, because they know the value of someone who has deep understanding of computer engineering, and that they are more likely to get a candidate with that skill ~if~ the candidate has deep understanding of C++.

    5. In any field of engineering, there are primitives that the engineer must use to build a system. For example, a 15-meter-tall robot will be built of large primitives like steel tubes; medium-sized primitives like hoses, gears, and clamps; and small primitives like resistors, capacitors, and digital accelerometers. A tenet of good engineering is that the toolbox of primitives be (a) complete (b) well-distributed. The second part (b) is particularly important. It means that, if part of your robot needs a 50kg pneumatic tube, so be it: If another part requires a photo-transistor that is the size of a pea, then you have that also. The entire panorama of primitives is optimal when the engineer is able to go “maximally macro” and “minimally micro” and also everything in between. That is a power of C++. C++ allows the engineer to go maximally-macro with data structures that might be over 100MB each and yet still be assigned and copied as if they were scalars. It allows the engineer to go minimally-micro by fiddling with the bits of a memory-mapped I/O register on 8-core CPU that requires software bus-mastering. And it allows hitting every necessity in between. Not even C allows generalized programmer-defined assignment of data structures.

    What do all these facts mean? Power. The power of C++ is unprecedented. It allows a single engineer to create massive applications alone. It allows reachability to the entire system space of computer programming. There is no limit to what can be achieved. Worst-case scenario where C++ is so foreign to the task at hand is that a run-time interpreter can be hosted by a program written in C++. The opposite is not true. Ruby cannot be made to fiddle with DMA registers without help from C++-like code. In some ways,This frightens and/or irritates some people. Many people would rather we all be “more or less in the same boat” when it comes to what can be achieved with our toolboxes. They would rather we all face the same limitations, so as to level the playing field. You can always identify such people easily – they are the ones that want C++ to die, the use of it affects them or not. They would also prefer that, if there is a way to do something, like send a file over the Internet using HTTP, that it be done in a uniform, consistent manager, where everyone does it the same way, even if that way is sub-optimal. In other words, they prefer that the library of the language be part of the language proper. And finally, let’s face it: different brains are wired differently. If I had to play “Mary Had A Little Lamb” on a guitar, at the risk of death, I’d be dead. I have no artistic ability whatsoever, and I am OK with that. This is probably the biggest reason of all. There is a certain uneasiness that comes from knowing your neighbor has mental faculties that allows him to do something that you cannot, something that is currently highly regarded and highly rewarded.

  30. jancajthaml's avatar jancajthaml Says:

    One comment.
    C++ is platform/chipset dependent (if you know multithreading or quantum programming) its really slow for atomic operations and its really unstable (lot of debugging lot of patching etc.)

    Java is platform independent (dependend on JVM) its as fast as you can write (you can embed assembly native link for atomic operations) its is robust if you build it robust.

    I know from ADA,Ruby,Perl,COBOL,C/C++/C#,Java,Objective C so from my work experiences Java MAKES YOU WRITE GOOD CODE IN FIRST PLACE so you will build good architecture from bottom-up. C/C++ makes you use external libraries and rewrite your code for specific platform (chipset) so its more time and work expensive.

    I would highly recommend everyone who is hating on Java or C/C++ to try to write really good and clean code in both and then decide objectively which is better.

    And don’t try to use argument that “C++ has pointers and destructors and phantom references and transient/volatile attributes etc.” because Java have them too, you just were too lazy to notice.

    Sure you can write shitty code like a pig import every JDK1.1 library from 90’s and leave all the optimalisation on Java Heap, but then please don’t be angry on Java but be angry to yourself because you are shitty coder and you didn’t try.

    I have written ARM chipset protocols for bank CISCO routers on top of Java and I would NEVER DO THAT IN C/C++ because of fixed bus and unsigned short hack. That is the magic of JVM –> You are working with virtual instances and even when something goes wrong you can rely of multithreading and soft-reset single instance not whole application.

    Thats just some words to defend Java and C/C++ …. its not about language itself, its about fucking habits of coders who were raised/trained on that language.

    And I admit sometime when I see someones code I just want tu punch them for irresponsibility.

  31. AT's avatar AT Says:

    In my experience, the people who defend C++ are the ones who never really branched out to learn other languages. It’s what they know, so they defend it.

    If the problem is adding object oriented features to C in a backwards compatible way, then Objective C succeeds much more nicely (at being clean, at being object oriented, AND at being backwards compatible).

Leave a comment


Design a site like this with WordPress.com
Get started
淡泊名利是什么意思 尿频是什么意思 类风湿吃什么药好 为什么叫香港脚 小拇指旁边的手指叫什么
晚饭吃什么最健康 呼吸不过来要喘大气是什么情况 生化妊娠什么意思 做梦梦见前男友是什么意思 中老年喝什么奶粉好
外卖是什么意思 749局是什么 开眼镜店需要什么条件 poems综合征是什么病 膝盖肿是什么原因
半夜流鼻血是什么原因 新生儿不睡觉是什么原因 经常口腔溃疡吃什么维生素 白泽是什么神兽 济州岛有什么好玩的
喝荷叶茶有什么好处和坏处xjhesheng.com 蹦蹦跳跳的动物是什么生肖aiwuzhiyu.com 麝香是什么hcv8jop6ns0r.cn mbti测试是什么shenchushe.com 什么叫飘窗hcv8jop3ns0r.cn
金线莲有什么功效hcv9jop8ns3r.cn 伏特加是什么意思hcv7jop6ns8r.cn 什么钱最不值钱hcv8jop3ns4r.cn 甲胎蛋白是什么指标hcv8jop5ns0r.cn seeyou是什么意思naasee.com
尼古丁是什么东西hcv8jop8ns4r.cn 胃火牙疼吃什么药好hcv8jop2ns5r.cn 鼻炎吃什么药hcv8jop9ns8r.cn 一个三点水一个除念什么hcv9jop0ns8r.cn 等闲识得东风面什么意思hcv8jop4ns1r.cn
什么是平舌音什么是翘舌音jasonfriends.com 小燕子吃什么食物hcv9jop1ns8r.cn 吃什么食物可以降尿酸imcecn.com 肠癌是什么原因造成的hcv8jop6ns2r.cn 咳嗽挂号挂什么科hcv9jop1ns8r.cn
百度