Life/일기

C/C++ 언어는 장난이었다

smores 2007. 12. 14. 04:34

아래의 기사 중 Stroustrup의 인터뷰(C++ 관련)는 예전에도 어느 블로그에서 읽은 바 있었는데 (한글판) 오늘 또 찾았습니다 (이번에는 C언어까지 포함되었습니다). 내용이 상당히 그럴듯 해서 진짜인 줄 알았다가 오늘 영문 원본을 찾아 보니 아무래도 유머인 듯 하네요. Stroupstrup 인터뷰 원문을 한 Joke Site에서 찾았습니다.

하지만 요즘 회사에서 C++ 프로그래밍을 하는 중 class 기반의 프로그램에다가 STL 기능을 합치고 수만줄이 되는 코드를 읽다보니 느끼고 있는 점 중 상당부분이 인터뷰에서 나오는 이야기에 공감을 가게 만듭니다.  :P


출처: http://alpu.egloos.com/2993052


C언어가 장난이다 ?!


제작자들의 충격고백, "유닉스, C는 장난이었다!"

컴퓨터 산업을 뒤흔든 한 발표에서 켄 톰슨, 데니스 리치, 브라이언 커니건, 이상 3명은 그들이 만든 유닉스와 C언어가 20년동안이나 살아남은 단지 매우 공들인 만우절 장난이었음을 고백했다. 최근의 유닉스월드 소프트웨어 개발 포름에서 톰슨은 다음과 같은 사실을 고백했다.

"1969년 AT&T는 GE/Honeywell/AT&T가 공동으로 진행했던 멀틱스 프로젝트를 끝냈습니다. 브라이언과 저는 니콜라우스 워스(역자주:이 이름을 어떻게 읽느냐 하는 것에 대해서는 시비를 걸지말길 바란다. 대부분 자기 맘대로 읽고 있고 난 지금 '영어'를 쳐다보고 있는 것만으로도 머리가 아프다) 교수의 스위스 ETH연구실에서 개발된 파스칼의 초기판을 가지고 일하고 있었고, 그 세련된 단순함과 언어의 막강함에 감명을 받았었죠. 데니스는 당시 막 `Bored of the Rings(반지에 질렸다???)'를 다 읽었던 참이었는데 아시다시피 그 소설은 대문호 톨킨의 `Lord of the Rings(반지의 주인)' (역자주 : 이 책은 환상(fantasy) 소설의 효시로서 톨킨의 뛰어난 고대언어학지식을 기반으로 쓰여진 불후의 명작이다. 울티마, 로그, 영화 코난 등의 환상 소설 류의 게임 및 영화는 아마 이 소설이 없었다면 존재하지 못했을 것이다. 반지전쟁 이라는 이름으로 번역된 바 있다)을 흉내낸 국가 풍자 패러디의 하나였습니다. 장난으로 우리는 멀틱스 환경과 파스칼의 패러디를 하기로 결정했죠.
데니스와 저는 운영체제를 맡았습니다. 우린 멀틱스를 보고 -가능한 아주 복잡하고 암호같이 모호해서- 일반 사용자들은 아예 사용할 엄두를 내지도 못할 새로운 시스템을 설계했습니다. 그리고, 멀틱스의 패러디로 이름을 유닉스로 정했죠. 뭐 일부는 좀 비꼬는듯한 암시를 주기 위한 이유도 있었지만요. 그 다음 데니스와 브라이언은 파스칼을 완전히 뒤섞어 놓은 듯한 언어를 만들고 이름을 'A'라고 했습니다. 그뒤 사람들이 그 언어로 진짜 중요한 프로그램을 개발하려고 시도하고 있다는 것을 알고나서 우리는 재빨리 언어를 암호화해서 더욱 사용하기 어렵게 만들었고 이 언어는 'B'언어를 거쳐 BCPL, 그리고 결국 C가 되었습니다. 우린 다음과 같은 문장을 깨끗하게 컴파일 할 수 있을 때가 되서야 비로서 개발을 중단했습니다
for(;P("\n"),R-;P("|"))for(e=C; e-; P("_"+(*u++/8)%2))P("|"+(*u/4)%2);
현대의 프로그래머들이 이렇게 암호같은 문장을 허용하는 개떡같은 언어를 사용할 것이라고는 전혀 생각지 못했습니다. 그건 우리의 상식밖이었죠. 우린 실제로 이걸 소련에 팔아서 소련의 컴퓨터 과학기술을 20년이상 퇴보하게 만들 생각이었거든요.
상상해보세요. AT&T와 다른 미국회사들이 실제로 유닉스와 C를 사용하려고 발악하기 시작했을 때 우리가 얼마나 놀랐겠는지. 그 기宕湧?이 1960년대의 기술적 패러디를 이용해서 근근히 써먹을 만한 응용 프로그램을 개발하기에 충분한 기술을 축적하기까 지는 20년이 걸렸습니다. 하지만, 우린 일반적인 유닉스, C 프로그래머들의 고집에 매우 감명을 받았습니다 (물론 농담입니다. 그게 어디 재정신입니까?).
브라이언, 데니스, 그리고 저는 지난 몇 년간 어떤 일을 하든 애플 매킨토시 에서 파스칼만을사용하고 있습니다. 그리고, 사실 오래전의 우리의 어리석은 장난으로부터 야기된 혼돈과 혼란과 진짜 엉망이 된 프로그래밍에 대해 진정으로 죄의식을 느끼고 있습니다."

AT&T, MICROSOFT, 휴렛 패커드, GTE, NCR, DEC 등을 포함한 주요한 유닉스, C 판매업자들과 고객들은 이때 그 사실에 대한 어떠한 평도 거부했다. 터보 파스칼, 터보 C/C++등의 파스칼과 C툴 개발로 유명한 볼랜드사는 다음과 같이말했다.

"우린 이미 몇년동안 이 사실에 대해 의심하고 있었습니다. 그래서 지속적으로 파스칼 제품을 향상시키고 C제품을 개발하는데 더이상의 지원을 하지 않을 생각입니다."

한편, IBM의 대변인은 순간 대책없이 웃어대기 시작하더니 결국 급히 요청한 RS-6000에의 운명에 대한 기자회견을 연기해야만했고 단지 'VM이 지금 정말로 곧 나올겁니다'라고 말했다. 파스칼, 모듈라2와 오베론 언어를 만든 ETH연구소의 니콜라우스워스교수는 조금은 비비꼬은 말로 P.T.Barnum이 맞았다고만 말했다.

최근 나온 관련된 이야기에 믿을 만한 정보통에 따르면 MICROSOFT의 빌게이츠도 MeSsy-DOS와 원도즈운영체제에 관해 이와비슷한 고백을 곧 할 것이라고 한다. 또한, IBM의 대변인은 Virtual Machine(VM) 제품이 아예 빗나간 국제적인 장난이라는 사실을 부인하기 시작했다.

.. 하지만 그 중에서도 우리의 장난을 꿰뚫어 본 사람이 있었다. 그는 Stroustroup이라는 사람으로 우리의 장난을 꽤 재미있어 했다.

그리고 그도 우리의 놀이 동참하기 시작하였다. 그는 C를 더욱 복잡하게 만들어 도저히 사용할 수 없도록 만들기 시작했다. 그리하여나온 것이 바로 C++ 라고 하는 언어였다. 그가 C++를 발표하자 모든 사람들은 다시C++를 지원하려고 노력을 하기 시작했고 ANSI 에서도표준화 연구를 위해 대거 인원이 투입되었다. 그러자 Stroustroup은 당황하기 시작하였다. 그래서 더욱 헷갈리도록 하기 위해 탬플릿을추가하였고 예외처리도 넣었다. 그래도 사람들이 계속 따라오려고 노력을 하자 다중상속을 추가하여 컴파일러 구현을 거의 불가능하게 만들었지만 vendor들은 기를 쓰고 이를 구현하려고 노력을 하였던 것이다.



1998. 1. 1., Bjarne Stroustrup는 IEEE Computer지와 인터뷰 했다.

자연스럽게 편집자는 그가 C++을 창조한 당사자로서 7년간의 object-oriented 설계에대한 종합적인 의견을 보여주리라 생각했다.

인터뷰가 끝날 즈음, Interviewer는 그의 기대 이상의 것을 알게 되었고, 편집자는 '산업계의 이익'을 위해 그 내용을 편집하기로 하였으나,세상 만사가 그렇듯이 비밀은 없다.

다음은 편집되지 않은 완전한 대화 내용이며, 따라서 인터뷰 계획만큼정리되어 있진 않다.


Interviewer
예, 당신이 소프트웨어 설계의 세계를 바꾼지도 수년이 지난 지금어떻게 생각하십니까?

Stroustrup
사실 당신이 도착하기 전 그것을 생각하고 있었죠.기억하십니까? 모든 사람들이 'C'를 사용하고.. 문제는 그들이 아주 전문가였다는 점입니다. 대학에서도 C를 매우 훌륭히 가르쳤습니다. 졸업생들은 아주 *유능*했습니다.이것이 문제가 되었습니다.

Interviewer
문제요?

Stroustrup
예. 모든 사람들이 코볼을 쓰던 시절을 기억하십니까?

Interviewer
물론이죠.

Stroustrup
글쎄요, 초창기에 이들은 거의 신이었죠.높은 보수와 귀족 대우를 받았습니다.

Interviewer
그런 시절이었죠.

Stroustrup
그래요. 그래서 어떻게 되었습니까? IBM은 이것에불만이었고 프로그래머들의 교육에 수백만불을 투자하여 마침내 백여명 정도의 인원을 길렀습니다.

Interviewer
그게 바로 제가 그만둔 이유입니다. 보수가 1년만에 저널리스트 보다 적은 수준으로 떨어졌습니다.

Stroustrup
그렇습니다. 'C'프로그래머에게도 마찬가지 일이 일어났죠.

Interviewer
그렇군요, 근데 요점이 무었입니까?

Stroustrup
글쎄요, 하루는 제 사무실에 앉아서 보다 균형을 맞게 하기 위한 작은 계획에 대해 생각했습니다. 이런 생각을 했죠.'무척 배우기 힘든 복잡한 언어가 있다면.. 그래서 아무도 감히 프로그래머가 되려고 하지 않을 만큼.. 과연 어떨까? '실제로 많은 아이디어를 X 윈도우(X10)에서 가져왔습니다. 이 형편없는 그래픽 시스템은 Sun 3/60에서만 돌았습니다.제가 원하는 모든 요소가 여기 있었죠. 우스꽝스러울 만큼 복잡한 문법, 애매한 함수, pseudo-OO 구조. 지금도 아무도 순전한 X 윈도우 코드를 작성치 않습니다. 제정신이라면 Motif만이 유일한 도구이죠.

Interviewer
진심입니까..?

Stroustrup
사실입니다. 실제로 다른 문제도 있었습니다. 유닉스가 C로 쓰여졌지요, 즉 어떤 C 프로그래머도 쉽게 시스템프로그래머가 될 수 있단 의미지요. 한때 메인프레임의 시스템 프로그래머가 얼마나 벌었는지 기억하십니까?

Interviewer
물론입니다, 제가 한때 시스템 프로그램을 했었죠.

Stroustrup
좋습니다, 따라서 유닉스와 언어를 결합하는 모든 시스템 콜들을 감춤으로써, 새로운 언어는 유닉스와의 결별하도록 해야 했습니다.이는 DOS만 아는 사람들도 왠만한 소득을 벌 수 있게끔 했습니다.

Interviewer
믿을 수 없는 예기군요...

Stroustrup
글쎄요, 이미 시간이 지났지만 지금쯤은 사람들이 스스로 C++가 시간 낭비였다는 것 깨달았을 겁니다. 제 생각보다 훨씬뒤늦은 일이지만요.

Interviewer
그래서 실제로 어떤 식으로 하였습니까?

Stroustrup
사실 단지 장난이었을 뿐이었습니다, 사람들이 제 책을 진지하게 받아들이리라 생각치 않았습니다. 두뇌가 반이라도있다면 object-oriented 프로그래밍이 반직관적이고, 비논리적이고 비효율적이란 걸 알 수 있습니다.

Interviewer
뭐라구요?

Stroustrup
또 '재사용 가능 코드'를 보세요. 한번이라도 코드를 재사용하는 회사에 대해 들어 보셨습니까?

Interviewer
글쎄요, 아니요, 하지만...

Stroustrup
그렇습니다. 초기에 소수 회사가 시도는 했었죠. 오레곤의 Mentor Graphics사가 90, 91년도에 모든 코드를 C++로 재작성 하다가 크게 혼난적이 있습니다. 이에 대해 진심으로 유감스럽게 생각했었죠. 다만, 우리는 실수로부터 배워야 한다고 생각했습니다.

Interviewer
물론입니다. 그래서 사람들이 교훈을 얻었습니까?

Stroustrup
천만에요. 문제는, 대부분 회사들이 중요 실수들을 감추려 든다는 겁니다. 3천만불 손실을 주주들에게 설명하는걸 어려워하지요. 그래도 공이 아주 없는 것은 아닙니다.결국에는 뭔가 해내었지요.

Interviewer
그래요? 글쎄, 그렇다면, OO(Object Oriented)가 성공했다는 거네요.

Stroustrup
글쎄요, 거의.. 실행코드가 매우 컸습니다. 128MB RAM의 HP 웍스테이션에서 로드하는 데 5분 걸렸습니다. 실행는 더 엄청 오래 걸렸습니다. 실제 이것이 중요한 장애물이 되리라 생각했고 1주안에 모두 이를 알아차릴 것으로 짐작했습니다만, 아무도 신경쓰지 않더군요. Sun과 HP는 엄청난 파워의 머신을 판매하는 데 신이 났죠, 단지 작은 프로그램들을 실행키위해 엄청난 리소스를 필요로 하는.. AT&T에서 첫 C++ 컴파일러를 가지고 'Hello world'를 컴파일 하고 2.1MB라는 믿을 수 없는 크기의 실행코드가 나왔었죠.

Interviewer
네? 글쎄요, 컴파일러는 많이 개선되었죠, 그 이후로..

Stroustrup
그럴까요? 최신 버젼의 g++에서 한번 해보세요. 1/2메가 이상은 될겁니다. 또한, 세계 각지의 최근의 예들도 많습니다. British Telecom이 큰 위기를 당할뻔 했으나 운좋게 벗어나서 다시 시작할 수 있었습니다. 이들은 Australian Telecom보다 운이 좋았죠. 지금은 지멘스가 공룡을 만들고 있다는 군요. 실행코드를 저장하기 위한 하드웨어가 점점 커짐에 따라 우려도 커지고 있다고 합니다. 이래도 multiple inheritance가 좋습니까?

Interviewer
예, 하지만 C++는 기본적으로 적절한 언어이지요.

Stroustrup
그걸 믿습니까? 한번이라도 C++ 프로젝트를 해본 적이 있습니까? 사정은 이렇습니다: 아주 소규모의 프로젝트만이 첫 시도에 성공할 만큼 함정을 많이 만들었습니다. 연산자 overloading을 봅시다.프로젝트가 끝날 무렵, 거의 모든 모듈에서 이걸 사용합니다. 보통, 사람들은 교육 과정에서 그랬듯이, 그래야만 한다고 생각하기때문이죠. 같은 연산자가 각각의 모듈에서 제각기 다른 의미를 갖게 됩니다. 전부 모아 놓으면 백여개의 모듈이 됩니다.이제 data hiding을 봅시다. 각 모듈들이 서로 대화하게 함으로써 문제를 만들어 내는 회사들을 보면 웃지 않을 수 없습니다. 'synergistic'이란 말은 프로젝트 관리자의 가슴을 후벼파기 위해 만들어 진 게 아닌가 합니다.

Interviewer
정말 어처구니 없군요. 프로그래머의 보수를 높이기 위해 이 모든 걸 했다구요. 한심하군요.

Stroustrup
꼭 그렇지만 않습니다. 누구나 선택이 있습니다. 이렇게까지 문제가 커질 줄은 몰랐습니다. 어쨌든, 저는 기본적으로 성공했습니다. C++는 이제 죽어가고 있습니다. 하지만 프로그래머들은 여전히 높은 보수를 받습니다. 특히 이 모든 문제들을 관리하는 불쌍한 사람들은요.. 당신이 실제로 작성한 게 아니면, 방대한C++ 소프트웨어 모듈을 관리하는 게 불가능 한 것을 알겁니다.

Interviewer
어떻게요?

Stroustrup
아는지 모르겠군요, typedef 기억하세요?

Interviewer
그럼요.

Stroustrup
변수 'RoofRaised'가 double precision 이란걸 겨우 찾아내기 위해 얼마나 오래 헤더 화일들을 뒤져야 하는지 아시죠? 대형 프로젝트에서 모든 클래스들에 있는 implicit한 typedef들을 찾는데 얼마나 걸릴지 생각해보세요.

Interviewer
그래서 어떻게 해서 성공했다는 거죠?

Stroustrup
평균적인 'C' 프로젝트의 기간이 어느 정도 걸리죠? 약 6개월입니다.부인과 아이들이 있는 사람이 여유있게 살만큼 충분한 기간이 아닙니다. 동일한 프로젝트를 C++로 설계하면 어떨까요? 1년 내지 2년입니다. 대단하지요? 잘못된 결정이 이 모든 안정된 직업을 가져온 셈입니다. 또 있습니다. 오랜 기간 대학에서 C를 가르치지 않은 결과, 이제 훌륭한 C 프로그래머가 부족합니다. 특히 Unix 시스템 프로그래밍의 전문가가요. 오랫동안 'new'을 써온 지금, 'malloc'을 제대로 사용할 줄 아는 사람이 몇명이나 될까요? return 값을 체크하느라 신경쓰는 일도 없죠. 실제로 대부분 C++프로그래머들은 return값을 그냥 내버립니다. '-1'을 쓰는 일은 이제 추억이 되었습니다. 적어도 'throw', 'catch', 'try' 같은 걸 쫓아다니지 않고도 에러가 있다는 걸 알 수 있던 시절이었죠.

Interviewer
하지만 inheritance는 시간 절약을 해주지 않습니까?

Stroustrup
그럴까요? C프로젝트 계획과 C++프로젝트 계획의 차이를 아십니까? C++ 프로젝트의 계획 단계가 3배는 길게 걸립니다. 어떤 부분이 inherit를 해야 하고 어떤 부분이 안되는지 정확히 가려내야 합니다. 그리고 나서는, 여전히 뭔가 잘못 되어있지요. C 프로그램에서 memory leaks가 있을 수 있습니까? 지금은 이걸 찾는 게 회사들의 중요 작업이 되었습니다. 대부분 회사들이 포기하고는 그냥 제품을 내놓습니다. leak이 있다는 걸 다 알면서도 단지 그걸 찾아내는 비용을 줄이기 위해서입니다.

Interviewer
그걸 해주는 tool들이 있잖아요...

Stroustrup
그것들의 대부분도 C++로 작성되었죠.

Interviewer
이 인터뷰가 출판되면, 당신은 아마 린치를 당할 겁니다. 안그렇습니까?

Stroustrup
글쎄요. 말씀 드렸듯이 C++는 이제 전성기를 지났습니다. 정상적인 회사라면 선행 시도(pilot trial)을 안해보고 C++프로젝트를 착수하지 않을 겁니다. 이를 통해서 재앙으로 가는 길이라는 걸 확인할 수 있어야 합니다. 그렇지 못하다면 그 결과는 그들의 책임입니다. 제가 Dennis Ritchie에게 C++로 Unix를 재작성토록 하려 했단 걸 아시죠?

Interviewer
뭐라구요. 그가 뭐라고 했습니까?

Stroustrup
다행히 그는 유머 감각이 있습니다. 그와 Brian이 제가 무슨 짓을 하고 있는지 알아냈다고 생각합니다. 그는 제가 좋아한다면, C++ 버젼의 DOS를 작성하는 걸 돕겠다고 했습니다.

Interviewer
흥미가 있으셨습니까?

Stroustrup
실제로 C++로 DOS를 작성했습니다. 끝나는 대로 demo를 드리겠습니다. 컴퓨터실의 Sparc 20상에서 실행시키고 있습니다.4 CPU에서 엄청난 속도로 실행되고, 70메가 정도의 디스크를차지합니다.

Interviewer
PC에서는 어떻습니까?

Stroustrup
농담이십니까? Windows 95아시죠? 저는 Windows 95를 저의 최대 성공으로 생각합니다. 비록 제가 준비하기도 전에 시합을 끝낸 셈이지만요.

Interviewer
Unix++에 대한 아이디어는 정말 생각해볼만 합니다. 어디선가 누군가 시도를 하겠지요.

Stroustrup
이 인터뷰를 읽은 다음엔 포기하겠죠.

Interviewer
죄송합니다만, 이 인터뷰를 출판할 수 있을 것 같지 않군요.

Stroustrup
하지만 이것은 세기의 스토리입니다. 제가 동료 프로그래머들을 위해 한 일로 인해 제가 기억되기를 바랄 뿐입니다. 오늘날 C++ 프로그래머들이 얼마나 버는지 아십니까?

Interviewer
제가 알기로, 제일 잘나가는 프로그래머는 시간당 칠팔십불 정도이지요.

Stroustrup
그렇죠? 그 정도 될겁니다. 제가 C++에 집어넣은 모든 기능을 파악하는게 보통 일이 아닙니다. 그리고 전에 말씀드렸듯이, 모든 C++ 프로그래머들이 어떤 프로젝트를 하던지, C++의 그 모든 빌어먹을 요소들을 다 사용해야 한다는 강박관념 같은 걸 느낍니다. 이건 가끔 저를 화나게 합니다, 그게 아무리 저의 처음 의도 였지만요. 결국 저는 C++언어를 좋아합니다.

Interviewer
전엔 좋아하지 않았습니까?

Stroustrup
싫어했었죠. 심지어 C++가 지저분하지 않습니까? 하지만 책의 인세가 들어오기 시작하면서... 글쎄요, 아시겠지요?

Interviewer
잠깐요. reference는 어떤가요? C 포인터보다 개선된 것 아닙니까?

Stroustrup
음.. 그거에 대해 항상 의문이었습니다. 처음엔 개선이라고 여겼습니다. 근데, 하루는 C++를 처음부터 써온 친구와 얘기할 기회가 있었습니다. 그는 변수들이 reference되었는지 dereference되었는지 도무지 기억할 수가 없어서 항상 포인터를 쓴다더군요. '*'덕분에 쉽게 알 수 있다더군요.

Interviewer
글쎄요, 보통 이때쯤이면 '대단히 고맙습니다'라고 말하게 되는데 오늘은 그렇기 힘들겠는데요.

Stroustrup
인터뷰를 출판해 주십시오. 요새 제 양심이 많이 좋아지고 있습니다.

Interviewer
나중에 알려드리겠습니다만, 편집장께서 뭐라고 할지 알 수 있습니다.

Stroustrup
어쨌든 누가 믿겠습니까? 테입 복사한 걸 보내주실 수 있습니까?

Interviewer
그럼요.



http://www.ariel.com.au/jokes/An_Interview_with_Bjarne_Stroustrup.html


An Interview with Bjarne Stroustrup
On the 1st of January, 1998, Bjarne Stroustrup gave an interview to the IEEE's 'Computer' magazine.

Naturally, the editors thought he would be giving a retrospective view of seven years of object-oriented design, using the language he created.

By the end of the interview, the interviewer got more than he had bargained for and, subsequently, the editor decided to suppress its contents, 'for he good of the industry' but, as with many of these things, there was a leak.

Here is a complete transcript of what was was said,unedited, and unrehearsed, so it isn't as neat as planned interviews.

You will find it interesting...


--------------------------------------------------------------------------------

Interviewer: Well, it's been a few years since you changed the world of software design, how does it feel, looking back?

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

Interviewer: problem?

Stroustrup: Yes, problem. Remember when everyone wrote Cobol?

Interviewer: Of course, I did too

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

Interviewer: Those were the days, eh?

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

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

Stroustrup: Exactly. Well, the same happened with 'C' programmers.

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

Stroustrup: Well, one day, when I was sitting in my office, I thought of this little scheme, which would redress the balance a little. I thought 'I wonder what would happen, if there were a language so complicated, so difficult to learn, that nobody would ever be able to swamp the market with programmers? Actually, I got some of the ideas from X10, you know, X windows. That was such a bitch of a graphics system, that it only just ran on those Sun 3/60 things. They had all the ingredients for what I wanted. A really ridiculously complex syntax, obscure functions, and pseudo-OO structure. Even now, nobody writes raw X-windows code. Motif is the only way to go if you want to retain your sanity.

Interviewer: You're kidding...?

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

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

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

Interviewer: I don't believe you said that...

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

Interviewer: So how exactly did you do it?

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

Interviewer: What?

Stroustrup: And as for 're-useable code' - when did you ever hear of a company re-using its code?

Interviewer: Well, never, actually, but...

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

Interviewer: Obviously, they didn't?

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

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

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

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

Stroustrup: They have? Try it on the latest version of g++ - you won't get much change out of half a megabyte. Also, there are several quite recent examples for you, from all over the world. British Telecom had a major disaster on their hands but, luckily, managed to scrap the whole thing and start again. They were luckier than Australian Telecom. Now I hear that Siemens is building a dinosaur, and getting more and more worried as the size of the hardware gets bigger, to accommodate the executables. Isn't multiple inheritance a joy?

Interviewer: Yes, but C++ is basically a sound language.

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

Interviewer: I have to say, I'm beginning to be quite appalled at all this. You say you did it to raise programmers' salaries? That's obscene.

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

Interviewer: How come?

Stroustrup: You are out of touch, aren't you? Remember the typedef?

Interviewer: Yes, of course.

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

Interviewer: So how do you reckon you've succeeded?

Stroustrup: Remember the length of the average-sized 'C' project? About 6 months. Not nearly long enough for a guy with a wife and kids to earn enough to have a decent standard of living. Take the same project, design it in C++ and what do you get? I'll tell you. One to two years. Isn't that great? All that job security, just through one mistake of judgement. And another thing. The universities haven't been teaching 'C' for such a long time, there's now a shortage of decent 'C' programmers. Especially those who know anything about Unix systems programming. How many guys would know what to do with 'malloc', when they've used 'new' all these years - and never bothered to check the return code. In fact, most C++ programmers throw away their return codes. Whatever happened to good ol' '-1'? At least you knew you had an error, without bogging the thing down in all that 'throw' 'catch' 'try' stuff.

Interviewer: But, surely, inheritance does save a lot of time?

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

Interviewer: There are tools...

Stroustrup: Most of which were written in C++.

Interviewer: If we publish this, you'll probably get lynched, you do realise that?

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

Interviewer: Oh my God. What did he say?

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

Interviewer: Were you?

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

Interviewer: What's it like on a PC?

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

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

Stroustrup: Not after they read this interview.

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

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

Interviewer: Last I heard, a really top guy is worth $70 - $80 an hour.

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

Interviewer: You mean you didn't before?

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

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

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

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

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

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

Stroustrup: Who'd believe it anyway? Although, can you send me a copy of that tape?

Interviewer: I can do that.

[Note - for the humor-impaired, not a true story]


Anonymous

'Life > 일기' 카테고리의 다른 글

Ka Show vs. Opera Phantom  (0) 2012.03.26
뉴욕의 야경  (0) 2012.03.13
Scale of Universe  (0) 2012.03.13
[KAIST ITC] Smart E-Book Interface Prototype Demo  (0) 2012.01.27
비디오 - Documentary: How Beer Saved the World  (0) 2011.12.13