from linus - about c and cpp
TRANSCRIPT
-
8/12/2019 From Linus - About C and Cpp
1/1
From: Linus Torvalds
Subject: Re: [RF! onvert builin-mailinfo.c to use T"e #etter String Librar$.
%e&sgrou's: gmane.com'.version-control.git
(ate: )**+-*,-* +:/*:)0 12T 3 $ears4 5 &ee6s4 7 da$s and // minutes ago8
On Wed, 5 Sep 2007, Dmitry Kakurin wrote:>
> When I first ooked at !it sour"e "ode two thin#s stru"k me as odd:
> $% &ure ' as opposed to '((% )o idea why% &ease don*t tak a+out
porta+iity,
> it*s S%
*YOU*are fu of +ushit%
'(( is a horri+e an#ua#e% It*s made more horri+e +y the fa"t that a ot
of su+standard pro#rammers use it, to the point where it*s mu"h mu"h
easier to #enerate tota and utter "rap with it% -uite franky, e.en if
the "hoi"e of ' were to do *nothing*+ut keep the '(( pro#rammers out,
that in itsef woud +e a hu#e reason to use '%
In other words: the "hoi"e of ' is the ony sane "hoi"e% I know /ies
ader okin#y said 1to piss you off1, +ut it*s a"tuay true% I*.e "ome
to the "on"usion that any pro#rammer that woud prefer the proe"t to +e
in '(( o.er ' is ikey a pro#rammer that I reay *would*prefer to piss
off, so that he doesn*t "ome and s"rew up any proe"t I*m in.o.ed with%
'(( eads to reay reay +ad desi#n "hoi"es% ou in.aria+y start usin#
the 1ni"e1 i+rary features of the an#ua#e ike S34 and oost and other
tota and utter "rap, that may 1hep1 you pro#ram, +ut "auses:
infinite amounts of pain when they don*t work 6and any+ody who tes me
that S34 and espe"iay oost are sta+e and porta+e is ust so fu
of S that it*s not e.en funny
ineffi"ient a+stra"ted pro#rammin# modes where two years down the road
you noti"e that some a+stra"tion wasn*t .ery effi"ient, +ut now a
your "ode depends on a the ni"e o+e"t modes around it, and you
"annot fi8 it without rewritin# your app%
In other words, the ony way to do #ood, effi"ient, and systeme.e and
porta+e '(( ends up to imit yoursef to a the thin#s that are
+asi"ay a.aia+e in '% 9nd imitin# your proe"t to ' means that peope
don*t s"rew that up, and aso means that you #et a ot of pro#rammers that
do a"tuay understand owe.e issues and don*t s"rew thin#s up with any
idioti" 1o+e"t mode1 "rap%
So I*m sorry, +ut for somethin# ike #it, where effi"ien"y was a primary
o+e"ti.e, the 1ad.anta#es1 of '(( is ust a hu#e mistake% 3he fa"t that
we aso piss off peope who "annot see that is ust a +i# additiona
ad.anta#e%
If you want a 'S that is written in '((, #o pay with /onotone% ;eay%
3hey use a 1rea data+ase1% 3hey use 1ni"e o+e"toriented i+raries1%
3hey use 1ni"e '(( a+stra"tions1% 9nd