免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
12下一页
最近访问板块 发新帖
查看: 4461 | 回复: 17
打印 上一主题 下一主题

[C++] 汗!C++的惊天大秘密!C++只是为了提高工资  关闭 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2008-12-05 14:39 |只看该作者 |倒序浏览
C++的诞生只是为了提高程序员的工资!?? 吗呀,不知道是真是假!!


  1.    On the 1st of January, 1998, Bjarne Stroustrup gave
  2.    an interview to the IEEE's 'Computer' magazine.
  3.    Naturally, the editors thought he would be giving
  4.    a retrospective view of seven years of object-oriented
  5.    design, using the language he created. By the end of the
  6.    interview, the interviewer got more than he had
  7.    bargained for and, subsequently, the editor decided to
  8.    suppress its contents, 'for the good of the industry' but,
  9.    as with many of these things, there was a leak. Here is a
  10.    complete transcript of what was said, unedited, and
  11.    unrehearsed, so it isn't as neat as planned interviews.
  12.    You will find it interesting...

  13.    ________________________________________________________________

  14.    Interviewer:

  15.    Well, it's been a few years since you changed theworld of
  16.    software design.  How does it feel, looking back?

  17.    Stroustrup:

  18.    Actually, I was thinking about those days, just before you
  19.    arrived.  Do you remember?  Everyone was writing 'C' and,
  20.    the trouble was, they were pretty damn good at it.
  21.    Universities got pretty good at teaching it, too.  They were
  22.    turning out competent - I stress the word 'competent' -
  23.    graduates at a phenomenal rate.  That's what caused the
  24.    problem.

  25.    Interviewer:

  26.    Problem?

  27.    Stroustrup:

  28.    Yes, problem.  Remember when everyone wrote COBOL?

  29.    Interviewer:

  30.    Of course, I did, too.

  31.    Stroustrup:

  32.    Well, in the beginning, these guys were like
  33.    demi-gods.  Their salaries were high, and they
  34.    were treated like royalty.

  35.    Interviewer:

  36.    Those were the days, eh?

  37.    Stroustrup:

  38.    Right.  So what happened?  IBM got sick of it,
  39.    and invested millions in training programmers, till
  40.    they were a dime a dozen.

  41.    Interviewer:

  42.    That's why I got out.  Salaries dropped within a
  43.    year, to the point where being a journalist actually
  44.    paid better.

  45.    Stroustrup:

  46.    Exactly.  Well, the same happened with 'C' programmers.

  47.    Interviewer:   I see, but what's the point?

  48.    Stroustrup:

  49.    Well, one day, when I was sitting in my office, I
  50.    thought of this little scheme, which would redress
  51.    the balance a little.  I thought 'I wonder what
  52.    would happen, if there were a language so complicated,
  53.    so difficult to learn, that nobody would ever be able
  54.    to swamp the market with programmers?

  55.    Actually, I got some of the ideas from X10, you know,
  56.    X windows.  That was such a bitch of a graphics system,
  57.    that it only just ran on those Sun 3/60 things.  They
  58.    had all the ingredients for what I wanted.  A really
  59.    ridiculously complex syntax, obscure functions, and
  60.    pseudo-OO structure.  Even now, nobody writes raw X-windows
  61.    code.  Motif is the only way to go if you want to retain
  62.    your sanity.

  63.    Interviewer:

  64.    You're kidding...?

  65.    Stroustrup:

  66.    Not a bit of it.  In fact, there was another problem.
  67.    Unix was written in 'C', which meant that any 'C'
  68.    programmer could very easily become a systems programmer.
  69.    Remember what a mainframe systems programmer used to earn?

  70.    Interviewer:

  71.    You bet I do, that's what I used to do.

  72.    Stroustrup:

  73.    OK, so this new language had to divorce itself from Unix,
  74.    by hiding all the system calls that bound the two together
  75.    so nicely.  This would enable guys who only knew about DOS
  76.    to earn a decent living too.

  77.    Interviewer:

  78.    I don't believe you said that...

  79.    Stroustrup:

  80.    Well, it's been long enough, now, and I believe most people
  81.    have figured out for themselves that C++ is a waste of time but,
  82.    I must say, it's taken them a lot longer than I thought it would.

  83.    Interviewer:

  84.    So how exactly did you do it?

  85.    Stroustrup:

  86.    It was only supposed to be a joke, I never thought people would
  87.    take the book seriously. Anyone with half a brain can see that
  88.    object-oriented programming is counter-intuitive, illogical and
  89.    inefficient.

  90.    Interviewer:

  91.    What?

  92.    Stroustrup:

  93.    And as for 're-useable code' --- when did you ever hear of a
  94.    company re-using its code?

  95.    Interviewer:

  96.    Well, never, actually, but...

  97.    Stroustrup:

  98.    There you are then.  Mind you, a few tried, in the early days.
  99.    There was this Oregon company --- Mentor Graphics, I think they
  100.    were called --- really caught a cold trying to rewrite everything
  101.    in C++ in about '90 or '91.  I felt sorry for them really, but
  102.    I thought people would learn from their mistakes.

  103.    Interviewer:

  104.    Obviously, they didn't?

  105.    Stroustrup:

  106.    Not in the slightest.  Trouble is, most companies hush-up all
  107.    their major blunders, and explaining a $30 million loss to the
  108.    shareholders would have been difficult.  Give them their due,
  109.    though, they made it work in the end.

  110.    Interviewer:

  111.    They did?  Well, there you are then, it proves O-O works.

  112.    Stroustrup:

  113.    Well, almost.  The executable was so huge, it took five minutes
  114.    to load, on an HP workstation, with 128MB of RAM.  Then it ran
  115.    like molasses. Actually, I thought this would be a major
  116.    stumbling-block, and I'd get found out within a week, but nobody
  117.    cared.  Sun and HP were only too glad to sell enormously powerful
  118.    boxes, with huge resources just to run trivial programs.  You
  119.    know, when we had our first C++ compiler, at AT&T, I compiled
  120.   'Hello World', and couldn't believe the size of the executable:
  121.    2.1MB

  122.    Interviewer:

  123.    What?  Well, compilers have come a long way, since then.

  124.    Stroustrup:

  125.    They have?  Try it on the latest version of g++ - you won't get
  126.    much change out of half a megabyte. Also, there are several quite
  127.    recent examples for you, from all over the world.  British Tele-
  128.    com had a major disaster on their hands but, luckily, managed to
  129.    scrap the  whole thing and start again. They were luckier than
  130.    Australian Telecom.

  131.    Now I hear that Siemens is building a dinosaur, and getting more
  132.    and more worried as the size of the hardware gets bigger, to
  133.    accommodate the executables.  Isn't multiple inheritance a joy?

  134.    Interviewer:

  135.    Yes, but C++ is basically a sound language.

  136.    Stroustrup:

  137.    You really believe that, don't you?  Have you ever sat down and
  138.    worked on a C++ project?  Here's what happens: First, I've put
  139.    in enough pitfalls to make sure that only the most trivial proj-
  140.    ects will work first time.  Take operator overloading.  At the
  141.    end of the project, almost every module has it, usually, because
  142.    guys feel they really should do it, as it was in their training
  143.    course.  The same operator then means something totally different
  144.    in every module.  Try pulling that lot together, when you have a
  145.    hundred or so modules.  And as for data hiding, God, I sometimes
  146.    can't help laughing when I hear about the problems companies
  147.    have making their modules talk to each other.

  148.    I think the word 'synergistic' was specially invented to twist
  149.    the knife in a project manager's ribs.

  150.    Interviewer:

  151.    I have to say, I'm beginning to be quite appalled at all this.
  152.    You say you did it to raise programmers' salaries?  That's ob-
  153.    scene.

  154.    Stroustrup:

  155.    Not really.  Everyone has a choice.  I didn't expect the thing to
  156.    get so much out of hand. Anyway, I basically succeeded.  C++ is
  157.    dying off now, but programmers still get high salaries, especial-
  158.    ly those poor devils who have to maintain all this crap.  You do
  159.    realise, it's impossible to maintain a large C++ software module
  160.    if you didn't actually write it?

  161.    Interviewer:

  162.    How come?

  163.    Stroustrup:

  164.    You are out of touch, aren't you?  Remember the typedef?

  165.    Interviewer:

  166.    Yes, of course.

  167.    Stroustrup:

  168.    Remember how long it took to grope through the header files only
  169.    to find that 'RoofRaised' was a double precision number?  Well,
  170.    imagine how long it takes to find all the implicit typedefs in
  171.    all the Classes in a major project.

  172.    Interviewer:

  173.    So how do you reckon you've succeeded?

  174.    Stroustrup:

  175.    The universities haven't been teaching 'C' for such a long time,
  176.    there's now a shortage of decent 'C' programmers.  Especially
  177.    those who know anything about Unix systems programming. How many
  178.    guys would know what to do with 'malloc', when they've used 'new'
  179.    all these years and never bothered to check the return code. In
  180.    fact, most C++ programmers throw away their return codes.  What-
  181.    ever happened to good ol' '-1'?  At least you knew you had an
  182.    error, without bogging the thing down in all that 'throw' 'catch'
  183.    'try' stuff.

  184.    Interviewer:

  185.    But, surely, inheritance does save a lot of time?

  186.    Stroustrup:

  187.    Does it?  Have you ever noticed the difference  between a 'C'
  188.    project plan, and a C++ project plan?  The planning stage for
  189.    a C++ project is three times as long.  Precisely to make sure
  190.    that everything which should be inherited is, and what shouldn't
  191.    isn't.  Then, they still get it wrong. Whoever heard of memory
  192.    leaks in a 'C' program? Now finding them is a major industry.
  193.    Most companies give up, and send the product out, knowing it
  194.    leaks like a sieve, simply to avoid the expense of tracking them
  195.    all down.

  196.    Interviewer:

  197.    There are tools....

  198.    Stroustrup:

  199.    ...Most of which were written in C++.

  200.    Interviewer:

  201.    If we publish this, you'll probably get lynched, you do realise
  202.    that?

  203.    Stroustrup:

  204.    I doubt it.  As I said, C++ is way past its peak now, and no
  205.    company in its right mind would start a C++ project without a
  206.    pilot trial. That should convince them that it's the road to
  207.    disaster.  If not, they deserve all they get.  You know, I tried
  208.    to convince Dennis Ritchie to rewrite Unix in C++.

  209.    Interviewer:

  210.    Oh my God.  What did he say?

  211.    Stroustrup:

  212.    Well, luckily, he has a good sense of humor.  I think both he
  213.    and Brian figured out what I was doing, in the early days, but
  214.    never let on.  He said he'd help me write a C++ version of DOS,
  215.    if I was interested.

  216.    Interviewer:

  217.    Were you?

  218.    Stroustrup:

  219.    Actually, I did write DOS in C++, I'll give you a demo when
  220.    we're through.  I have it running on a Sparc 20 in the computer
  221.    room.  Goes like a rocket on 4 CPU's, and only takes up 70 megs
  222.    of disk.

  223.    Interviewer:

  224.    What's it like on a PC?

  225.    Stroustrup:

  226.    Now you're kidding.  Haven't you ever seen Windows '95?  I think
  227.    of that as my biggest success.  Nearly blew the game before I was
  228.    ready, though.

  229.    Interviewer:

  230.    You know, that idea of a Unix++ has really got me thinking.
  231.    Somewhere out there, there's a guy going to try it.

  232.    Stroustrup:

  233.    Not after they read this interview.

  234.    Interviewer:

  235.    I'm sorry, but I don't see us being able to publish any of this.

  236.    Stroustrup:

  237.    But it's the story of the century.  I only want to be remembered
  238.    by my fellow programmers, for what I've done for them.  You know
  239.    how much a C++ guy can get these days?

  240.    Interviewer:

  241.    Last I heard, a really top guy is worth $80 - $90 an hour.

  242.    Stroustrup:

  243.    See?  And I bet he earns it.  Keeping track of all the gotchas I
  244.    put into C++ is no easy job. And, as I said before, every C++
  245.    programmer feels bound by some mystic promise to use every damn
  246.    element of the language on every project. Actually, that really
  247.    annoys me sometimes, even though it serves my original purpose.
  248.    I almost like the language after all this time.

  249.    Interviewer:

  250.    You mean you didn't before?

  251.    Stroustrup:

  252.    Hated it.  It even looks clumsy, don't you agree?  But when the
  253.    book royalties started to come in... well, you get the picture.

  254.    Interviewer:

  255.    Just a minute.  What about references?  You must admit, you
  256.    improved on 'C' pointers.

  257.    Stroustrup:

  258.    Hmm.  I've always wondered about that.  Originally, I thought I
  259.    had.  Then, one day I was discussing this with a guy who'd written
  260.    C++ from the beginning.  He said he could never remember whether
  261.    his variables were referenced or dereferenced, so he always used
  262.    pointers.  He said the little asterisk always reminded him.

  263.    Interviewer:

  264.    Well, at this point, I usually say 'thank you very much' but it
  265.    hardly seems adequate.

  266.    Stroustrup:

  267.    Promise me you'll publish this.  My conscience is getting the
  268.    better of me these days.

  269.    Interviewer:

  270.    I'll let you know, but I think I know what my editor will say.

  271.    Stroustrup:

  272.    Who'd believe it anyway?  Although, can you send me a copy of that
  273.    tape?

  274.    Interviewer:

  275.    I can do that.
复制代码

来源:http://artlung.com/smorgasborg/Invention_of_Cplusplus.shtml

[ 本帖最后由 rocklv 于 2008-12-5 14:43 编辑 ]

论坛徽章:
0
2 [报告]
发表于 2008-12-05 14:43 |只看该作者
。。。这个以前到没听过

论坛徽章:
0
3 [报告]
发表于 2008-12-05 14:56 |只看该作者
哪一段阿 ,太多了  懒得翻译

论坛徽章:
36
IT运维版块每日发帖之星
日期:2016-04-10 06:20:00IT运维版块每日发帖之星
日期:2016-04-16 06:20:0015-16赛季CBA联赛之广东
日期:2016-04-16 19:59:32IT运维版块每日发帖之星
日期:2016-04-18 06:20:00IT运维版块每日发帖之星
日期:2016-04-19 06:20:00每日论坛发贴之星
日期:2016-04-19 06:20:00IT运维版块每日发帖之星
日期:2016-04-25 06:20:00IT运维版块每日发帖之星
日期:2016-05-06 06:20:00IT运维版块每日发帖之星
日期:2016-05-08 06:20:00IT运维版块每日发帖之星
日期:2016-05-13 06:20:00IT运维版块每日发帖之星
日期:2016-05-28 06:20:00每日论坛发贴之星
日期:2016-05-28 06:20:00
4 [报告]
发表于 2008-12-05 14:57 |只看该作者
好像之前在某个地方见过

论坛徽章:
0
5 [报告]
发表于 2008-12-05 14:58 |只看该作者
原帖由 smallstar001 于 2008-12-5 14:56 发表
哪一段阿 ,太多了  懒得翻译



Bjarne Stroustrup是C++的设计者.
  1. Stroustrup:

  2.    Well, in the beginning, these guys were like
  3.    demi-gods.  Their salaries were high, and they
  4.    were treated like royalty.

  5.    Interviewer:

  6.    Those were the days, eh?

  7.    Stroustrup:

  8.    Right.  So what happened?  IBM got sick of it,
  9.    and invested millions in training programmers, till
  10.    they were a dime a dozen.

  11.    Interviewer:

  12.    That's why I got out.  Salaries dropped within a
  13.    year, to the point where being a journalist actually
  14.    paid better.

  15.    Stroustrup:

  16.    Exactly.  Well, the same happened with 'C' programmers.
复制代码

论坛徽章:
0
6 [报告]
发表于 2008-12-05 14:59 |只看该作者
这么说c++是资本家用来剥削我们的工具喽?

论坛徽章:
0
7 [报告]
发表于 2008-12-05 15:02 |只看该作者
原帖由 alexhappy 于 2008-12-5 14:59 发表
这么说c++是资本家用来剥削我们的工具喽?


C++的作者可是为程序员好哦^_^

论坛徽章:
0
8 [报告]
发表于 2008-12-05 15:28 |只看该作者
第一次听说这样的解释!

论坛徽章:
0
9 [报告]
发表于 2008-12-05 16:22 |只看该作者
快两年拉,我在开始脱离C++ 除非公司项目要参与,其它都坚持用c 看c的开源项目 不想在让自己的时间陶醉在越来越复杂的语法中。

论坛徽章:
0
10 [报告]
发表于 2008-12-05 16:25 |只看该作者
原帖由 zhoubug 于 2008-12-5 16:22 发表
快两年拉,我在开始脱离C++ 除非公司项目要参与,其它都坚持用c 看c的开源项目 不想在让自己的时间陶醉在越来越复杂的语法中。



我也坚持不使用C++, 我就喜欢看某些所谓C++高手在那意淫....
C和汇编会是我将来主要的使用工具....
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP