Dmitry Kakurin和Linus Torvalds关于C++的辩论来回帖子
2009-08-31 15:02
218 查看
From:DmitryKakurin<dmitry.kakurin<at>gmail.com>
Subject:Re:[RFC]Convertbuilin-mailinfo.ctouseTheBetterStringLibrary.
Newsgroups:gmane.comp.version-control.git
Date:2007-09-0604:48:47GMT(1year,51weeks,2days,20hoursand7minutesago)
From:LinusTorvalds<torvalds<at>linux-foundation.org>
Subject:Re:[RFC]Convertbuilin-mailinfo.ctouseTheBetterStringLibrary.
Newsgroups:gmane.comp.version-control.git
Date:2007-09-0617:50:28GMT(1year,51weeks,2days,7hoursand7minutesago)
From:DmitryKakurin<dmitry.kakurin<at>gmail.com>
Subject:Re:[RFC]Convertbuilin-mailinfo.ctouseTheBetterStringLibrary.
Newsgroups:gmane.comp.version-control.git
Date:2007-09-0700:21:37GMT(1year,51weeks,2daysand36minutesago)
From:LinusTorvalds<torvalds<at>linux-foundation.org>
Subject:Re:[RFC]Convertbuilin-mailinfo.ctouseTheBetterStringLibrary.
Newsgroups:gmane.comp.version-control.git
Date:2007-09-0700:38:01GMT(1year,51weeks,2daysand20minutesago)
From:DmitryKakurin<dmitry.kakurin<at>gmail.com>
Subject:Re:[RFC]Convertbuilin-mailinfo.ctouseTheBetterStringLibrary.
Newsgroups:gmane.comp.version-control.git
Date:2007-09-0701:08:40GMT(1year,51weeks,1day,23hoursand49minutesago)
From:LinusTorvalds<torvalds<at>linux-foundation.org>
Subject:Re:[RFC]Convertbuilin-mailinfo.ctouseTheBetterStringLibrary.
Newsgroups:gmane.comp.version-control.git
Date:2007-09-0701:27:46GMT(1year,51weeks,1day,23hoursand31minutesago)
From:DmitryKakurin<dmitry.kakurin<at>gmail.com>
Subject:Re:[RFC]Convertbuilin-mailinfo.ctouseTheBetterStringLibrary.
Newsgroups:gmane.comp.version-control.git
Date:2007-09-0703:09:23GMT(1year,51weeks,1day,21hoursand49minutesago)
[RFC]Convertbuilin-mailinfo.ctouseTheBetterStringLibrary.
Subject:
Newsgroups:
Date:2007-09-0604:48:47GMT(1year,51weeks,2days,20hoursand7minutesago)
[snip] WhenIfirstlookedatGitsourcecodetwothingsstruckmeasodd: 1.PureCasopposedtoC++.Noideawhy.Pleasedon'ttalkabout portability,it'sBS. 2.Brute-force,directstringmanipulation.It'sbothverboseand error-prone.Thismakesithardtofollowhigh-levelcodelogic. -Dmitry
From:LinusTorvalds<torvalds<at>linux-foundation.org>
Subject:
Newsgroups:
Date:2007-09-0617:50:28GMT(1year,51weeks,2days,7hoursand7minutesago)
OnWed,5Sep2007,DmitryKakurinwrote:
>
>WhenIfirstlookedatGitsourcecodetwothingsstruckmeasodd:
>1.PureCasopposedtoC++.Noideawhy.Pleasedon'ttalkaboutportability,
>it'sBS.
*YOU*arefullofbullshit.
C++isahorriblelanguage.It'smademorehorriblebythefactthatalot
ofsubstandardprogrammersuseit,tothepointwhereit'smuchmuch
easiertogeneratetotalanduttercrapwithit.Quitefrankly,evenif
thechoiceofCweretodo*nothing*butkeeptheC++programmersout,
thatinitselfwouldbeahugereasontouseC.
Inotherwords:thechoiceofCistheonlysanechoice.IknowMiles
Baderjokinglysaid"topissyouoff",butit'sactuallytrue.I'vecome
totheconclusionthatanyprogrammerthatwouldprefertheprojecttobe
inC++overCislikelyaprogrammerthatIreally*would*prefertopiss
off,sothathedoesn'tcomeandscrewupanyprojectI'minvolvedwith.
C++leadstoreallyreallybaddesignchoices.Youinvariablystartusing
the"nice"libraryfeaturesofthelanguagelikeSTLandBoostandother
totalanduttercrap,thatmay"help"youprogram,butcauses:
-infiniteamountsofpainwhentheydon'twork(andanybodywhotellsme
thatSTLandespeciallyBoostarestableandportableisjustsofull
ofBSthatit'snotevenfunny)
-inefficientabstractedprogrammingmodelswheretwoyearsdowntheroad
younoticethatsomeabstractionwasn'tveryefficient,butnowall
yourcodedependsonalltheniceobjectmodelsaroundit,andyou
cannotfixitwithoutrewritingyourapp.
Inotherwords,theonlywaytodogood,efficient,andsystem-leveland
portableC++endsuptolimityourselftoallthethingsthatare
basicallyavailableinC.AndlimitingyourprojecttoCmeansthatpeople
don'tscrewthatup,andalsomeansthatyougetalotofprogrammersthat
doactuallyunderstandlow-levelissuesanddon'tscrewthingsupwithany
idiotic"objectmodel"crap.
SoI'msorry,butforsomethinglikegit,whereefficiencywasaprimary
objective,the"advantages"ofC++isjustahugemistake.Thefactthat
wealsopissoffpeoplewhocannotseethatisjustabigadditional
advantage.
IfyouwantaVCSthatiswritteninC++,goplaywithMonotone.Really.
Theyusea"realdatabase".Theyuse"niceobject-orientedlibraries".
Theyuse"niceC++abstractions".Andquitefrankly,asaresultofall
thesedesigndecisionsthatsoundsoappealingtosomeCSpeople,theend
resultisahorribleandunmaintainablemess.
ButI'msureyou'dlikeitmorethangit.
Linus
From:DmitryKakurin<dmitry.kakurin<at>gmail.com>
Subject:
Newsgroups:
Date:2007-09-0700:21:37GMT(1year,51weeks,2daysand36minutesago)
On9/6/07,LinusTorvalds<torvalds<at>linux-foundation.org>wrote:
>OnWed,5Sep2007,DmitryKakurinwrote:
>>
>>WhenIfirstlookedatGitsourcecodetwothingsstruckmeasodd:
>>1.PureCasopposedtoC++.Noideawhy.Pleasedon'ttalkaboutportability,
>>it'sBS.
>
>*YOU*arefullofbullshit.
nice
>C++isahorriblelanguage.It'smademorehorriblebythefactthatalot
>ofsubstandardprogrammersuseit,tothepointwhereit'smuchmuch
>easiertogeneratetotalanduttercrapwithit.Quitefrankly,evenif
>thechoiceofCweretodo*nothing*butkeeptheC++programmersout,
>thatinitselfwouldbeahugereasontouseC.
>
>Inotherwords:thechoiceofCistheonlysanechoice.IknowMiles
>Baderjokinglysaid"topissyouoff",butit'sactuallytrue.I'vecome
>totheconclusionthatanyprogrammerthatwouldprefertheprojecttobe
>inC++overCislikelyaprogrammerthatIreally*would*prefertopiss
>off,sothathedoesn'tcomeandscrewupanyprojectI'minvolvedwith.
Asdinosaurs(whocodeexclusivelyinC)arebecomingextinct,you
willsoonfindyourselfalonewithattitudelikethis.
MeasuringnumberofpeoplewhocontributedtoGitisincorrectmetric.
ObviouslyC++developerscancontributeCcode.Butassumingthatthey
preferitthatwayiswrong.
IwascodinginAssemblywhentherewasnoC.
TheninCbeforeC++wascreated.
Nowdaysit'sC++andC#,andIhaveneverlookedback.
Baddeveloperswillwritebadcodeinanylanguage.Butpenalizing
gooddevelopersforthisillusivereasonofrepealingbadcontributors
isnonsense.
AnywayIdon'tmeantostartareligiousCvs.C++war.It'samatter
ofbeliefsandassuchpointless.
Ijustwantedtogetasenseofhowmanypeoplesharethis"Gitshould
beinpureC"doctrine.
--
-Dmitry
From:LinusTorvalds<torvalds<at>linux-foundation.org>
Subject:
Newsgroups:
Date:2007-09-0700:38:01GMT(1year,51weeks,2daysand20minutesago)
OnThu,6Sep2007,DmitryKakurinwrote:
>
>Asdinosaurs(whocodeexclusivelyinC)arebecomingextinct,you
>willsoonfindyourselfalonewithattitudelikethis.
Unlikeyou,IactuallygavereasonsformydislikeofC++,andpointedto
examplesofthekindsoffailuresthatitleadsto.
You,ontheotherhand,havegivennosanereasons*for*usingC++.
Thefactis,gitisbetterthantheotherSCM's.Andgoodtaste(andC)is
oneofthereasonsforthat.
Ithasnothingtodowithdinosaurs.Goodtastedoesn'tgooutofstyle,
andcomparingCtoassemblerjustshowsthatyoudon'thaveafrigginidea
aboutwhatyou'retalkingabout.
Linus
From:DmitryKakurin<dmitry.kakurin<at>gmail.com>
Subject:
Newsgroups:
Date:2007-09-0701:08:40GMT(1year,51weeks,1day,23hoursand49minutesago)
On9/6/07,LinusTorvalds<torvalds<at>linux-foundation.org>wrote:
>
>
>OnThu,6Sep2007,DmitryKakurinwrote:
>>
>>Asdinosaurs(whocodeexclusivelyinC)arebecomingextinct,you
>>willsoonfindyourselfalonewithattitudelikethis.
>
>Unlikeyou,IactuallygavereasonsformydislikeofC++,andpointedto
>examplesofthekindsoffailuresthatitleadsto.
AsIsaid,it'samatterofbelieves.Assuch,anyreasoningand
arguingwillbeendlessandpointless,asforanyotherreligious
issue.
>You,ontheotherhand,havegivennosanereasons*for*usingC++.
I'llgiveyoureasonswhytouseC++forGit(notwhyC++isbetter
foranyprojectingeneral,asthatagainwouldbepointless):
1.GoodStringclasswillmakecodemuchmorereadable(and
significantlyshorter)
2.GoodBufferclass-samereason
3.Smartpointersandsmarthandlestomanagememoryand
file/socket/lockhandles.
Asitisrightnow,it'stoohardtoseethehigh-levellogicthru
thisendless-busy-workofmicro-managingstringsandmemory.
>Thefactis,gitisbetterthantheotherSCM's.Andgoodtaste(andC)is
>oneofthereasonsforthat.
IMHOGithasabrillianthigh-leveldesign(objectdatabase,using
hashes,simpleandaccessiblestoragefordataandmetadata).Kudosto
you!
Theimplementation:amixtureofCandshellscripts,commandline
interfacethathasevolvedbottom-upisso-so.
>andcomparingCtoassemblerjustshowsthatyoudon'thaveafrigginidea
>aboutwhatyou'retalkingabout.
Idon'tseemyselfcomparingassemblertoCanywhere.
IwaspointingoutthatI'vebeenprogrammingindifferentlanguages
(manymoreactually)andobservedbaddeveloperswritingbadcodein
allofthem.Sothisquality"baddeveloper"isactually
language-agnostic
.
--
-Dmitry
From:LinusTorvalds<torvalds<at>linux-foundation.org>
Subject:
Newsgroups:
Date:2007-09-0701:27:46GMT(1year,51weeks,1day,23hoursand31minutesago)
OnThu,6Sep2007,DmitryKakurinwrote:
>
>Asitisrightnow,it'stoohardtoseethehigh-levellogicthru
>thisendless-busy-workofmicro-managingstringsandmemory.
TotalBS.Thestring/memorymanagementisnotatallrelevant.Lookatthe
code(Ibetyoudidn't).Thisisn'ttheimportant,orcomplexpart.
>IMHOGithasabrillianthigh-leveldesign(objectdatabase,using
>hashes,simpleandaccessiblestoragefordataandmetadata).Kudosto
>you!
>Theimplementation:amixtureofCandshellscripts,commandline
>interfacethathasevolvedbottom-upisso-so.
Theonlyreallyimportantpartisthe*design*.Thefactthatsomeofit
isina"prototypinglanguage"isexactlybecauseitwasn'tthecore
parts,andit'sslowlygettingreplaced.C++wouldin*no*wayhavebeen
abletoreplacetheshellscriptsorperlparts.
AndC++wouldinnowayhavemadethetrulycorepartsbetter.
>>andcomparingCtoassemblerjustshowsthatyoudon'thaveafrigginidea
>>aboutwhatyou'retalkingabout.
>
>Idon'tseemyselfcomparingassemblertoCanywhere.
Youmadeaveryclear"assembler->C->C++/C#"progressionninyour
life,comparingmystayingwithCasa"dinosaur",asifitwassome
inescapableevolutiontowardsabetter/moremodernlanguage.
Withzerobasisforit,sinceinmanywaysCismuchsuperiortoC++(and
evenmoresoC#)inbothitsportabilityandinitsavailabilityof
interfacesandlow-levelsupport.
>IwaspointingoutthatI'vebeenprogrammingindifferentlanguages
>(manymoreactually)andobservedbaddeveloperswritingbadcodein
>allofthem.Sothisquality"baddeveloper"isactually
>lan
From:DmitryKakurin<dmitry.kakurin<at>gmail.com>
Subject:
Newsgroups:
Date:2007-09-0703:09:23GMT(1year,51weeks,1day,21hoursand49minutesago)
On9/6/07,LinusTorvalds<torvalds<at>linux-foundation.org>wrote:
>OnThu,6Sep2007,DmitryKakurinwrote:
>>
>>Asitisrightnow,it'stoohardtoseethehigh-levellogicthru
>>thisendless-busy-workofmicro-managingstringsandmemory.
>
>TotalBS.Thestring/memorymanagementisnotatallrelevant.Lookatthe
>code(Ibetyoudidn't).Thisisn'ttheimportant,orcomplexpart.
NotonlyhaveIlookedatthecode,I'vealsodebuggeditquiteabit.
GrantedmostofmyproblemshadtodowithhandlingpathsonWindows
(i.e.stringmanipulations).
Letmesnip"CisbetterthanC++"part...
>[snip]
...andexplainwhereI'mcomingfrom:
Mygoalisto*use*Git.Whensomethingdoesnotwork*forme*Iwant
tobeabletofixit(andcontributethefix)in*shortesttime
possible*andwith*minimalefforts*.Asformeit'sadiversionfrom
mymainactivities.
ThefactthatGitiswritteninCdoesnotreallycontributetothatgoal.
SuggestiontouseC++istheonlyalternativewithexistingCcodebase.
SowhileC++maynotbethebestchoice"academicallyspeaking"it's
prettymuchtheonlypracticalchoice.
"Democracyistheworstformofgovernmentexceptforallthoseothers
thathavebeentried."-WinstonChurchill
Now,IrealizethatI'maveryinfrequentcontributortoGit,butI
wantmyopiniontobeheard.
PeoplewhocarrythemainweightofdevelopingandmaintainingGit
shouldmakethecall.
--
-Dmitry
相关文章推荐
- 整理的一个csdn的帖子,关于C++中的对齐的
- [C++基础]cout与wcout,printf与wprintf,ofstream与wofstream关于输出中文的问题解决
- Dev-C++下关于几种int类型格式符的实验
- Dev-C++下关于char类型的实验
- 关于c++中的char和bool
- C++中关于堆和栈的说法,哪个是错误的:
- 关于Buffer的问题 C++之GetBuffer函数详解
- 关于C/C++和Java中的j=j++问题
- 关于如何在C++应用程序中创建持久化对象的解决方案简析
- 关于C++的虚函数和多态性
- 关于C++中的友元函数的总结
- C++关于创建菜单的问题
- c++关于内存释放(栈与堆)
- 关于C++ 除法丢失数据
- C++:关于构造函数
- 关于C++ const 的全面总结
- 打通 C++ 和 C# 关于 COM 组件互相调用的任督二脉
- 关于c++多态性实现的理解过程(给自己看的总结,比较跳跃)
- 关于c++中导入外部应用程序的方法
- [C++] 关于C++ const 的全面总结