您的位置:首页 > 编程语言 > C语言/C++

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)

[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:Re:[RFC]Convertbuilin-mailinfo.ctouseTheBetterStringLibrary.
Newsgroups:gmane.comp.version-control.git
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:Re:[RFC]Convertbuilin-mailinfo.ctouseTheBetterStringLibrary.
Newsgroups:gmane.comp.version-control.git
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:Re:[RFC]Convertbuilin-mailinfo.ctouseTheBetterStringLibrary.
Newsgroups:gmane.comp.version-control.git
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:Re:[RFC]Convertbuilin-mailinfo.ctouseTheBetterStringLibrary.
Newsgroups:gmane.comp.version-control.git
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:Re:[RFC]Convertbuilin-mailinfo.ctouseTheBetterStringLibrary.
Newsgroups:gmane.comp.version-control.git
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:Re:[RFC]Convertbuilin-mailinfo.ctouseTheBetterStringLibrary.
Newsgroups:gmane.comp.version-control.git
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


[RFC]Convertbuilin-mailinfo.ctouseTheBetterStringLibrary.
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: