| 订阅 | 在线投稿
分享
 
 
当前位置: 王朝网络 >> c/c++ >> chu xue zhe , ni ying dang ru he xue xi C++ yi ji bian cheng

chu xue zhe , ni ying dang ru he xue xi C++ yi ji bian cheng

2008-06-01 02:10:02 编辑來源:互联网 评论
 
 
 
本文为【初学者,你应当如何学习C++以及编程】的拼音翻译版
  javascript shi shi jie shang zui shou wu jie de yu yan , qi shi C++ he chang bu shi 。 fang jian liu chuan de cuo wu de C++ xue xi fang fa yi zhua jiu shi yi da ba 。 wo zi ji zai xue xi C++ de guo cheng zhong ye zou le xu duo wan lu , lang fei le bu shao shi jian 。
  wei shen me hui cun zai zhe me duo cuo wu shu xi ? yuan yin zhu yao you san ge , yi shi C++ yu yan de xi jie tai duo 。 er shi yi xie wen ming de C++ shu ji zong zai ( bu guan you yi huan shi wu yi ) an shi yu yan xi jie de chong yao xing he you qu 。 san shi xian dai C++ ku de kai fa zhe xue bi xu yong dao yi xie ji jiao ga la de yu yan xi jie ( dan zhu chong , shi ku she ji , bu shi ri chang bian cheng )。 zhe xie gong tong su zao le C++ she qun de zheng ti xin tai he zhe xue 。
  dan shi di yi tiao huan wei bi neng gou cheng qi hou , qi ta yu yan de xi jie ye bu shao ( jin guan bi qi C++ qi lai huan shi xiao wu jian da wu ), jiu na Javascript lai shuo , zuo yong yu gui ze , ming zi cha zhao ,closure,for/in, zhe xie dou shi xi jie , er qie qi zhong huan you wei fan zhi jiao de 。 dan xu duo dong tai yu yan de cheng xu yuan de li nian wo cai da yue shi xue dao na yong dao na ba 。 dan C++ jiu bu yi yang le , xue C++ zhi ren you yi zhong lei si yu bei an shi de qian zai xin tai , jiu shi yi ding yao xian ba yu yan gai xin ji ben shang chi tou le cai neng xia shou xie chu piao liang de cheng xu 。 zhe shou xian jiu cuo le 。 zhe ge yi shi xing cheng de yuan yin zai di er dian ,C++ shu ji 。 shi mian shang de C++ shu ji bu ji qi shu , dan you yi ge gong tong de que dian , jiu shi jiang yu yan xi jie de shu tai duo ——《C++ gotchas》,《Effective C++》,《More Effective C++》, dan wu ke hou fei de shi ,C++ shi zhe yang yi men yu yan : yao na ta man zu xian dai bian cheng li nian de xu qiu , you qi shi C++ ku kai fa de xu qiu , huan bi xu de guan zhu yu yan xi jie , nai zhi yu zai C++ zhong li yong yu yan xi jie yi jing cheng le yi men xue wen 。 bi ru C++ mo ban zai she ji zhi chu gen ben mei you xiang dao mo ban yuan bian cheng zhe hui shi , geng mei xiang dao C++ mo ban xi tong shi tu ling wan bei de , zhe ye jiu dao zhi le 《Modern C++ Design》 he 《C++ Template Metaprogramming》 de jing shi hai su 。
  zhe xie ji shu de chu xian wei shen me jing shi hai su , da ge bi fang , jiu hao bi shi yi kuai da jia dou ren wei yi jing shu xi wu bi , zai wu mi mi ke yan de tu di shang , hu ran mou tian you ren wa dao yuan lai di xia huan wen cang zhe zui feng fu de shi you 。 zai zhe zhi qian de C++ sui ran ye you yi xie xi jie , dan ye huan suan qing yi ba wo , na ke shi C++ cheng xu yuan men de happy old times, yin wei C++ de yi qie dou yi lan wu yu ,everything is figured out。 ran er 《Modern C++ Design》 de chu shi gao su ren men ,“ qiao , huan you duo shao xi jie ni men mei you ba wo a 。” yu shi C++ cheng xu yuan men jiu wei de ji qing bei chong ran qi lai , fen bu gu shen de ta ru xi jie de zhao ze zhong 。 you qi shi , mo ban bian cheng jiang C++ de xi jie jin yi bu wa jue dao le ji zhi —— wo men gan ma guan xin she ji lei dui xiang de yin shi zhuan huan de you xian ji gao di ? kan kan boost::is_base_of jiu ke yi zhi dao you duo gui yi le 。
  dan zui da de wen ti huan zai yu , dui yu zhe xie xi jie de guan zhu huan zhen you ta he shi de li you : wo men yao kai fa xian dai mo ban ku , yao kai fa active library, jiu bi xu dong yong mo ban bian cheng ji shu , yao dong yong mo ban bian cheng ji shu , jiu bi xu li yong yu yan de ji jiao ga la ,enable_if,type_traits, shen zhi lian zao jiu gu jing wu bo de C hong ye zai luan shi zhong chong sheng , kan kan boost::preprocessor you duo gui yi jiu zhi dao le , lian C hong de tu ling wan bei xing ( yu bian yi qi de ) dou bei wa jue chu lai le 。 wei shen me yao zuo zhe xie ? hao wan ? biao bang ? dou bu shi , kai fa ku de shi ji xu qiu 。 dan zhe ye zheng shi zui da de bei ai le 。 zai boost li mian yin shi ji xu qiu er dong yong yu yan xi jie zui zhong ju ran neng shen qi de wan cheng ren wu de zui hao jiao cai jiu shi boost::foreach, zhe ge xiao she shi dui yu yan xi jie de fa jue da dao le jing tian di qi gui shen de di bu , bu xin ni xian shi zhe zi ji qu kan kan ta de yuan dai ma , zai kan kan zuo zhe jie shao ta de wen zhang ba 。 er boost::typeof ye bu gan qi hou ——C++ yu yan li mian you tai duo bei “ fa xian ” er bu shi bei “ fa ming ” de ji shu 。 nan dao zui chu wu yi she zhi zhe xie yu yan gui ze de jia huo men dou shi Oracles?
  yin wei mei you variadic templates, ren men yong hong jia shang que sheng mo ban shen shu lai shi xian lei si xiao guo 。 yin wei mei you concepts, ren men yong mo ban jia shang xi gou han shu de xi jie lai wan cheng lei si gong zuo 。 yin wei mei you typeof, ren men yong mo ban yuan bian cheng he hong jia shang wu jin de xi jie lai shi xian mu biao … C++ kai fa zhe men de DIY jing shen bu ke wei bu qiang 。
  ran er , jia ru jin jin shi yin wei yao kai fa you xiu de ku , na me she ji zhe xie xi jie dou huan shi qing you ke yuan de , zhi shao zai C++09 chu xian bing qie bian yi qi chang shang gen shang zhi qian , zhe xie dou huan neng shuo shi bu de yi er wei zhi 。 dan wo men guang da de C++ cheng xu yuan ne ? da zhong shi qing yi bei wu dao de , wo ye zeng jing shi 。 yi wei ba wo le geng duo de yu yan xi jie jiu geng niu , dan shi ji que shi na xie yu yan xi jie shi you ba jiu shi ping shi bian cheng yong dou yong bu dao de 。C++ zhong zhong duo de xi jie sui ran zai ku she ji zhe shou li mian you qi yong wu zhi di , dan pu tong cheng xu yuan ze gen ben wu xu guo duo guan zhu , you qi shi mei you shi ji dong ji de guan zhu 。 yi ban xing de bian ma shi jian zhun ze , yi ji ji ben de bian cheng neng li he ji ben gong , nai zhi ji ben de cheng xu she ji li lun yi ji suan fa she ji 。 cai shi zhen zheng xu yao hua shi jian ba wo de dong xi 。
  xue xi zui jia bian ma shi jian bi xue xi C++ geng chong yao 。 kan you xiu de dai ma ye bi mai tou yong cha jing de bian ma fang shi xie la ji dai ma yao you xiao 。 zhi jie 、 qing chu 、 ming le 、KISS di biao da yi tu bi wan bian ma hua zhao yao chong yao …
  bi mian qu guo wen ren he yu yan xi jie , chu fei bi yao 。 zhe ge bi yao shi zhi zai shi ji bian cheng dang zhong peng dao wen ti , zhe yang jiu suan xu yao guo wen xi jie , ye shi zui sheng shi de , lan duo zhe yuan ze ma 。 yi ge ba wo le ji ben de bian cheng li nian bing you jiao qiang xue xi neng li de cheng xu yuan zai yong yi men sheng shu de yu yan bian cheng shi jiu suan na zhe na ben yu yan de sheng jing cong suo yin fan qi ye ke yi bian chu he ge de cheng xu lai 。 shi nian xue hui bian cheng bu shi zhi dui mei men yu yan dou de shi nian , na yi bei zi cai neng xue ji men yu yan na , jia ru an zi mu shun xu xue de hua yi bei zi dou bie zhi wang xue dao Ruby le ; shi nian xue xi bian cheng geng bu shi zhi xian ba yu yan te xing cong cu dao xi quan dou chi tou cai gan xia shou bian cheng , zai shi jian zhong ti gao cai shi zui chong yao de 。
  zhi yu zhe zhong kou yu yan xi jie de zhe xue wei he neng zai she qun li mian cheng ye huo liao yuan zhi shi , jiu shi yi ge xin li xue de wen ti le 。 xiang xiang ren men zai lun tan shang tao lun wen ti shi , yi ge dui yu yan ba wo hen xi zhi de ren ken ding neng gou de dao geng duo de pei fu , er you yu lun tan shang de wen ti da duo shi xiao wen ti , suo yi jie jue shi ji wen ti de zhen zheng neng li bing bu neng de dao xian xian , ye jiu shi shuo , zhi shi xing de ren neng gou de dao geng duo pei fu , hou zhe bian cheng wei dong li he fang xiao de fa ma 。 ran er zhen zheng de bian cheng neng li shi yu yu yan xi jie mei guan xi de , shu lian yun yong yi men yu yan neng gou bang ni zui jia biao da ni de yi tu , dan shu lian yun yong yi men yu yan jue bu yi wei zhe yao ba ta de bian bian jiao jiao quan dou ji zhu 。 dong de yi xie chang shi , you le bian cheng de ji ben zhi jiao , peng dao yi xie xi jie cuo wu de shi hou zai qu cha shu , shi zui jie sheng shi jian de ban fa 。
  C++ de shu ,Bjarne de sheng jing 《The C++ Programming Language》 shi gao wu jian ling de 。《 da gui mo C++ cheng xu she ji 》 shi ting wu shi de 。《Accelerated C++》 shi zui jia ru men de 。《C++ Templates》 shi jin zuo shen kao de 。《C++ Template Metaprogramming》 shi jing li guo sheng zhe ke yi wan yi wan de , pu tong cheng xu yuan peng dou bie peng de 。《ISO.IEC C++ Standard 14882》 bu shi na lai du de 。Bjarne zui jin zai zuo C++ de jiao yu , xin shu shi jue dui ke yi qi dai de 。
  
   P.S. guan yu ru he xue xi bian cheng ,g9 de blog shang you xu duo chu se de wen zhang : zhe li , zhe li , zhe li , zhe li … shi ji shang , wo jian yi ni qu ba g9 lao da de blog fan ge di chao tian :P
  zai P.S. shu dan ? wo shi huang yu gei chu yi ge lei si 《C++ chu xue zhe bi du 》 zhe zhong shu dan de 。C++ de shu bu ji qi shu , bei gong ren de hao shu ye bu sheng mei ju 。 zhi bu guo you xie shu qing yi gei chu xue zhe zao cheng yi zhong cuo jiao , jiu shi “ xue xi C++ jiu ying gai shi zhe ge yang zi de ”。 bi ru you peng you ti dao de 《 gao zhi liang C/C++ bian cheng 》, zhe ben shu you jia zhi , dan bu shi he chu xue zhe , chu xue zhe du zhe yang de shu qing yi yi ye zhang mu bu jian tai shan 。 shi ji shang , zheng que de tai du shi , xi jie shi bi yao de 。 dan xi jie shi ci yao de 。 qi shi xue xi bian cheng wo jiao de ying gai zui xian xue xi ru he yong wei ma biao da si xiang ne , jun bu jian 《IntrodUCtion to Algorithm》 li mian de dai ma ?《TAOCP》 zhong de dai ma ? o , dui le ta men shi zi ji jian li de yu yan , dan zhe zhong jin jiao xue mu de de yu yan de mu de jiu shi wei le bi mian rang xie cheng xu de ren yi kai shi jiu wang le xie cheng xu shi wei le wan cheng gong neng , yi wei xie cheng xu jiu shi he yu yan xi jie zuo dou zheng le 。Bjarne shuo cheng xu de zheng que xing zui chong yao ,boost de bian ma biao zhun li mian ye jiang zheng que xing lie zai xing neng qian mian 。
  ci wai , yi dan jian li le zheng que de xue xi bian cheng de li nian , qi shi shen me shu ( zhi yao bu shi tai la ji de ) dou you xie yong chu 。 dou dang cheng shen kao shu , yong de shi hou cong mu lu huo suo yin fan , ji ben jiu dui le 。
  zai zai P.S. myan lao da he g9 lao da dou gei chu le xu duo chu se de jian jie 。 wo bu de bu zai jia shang yi ge P.S。 ju ti wo jiu bu zhai lu le , jia ru ni du dao zhe li , qing wu bi wang xia kan ta men de ping lun 。 zhuan zai zhe bie wang le zhuan zai ta men de ping lun :-)
  xu duo peng you dou wen wo tong yi ge wen ti , dao di yao bu yao xue xi C++。 qi shi zhe ge wen ti wen de hen mei you yi yi 。“ xue C++” he “ bu xue C++” zhe ge er fen fa shi mei yi yi de , wei shen me ? yin wei zhe ge wen ti hen biao mian , shen zhi hen fu zao 。 chong yao de bu shi ni ba wo de yu yan , er shi ni ba wo de neng li , jie yong myan lao da de hua ,“ chong yao de shi zhe ge mo lian guo cheng , er bu shi jie guo , yao de shi ni cu zhuang de tui , er bu shi ni shen shang bei de na dai yan ba 。”。 ci wai xue xi C++ de yi yi qi shi zhen de shi zui weng zhi yi bu zai jiu , xiang C/C++ zhe zhong xi tong ji yu yan , zai xue xi de guo cheng zhong bi xu yao she ji dao yi xie di ceng zhi shi , ru nei cun zhi li 、 bian yi lian jie xi tong 、 hui bian yu yan 、 ying jian ti xi jie gou deng deng deng deng zhi shi ( zhu chong , zhe bu bao kuo guo fen ji jiao ga la de yu yan zhi jie )。 zhe xie dong xi ye jiu shi suo wei de nei gong le ( qi shi zui zui chong yao de nei gong huan shi chang qi xue xi suo mo lian chu lai de zi xue neng li )。 dui ci da zui Joel zai 《Joel On Software》 li mian ti dao de lou dong chou xiang ding lv chan shu de jiu fei chang piao liang 。
  suo yi , da an shi , rang ni cheng wei gao shou de bing bu shi ni ba wo shen me yu yan , jing tong C++ wei bi jiu neng rang ni cheng wei gao shou , bu jing tong C++ ye wei bi jiu neng rang ni cheng wei di shou 。 wo xiang da jia dou bu hui fu yi g9 lao da jia ru yao chao qi C++ zuo yi ge xiang mu de hua hui bi da duo shu zi ren shu lian C++ de ren yao zuo de piao liang 。 suo yi yao hai de bu shi yu yan zhe ge biao ceng de dong xi , er shi di xia de ben zhi mao dun 。 dang ran , bu shi shuo na jiu shen me yu yan dou bu yao xue le , an zhao yi zhong cao cao de luo ji ,“ tian xia yu yan , wei imperative yu declarative er ”。C++ shi qian zhe li mian zui fu duo de yi zhong , zhi chi zui guang fan de bian cheng fan shi 。 jie yong dang chu shu xue xi ru xue da hui shang yi ge lao shi de hua ,“ ni shu xue dou xue le , huan you shen me bu neng xue de ne ?”。 xue yu yan shi yi ge tu jing , jia ru ni ba ta yong lai mo lian zi ji , ke yi 。 jia ru ni ba ta yong lai zuo wei xue xi xi tong di ceng zhi shi de yao shi , ke yi 。 jia ru ni ba ta yong lai zuo wei xue xi ru he bian xie you xiu de dai ma , ru he zu zhi da xing de cheng xu , ru he jin xing chou xiang she ji , ke yi 。 jia ru diao shu dai , guang ken xi jie , wo ren wei bu ke yi ( chu fei ni bi xu yao yong dao xi jie , xiang boost ku de coder men )。
  ran hou zai jie yong yi xia g9 lao da de 《 yin tan he wo men de zhi ye 》 zhong de hua :
  yin tan he wo men de zhi ye fa zhan you shen me xiang gan ? hen jian dan : wo men de ba shi jian yong yu xue xi jie jue ben zhi kun nan 。 xin ji shu gei gao shou dai lai fang bian 。 cai niao men que bu yong zhi wang bei xin ji shu zheng jiu 。 yan yong yi qian de bi yu , yi liu de nie ying shi bu hui yin wei xiang ji de geng xin huan dai er diu diao fan wan , fan er ke neng jie zhu xian jin ji shu liu xia chuan shi jia zuo 。 yin wei nie ying de ben zhi kun nan , huan shi nie ying shi de yi shu gan jiao 。 re men ji shu ye jiu deng yu xiang ji 。 bu ting zhui xin , xue xi zhe ge kuang jia , na ge ruan jian , hao bi cheng tian zuan yan bu tong xiang ji de shuo ming shu 。 er re men ji shu hou de lai long qu mai , cai hao bi nie ying ji shu 。 wei shen me tui chu zhe ge kuang jia ? ta jie jue le shen me qi ta kuang jia bu neng jie jue de wen ti ? ta zai na li shi yong ? ta zai na li bu shi yong ? ta yong le shen me xin de she ji ? ta gai jin le na xie jiu de she ji ?Why is forever. he peng you liao tian shi ti dao Steve McConnell de 《Professional Software Development》 li mian yin le yi ge tiao cha , shuo ruan jian kai fa ji shu de ban shuai qi 20 nian 。 ye jiu shi shuo 20 nian hou wo men xian zai zhi shi li yi ban de dong xi guo shi 。 xiang dang bu huai 。 peng you da qu dao :“ ying gai shuo 20 nian hou IT jie yi ban de ji shu guo shi , wo men xue de guo shi ji shu yuan yuan chao guo zhe ge bi li 。 ju ti dao mou ren , hen ke neng 5 nian ta jiu fei le ”。 hua sui bei guan , dan ke jian xuan ze xue xi nei rong de chong yao xing 。 xue xi ben zhi ji yi ( ji shu chi zao guo shi , ji yi que chang yong chang xin ) huan you yi hao chu , jiu shi bu yong kan zhe zi ji xin ai de ji shu shou dao tiao zhan de shi hou gan hao 。C/C++ guo shi jiu guo shi le bei , zhi yao you qi ta de xi tong bian cheng yu yan 。Java dao le jiu dao le bei , wei bi wo bu neng yong .NET?Ruby tan hua yi xian you ru he 。 jia ru yong de bu shuang , huan dao qi ta dong tai yu yan jiu shi le 。J2EE bei fei le you zen yang ? wei bi wo men jiu zuo bu chu fen bu xi tong le ? zhe li huan ju le geng duo de li zi 。
  yi ju hua , zhi you ren shi zhen zheng de yin tan 。 zhi ye fa zhan de mu biao , jiu shi ba zi ji bian cheng yin tan 。 na shi hou , ni jiu bu zai shi ren , er shi ren tan 。
  zui hou jiu yi wo zai Bjarne de zhong duo fang tan dang zhong zhai lu de yi xie guan yu ru he xue xi C++( yi ji bian cheng ) de kan fa jie shu ba ( mei kong zhu duan fan yi le , zhi jiang qi zhong wo jiao de zui chong yao de ji duan yi le yi xia , dang ran , qi ta ye hen chong yao , zhe xie duan luo shi zai Bjarne de suo you cai fang gao zhong zhai chao chu lai de , suo yi qiang lie jian yi dou guo mu yi xia ):
  I suspect that people think too little about what they want to build, too little about what would make it correct, and too much about "efficiency" and following fashions of programming style. The key questions are always: "what do I want to do?" and "how do I know that I have done if?". Strategies for testing enters into my concerns from well before I write the firat line of code, and that despite my view that you have to write code very early - rather than wait until a design is complete.
  
   yi : wo gan jiao ren men guo duo guan zhu le suo wei “ xiao lv ” yi ji gen sui bian cheng feng ge de chao liu , que yan chong hu shi le ben bu gai bei hu shi de wen ti , ru “ wo jiu jing xiang yao gou jian shen me yang de xi tong ”、“ zen yang cai neng shi ta zheng que ”。 zui yao hai de wen ti yong yuan shi :“ wo jiu jing xiang yao zuo shen me ?” he “ ru he cai neng zhi dao wo de xi tong shi fou yi jing wan cheng le ne ?” jiu na wo lai shuo ba , wo hui zai bian xie di yi xing dai ma zhi qian jiu kao lv ce shi fang an , er qie zhe huan shi zai wo guan yu ying dang zao yu she ji wan cheng zhi qian jiu jin xing bian ma de guan dian de qian ti zhi xia 。
  Obviously, C++ is very complex. Obviously, people get lost. However, most peple get lost when they get diverted into becoming language lawyers rather than getting lost when they have a clear idea of what they want to eXPress and simply look at C++ language features to see how to express it. Once you know data absreaction, class hierarchies (object-oriented programming), and parameterization with types (generic programming) in a fairly general way, the C++ language features fall in place.
  yi : cheng ran ,C++ fei chang fu duo 。 cheng ran , ren men mi shi qi zhong le 。 ran er wen ti shi , da duo shu ren bu shi yin wei shou xian dui zi ji xiang yao biao da shen me you le qing chu de shu xi zhi bu guo zai qu C++ yu yan zhong sou xun he shi de yu yan te xing shi mi shi de , xiang fan , da duo shu ren shi zai bu jiao cheng wei yu yan lv shi de lu shang mi shi zai xi jie de cong lin zhong de 。 shi shi shi , zhi xu dui shu ju chou xiang 、 lei ti xi jie gou (OOP) yi ji shen shu hua lei xing (GP) you yi ge xiang dang yi ban ceng mian de le jie ,C++ fen fan de yu yan te xing ye jiu qing chu qi lai le 。
  Well, I don't think I made such a trade-off. I want elegant and efficient code. Sometimes I get it. These dichotomies (between efficiency versus correctness, efficiency versus programmer time, efficiency versus high-level, et cetera.) are bogus.
  I think the real problem is that "we" (that is, we software developers) are in a permanent state of emergency, grASPing at straws to get our work done. We perform many minor miracles through trial and error, excessive use of brute force, and lots and lots of testing, but--so often--it's not enough.
  Software developers have become adept at the difficult art of building reasonably reliable systems out of unreliable parts. The snag is that often we do not know exactly how we did it: a system just "sort of evolved" into something minimally acceptable. Personally, I prefer to know when a system will work, and why it will.
  There are more useful systems developed in languages deemed awful than in languages praised for being beautiful--many more. The purpose of a programming language is to help build good systems, where "good" can be defined in many ways. My brief definition is, correct, maintainable, and adequately fast. Aesthetics matter, but first and foremost a language must be useful; it must allow real-world programmers to express real-world ideas succinctly and affordably.
  I'm sure that for every programmer that dislikes C++, there is one who likes it. However, a friend of mine went to a conference where the keynote speaker asked the audience to indicate by show of hands, one, how many people disliked C++, and two, how many people had written a C++ program. There were twice as many people in the first group than the second. Expressing dislike of something you don't know is usually known as prejudice. Also, complainers are always louder and more certain than proponents--reasonable people acknowledge flaws. I think I know more about the problems with C++ than just about anyone, but I also know how to avoid them and how to use C++'s strengths.
  
   In any case, I don't think it is true that the programming languages are so difficult to learn. For example, every first-year university biology textbook contains more details and deeper theory than even an expert-level programming-language book. Most applications involve standards, operating systems, libraries, and tools that far exceed modern programming languages in complexity. What is difficult is the appreciation of the underlying techniques and their application to real-world problems. Obviously, most current languages have many parts that are unnecessarily complex, but the degree of those complexities compared to some ideal minimum is often exaggerated.
  We need relatively complex language to deal with absolutely complex problems. I note that English is arguably the largest and most complex language in the world (measured in number of Words and idioms), but also one of the most successful.
  C++ provides a nice, extended case study in the evolutionary approach. C compatibility has been far harder to maintain than I or anyone else expected. Part of the reason is that C has kept evolving, partially guided by people who insist that C++ compatibility is neither necessary nor good for C. Another reason-- probably even more important--is that organizations prefer interfaces that are in the C/C++ subset so that they can support both languages with a single effort. This leads to a constant pressure on users not to use the most powerful C++ features and to myths about why they should be used "carefully," "infrequently," or "by experts only." That, combined with backwards-looking teaching of C++, has led to many failures to reap the potential benefits of C++ as a high-level language with powerful abstraction mechanisms.
  The question is how deeply integrated into the application those system dependencies are. I prefer the application to be designed conceptually in isolation from the underlying system, with an explicitly defined interface to "the outer world," and then integrated through a thin layer of interface code.
  Had I had a chance to name the style of programming I like best, it would have been "class-oriented programming", but then I'm not particularly good at finding snappy names. The school of thought that I belong to - rooted in Simula and related design philosophies - emphasizes the role of compile-time checking and flexible (static) type systems. Reasoning about the behavior of a program has to be rooted in the (static) structure of the source code. The focus should be on guarantees, invariant, etc. which are closely tied to that static structure. This is the only way I know to effectively deal with correctness. Testing is essential but cannot be systematic and complete without a good internal program structure - simple-minded blackbox testing of any significant system is infeasible because of the exponential explosion of states.
  
   So, I recommend people to think in terms of class invariants, exception handling guarantees, highly structured resource management, etc. I should add that I intensely dislike debugging (as ah hoc and unsystematic) and strongly prefer reasoning about source code and systematic testing.
  Pros: flexibility, generality, performance, portability, good tool support, available on more platforms than any competitor except C, Access to hardware and system resources, good availability of programmers and designers. Cons: complexity, sub-optimal use caused by poor teaching and myths.【原文】【汉音对照
 
 
 
 
 
 
 
 
 
日版宠物情人插曲《Winding Road》歌词

日版宠物情人2017的插曲,很带节奏感,日语的,女生唱的。 最后听见是在第8集的时候女主手割伤了,然后男主用嘴帮她吸了一下,插曲就出来了。 歌手:Def...

兄弟共妻,我成了他们夜里的美食

老钟家的两个儿子很特别,就是跟其他的人不太一样,魔一般的执着。兄弟俩都到了要结婚的年龄了,不管自家老爹怎么磨破嘴皮子,兄弟俩说不娶就不娶,老父母为兄弟两操碎了心...

如何磨出破洞牛仔裤?牛仔裤怎么剪破洞?

把牛仔裤磨出有线的破洞 1、具体工具就是磨脚石,下面垫一个硬物,然后用磨脚石一直磨一直磨,到把那块磨薄了,用手撕开就好了。出来的洞啊很自然的。需要猫须的话调几...

我就是扫描下图得到了敬业福和爱国福

先来看下敬业福和爱国福 今年春节,支付宝再次推出了“五福红包”活动,表示要“把欠大家的敬业福都还给大家”。 今天该活动正式启动,和去年一样,需要收集“五福”...

冰箱异味产生的原因和臭味去除的方法

有时候我们打开冰箱就会闻到一股异味,冰箱里的这种异味是因为一些物质发出的气味的混合体,闻起来让人恶心。 产生这些异味的主要原因有以下几点。 1、很多人有这种习...

 
 
  javascript shi shi jie shang zui shou wu jie de yu yan , qi shi C++ he chang bu shi 。 fang jian liu chuan de cuo wu de C++ xue xi fang fa yi zhua jiu shi yi da ba 。 wo zi ji zai xue xi C++ de guo cheng zhong ye zou le xu duo wan lu , lang fei le bu shao shi jian 。    wei shen me hui cun zai zhe me duo cuo wu shu xi ? yuan yin zhu yao you san ge , yi shi C++ yu yan de xi jie tai duo 。 er shi yi xie wen ming de C++ shu ji zong zai ( bu guan you yi huan shi wu yi ) an shi yu yan xi jie de chong yao xing he you qu 。 san shi xian dai C++ ku de kai fa zhe xue bi xu yong dao yi xie ji jiao ga la de yu yan xi jie ( dan zhu chong , shi ku she ji , bu shi ri chang bian cheng )。 zhe xie gong tong su zao le C++ she qun de zheng ti xin tai he zhe xue 。    dan shi di yi tiao huan wei bi neng gou cheng qi hou , qi ta yu yan de xi jie ye bu shao ( jin guan bi qi C++ qi lai huan shi xiao wu jian da wu ), jiu na Javascript lai shuo , zuo yong yu gui ze , ming zi cha zhao ,closure,for/in, zhe xie dou shi xi jie , er qie qi zhong huan you wei fan zhi jiao de 。 dan xu duo dong tai yu yan de cheng xu yuan de li nian wo cai da yue shi xue dao na yong dao na ba 。 dan C++ jiu bu yi yang le , xue C++ zhi ren you yi zhong lei si yu bei an shi de qian zai xin tai , jiu shi yi ding yao xian ba yu yan gai xin ji ben shang chi tou le cai neng xia shou xie chu piao liang de cheng xu 。 zhe shou xian jiu cuo le 。 zhe ge yi shi xing cheng de yuan yin zai di er dian ,C++ shu ji 。 shi mian shang de C++ shu ji bu ji qi shu , dan you yi ge gong tong de que dian , jiu shi jiang yu yan xi jie de shu tai duo ——《C++ gotchas》,《Effective C++》,《More Effective C++》, dan wu ke hou fei de shi ,C++ shi zhe yang yi men yu yan : yao na ta man zu xian dai bian cheng li nian de xu qiu , you qi shi C++ ku kai fa de xu qiu , huan bi xu de guan zhu yu yan xi jie , nai zhi yu zai C++ zhong li yong yu yan xi jie yi jing cheng le yi men xue wen 。 bi ru C++ mo ban zai she ji zhi chu gen ben mei you xiang dao mo ban yuan bian cheng zhe hui shi , geng mei xiang dao C++ mo ban xi tong shi tu ling wan bei de , zhe ye jiu dao zhi le 《Modern C++ Design》 he 《C++ Template Metaprogramming》 de jing shi hai su 。    zhe xie ji shu de chu xian wei shen me jing shi hai su , da ge bi fang , jiu hao bi shi yi kuai da jia dou ren wei yi jing shu xi wu bi , zai wu mi mi ke yan de tu di shang , hu ran mou tian you ren wa dao yuan lai di xia huan wen cang zhe zui feng fu de shi you 。 zai zhe zhi qian de C++ sui ran ye you yi xie xi jie , dan ye huan suan qing yi ba wo , na ke shi C++ cheng xu yuan men de happy old times, yin wei C++ de yi qie dou yi lan wu yu ,everything is figured out。 ran er 《Modern C++ Design》 de chu shi gao su ren men ,“ qiao , huan you duo shao xi jie ni men mei you ba wo a 。” yu shi C++ cheng xu yuan men jiu wei de ji qing bei chong ran qi lai , fen bu gu shen de ta ru xi jie de zhao ze zhong 。 you qi shi , mo ban bian cheng jiang C++ de xi jie jin yi bu wa jue dao le ji zhi —— wo men gan ma guan xin she ji lei dui xiang de yin shi zhuan huan de you xian ji gao di ? kan kan boost::is_base_of jiu ke yi zhi dao you duo gui yi le 。    dan zui da de wen ti huan zai yu , dui yu zhe xie xi jie de guan zhu huan zhen you ta he shi de li you : wo men yao kai fa xian dai mo ban ku , yao kai fa active library, jiu bi xu dong yong mo ban bian cheng ji shu , yao dong yong mo ban bian cheng ji shu , jiu bi xu li yong yu yan de ji jiao ga la ,enable_if,type_traits, shen zhi lian zao jiu gu jing wu bo de C hong ye zai luan shi zhong chong sheng , kan kan boost::preprocessor you duo gui yi jiu zhi dao le , lian C hong de tu ling wan bei xing ( yu bian yi qi de ) dou bei wa jue chu lai le 。 wei shen me yao zuo zhe xie ? hao wan ? biao bang ? dou bu shi , kai fa ku de shi ji xu qiu 。 dan zhe ye zheng shi zui da de bei ai le 。 zai boost li mian yin shi ji xu qiu er dong yong yu yan xi jie zui zhong ju ran neng shen qi de wan cheng ren wu de zui hao jiao cai jiu shi boost::foreach, zhe ge xiao she shi dui yu yan xi jie de fa jue da dao le jing tian di qi gui shen de di bu , bu xin ni xian shi zhe zi ji qu kan kan ta de yuan dai ma , zai kan kan zuo zhe jie shao ta de wen zhang ba 。 er boost::typeof ye bu gan qi hou ——C++ yu yan li mian you tai duo bei “ fa xian ” er bu shi bei “ fa ming ” de ji shu 。 nan dao zui chu wu yi she zhi zhe xie yu yan gui ze de jia huo men dou shi Oracles?    yin wei mei you variadic templates, ren men yong hong jia shang que sheng mo ban shen shu lai shi xian lei si xiao guo 。 yin wei mei you concepts, ren men yong mo ban jia shang xi gou han shu de xi jie lai wan cheng lei si gong zuo 。 yin wei mei you typeof, ren men yong mo ban yuan bian cheng he hong jia shang wu jin de xi jie lai shi xian mu biao … C++ kai fa zhe men de DIY jing shen bu ke wei bu qiang 。    ran er , jia ru jin jin shi yin wei yao kai fa you xiu de ku , na me she ji zhe xie xi jie dou huan shi qing you ke yuan de , zhi shao zai C++09 chu xian bing qie bian yi qi chang shang gen shang zhi qian , zhe xie dou huan neng shuo shi bu de yi er wei zhi 。 dan wo men guang da de C++ cheng xu yuan ne ? da zhong shi qing yi bei wu dao de , wo ye zeng jing shi 。 yi wei ba wo le geng duo de yu yan xi jie jiu geng niu , dan shi ji que shi na xie yu yan xi jie shi you ba jiu shi ping shi bian cheng yong dou yong bu dao de 。C++ zhong zhong duo de xi jie sui ran zai ku she ji zhe shou li mian you qi yong wu zhi di , dan pu tong cheng xu yuan ze gen ben wu xu guo duo guan zhu , you qi shi mei you shi ji dong ji de guan zhu 。 yi ban xing de bian ma shi jian zhun ze , yi ji ji ben de bian cheng neng li he ji ben gong , nai zhi ji ben de cheng xu she ji li lun yi ji suan fa she ji 。 cai shi zhen zheng xu yao hua shi jian ba wo de dong xi 。    xue xi zui jia bian ma shi jian bi xue xi C++ geng chong yao 。 kan you xiu de dai ma ye bi mai tou yong cha jing de bian ma fang shi xie la ji dai ma yao you xiao 。 zhi jie 、 qing chu 、 ming le 、KISS di biao da yi tu bi wan bian ma hua zhao yao chong yao …    bi mian qu guo wen ren he yu yan xi jie , chu fei bi yao 。 zhe ge bi yao shi zhi zai shi ji bian cheng dang zhong peng dao wen ti , zhe yang jiu suan xu yao guo wen xi jie , ye shi zui sheng shi de , lan duo zhe yuan ze ma 。 yi ge ba wo le ji ben de bian cheng li nian bing you jiao qiang xue xi neng li de cheng xu yuan zai yong yi men sheng shu de yu yan bian cheng shi jiu suan na zhe na ben yu yan de sheng jing cong suo yin fan qi ye ke yi bian chu he ge de cheng xu lai 。 shi nian xue hui bian cheng bu shi zhi dui mei men yu yan dou de shi nian , na yi bei zi cai neng xue ji men yu yan na , jia ru an zi mu shun xu xue de hua yi bei zi dou bie zhi wang xue dao Ruby le ; shi nian xue xi bian cheng geng bu shi zhi xian ba yu yan te xing cong cu dao xi quan dou chi tou cai gan xia shou bian cheng , zai shi jian zhong ti gao cai shi zui chong yao de 。    zhi yu zhe zhong kou yu yan xi jie de zhe xue wei he neng zai she qun li mian cheng ye huo liao yuan zhi shi , jiu shi yi ge xin li xue de wen ti le 。 xiang xiang ren men zai lun tan shang tao lun wen ti shi , yi ge dui yu yan ba wo hen xi zhi de ren ken ding neng gou de dao geng duo de pei fu , er you yu lun tan shang de wen ti da duo shi xiao wen ti , suo yi jie jue shi ji wen ti de zhen zheng neng li bing bu neng de dao xian xian , ye jiu shi shuo , zhi shi xing de ren neng gou de dao geng duo pei fu , hou zhe bian cheng wei dong li he fang xiao de fa ma 。 ran er zhen zheng de bian cheng neng li shi yu yu yan xi jie mei guan xi de , shu lian yun yong yi men yu yan neng gou bang ni zui jia biao da ni de yi tu , dan shu lian yun yong yi men yu yan jue bu yi wei zhe yao ba ta de bian bian jiao jiao quan dou ji zhu 。 dong de yi xie chang shi , you le bian cheng de ji ben zhi jiao , peng dao yi xie xi jie cuo wu de shi hou zai qu cha shu , shi zui jie sheng shi jian de ban fa 。   C++ de shu ,Bjarne de sheng jing 《The C++ Programming Language》 shi gao wu jian ling de 。《 da gui mo C++ cheng xu she ji 》 shi ting wu shi de 。《Accelerated C++》 shi zui jia ru men de 。《C++ Templates》 shi jin zuo shen kao de 。《C++ Template Metaprogramming》 shi jing li guo sheng zhe ke yi wan yi wan de , pu tong cheng xu yuan peng dou bie peng de 。《ISO.IEC C++ Standard 14882》 bu shi na lai du de 。Bjarne zui jin zai zuo C++ de jiao yu , xin shu shi jue dui ke yi qi dai de 。   P.S. guan yu ru he xue xi bian cheng ,g9 de blog shang you xu duo chu se de wen zhang : zhe li , zhe li , zhe li , zhe li … shi ji shang , wo jian yi ni qu ba g9 lao da de blog fan ge di chao tian :P    zai P.S. shu dan ? wo shi huang yu gei chu yi ge lei si 《C++ chu xue zhe bi du 》 zhe zhong shu dan de 。C++ de shu bu ji qi shu , bei gong ren de hao shu ye bu sheng mei ju 。 zhi bu guo you xie shu qing yi gei chu xue zhe zao cheng yi zhong cuo jiao , jiu shi “ xue xi C++ jiu ying gai shi zhe ge yang zi de ”。 bi ru you peng you ti dao de 《 gao zhi liang C/C++ bian cheng 》, zhe ben shu you jia zhi , dan bu shi he chu xue zhe , chu xue zhe du zhe yang de shu qing yi yi ye zhang mu bu jian tai shan 。 shi ji shang , zheng que de tai du shi , xi jie shi bi yao de 。 dan xi jie shi ci yao de 。 qi shi xue xi bian cheng wo jiao de ying gai zui xian xue xi ru he yong wei ma biao da si xiang ne , jun bu jian 《IntrodUCtion to Algorithm》 li mian de dai ma ?《TAOCP》 zhong de dai ma ? o , dui le ta men shi zi ji jian li de yu yan , dan zhe zhong jin jiao xue mu de de yu yan de mu de jiu shi wei le bi mian rang xie cheng xu de ren yi kai shi jiu wang le xie cheng xu shi wei le wan cheng gong neng , yi wei xie cheng xu jiu shi he yu yan xi jie zuo dou zheng le 。Bjarne shuo cheng xu de zheng que xing zui chong yao ,boost de bian ma biao zhun li mian ye jiang zheng que xing lie zai xing neng qian mian 。    ci wai , yi dan jian li le zheng que de xue xi bian cheng de li nian , qi shi shen me shu ( zhi yao bu shi tai la ji de ) dou you xie yong chu 。 dou dang cheng shen kao shu , yong de shi hou cong mu lu huo suo yin fan , ji ben jiu dui le 。    zai zai P.S. myan lao da he g9 lao da dou gei chu le xu duo chu se de jian jie 。 wo bu de bu zai jia shang yi ge P.S。 ju ti wo jiu bu zhai lu le , jia ru ni du dao zhe li , qing wu bi wang xia kan ta men de ping lun 。 zhuan zai zhe bie wang le zhuan zai ta men de ping lun :-)    xu duo peng you dou wen wo tong yi ge wen ti , dao di yao bu yao xue xi C++。 qi shi zhe ge wen ti wen de hen mei you yi yi 。“ xue C++” he “ bu xue C++” zhe ge er fen fa shi mei yi yi de , wei shen me ? yin wei zhe ge wen ti hen biao mian , shen zhi hen fu zao 。 chong yao de bu shi ni ba wo de yu yan , er shi ni ba wo de neng li , jie yong myan lao da de hua ,“ chong yao de shi zhe ge mo lian guo cheng , er bu shi jie guo , yao de shi ni cu zhuang de tui , er bu shi ni shen shang bei de na dai yan ba 。”。 ci wai xue xi C++ de yi yi qi shi zhen de shi zui weng zhi yi bu zai jiu , xiang C/C++ zhe zhong xi tong ji yu yan , zai xue xi de guo cheng zhong bi xu yao she ji dao yi xie di ceng zhi shi , ru nei cun zhi li 、 bian yi lian jie xi tong 、 hui bian yu yan 、 ying jian ti xi jie gou deng deng deng deng zhi shi ( zhu chong , zhe bu bao kuo guo fen ji jiao ga la de yu yan zhi jie )。 zhe xie dong xi ye jiu shi suo wei de nei gong le ( qi shi zui zui chong yao de nei gong huan shi chang qi xue xi suo mo lian chu lai de zi xue neng li )。 dui ci da zui Joel zai 《Joel On Software》 li mian ti dao de lou dong chou xiang ding lv chan shu de jiu fei chang piao liang 。    suo yi , da an shi , rang ni cheng wei gao shou de bing bu shi ni ba wo shen me yu yan , jing tong C++ wei bi jiu neng rang ni cheng wei gao shou , bu jing tong C++ ye wei bi jiu neng rang ni cheng wei di shou 。 wo xiang da jia dou bu hui fu yi g9 lao da jia ru yao chao qi C++ zuo yi ge xiang mu de hua hui bi da duo shu zi ren shu lian C++ de ren yao zuo de piao liang 。 suo yi yao hai de bu shi yu yan zhe ge biao ceng de dong xi , er shi di xia de ben zhi mao dun 。 dang ran , bu shi shuo na jiu shen me yu yan dou bu yao xue le , an zhao yi zhong cao cao de luo ji ,“ tian xia yu yan , wei imperative yu declarative er ”。C++ shi qian zhe li mian zui fu duo de yi zhong , zhi chi zui guang fan de bian cheng fan shi 。 jie yong dang chu shu xue xi ru xue da hui shang yi ge lao shi de hua ,“ ni shu xue dou xue le , huan you shen me bu neng xue de ne ?”。 xue yu yan shi yi ge tu jing , jia ru ni ba ta yong lai mo lian zi ji , ke yi 。 jia ru ni ba ta yong lai zuo wei xue xi xi tong di ceng zhi shi de yao shi , ke yi 。 jia ru ni ba ta yong lai zuo wei xue xi ru he bian xie you xiu de dai ma , ru he zu zhi da xing de cheng xu , ru he jin xing chou xiang she ji , ke yi 。 jia ru diao shu dai , guang ken xi jie , wo ren wei bu ke yi ( chu fei ni bi xu yao yong dao xi jie , xiang boost ku de coder men )。    ran hou zai jie yong yi xia g9 lao da de 《 yin tan he wo men de zhi ye 》 zhong de hua :    yin tan he wo men de zhi ye fa zhan you shen me xiang gan ? hen jian dan : wo men de ba shi jian yong yu xue xi jie jue ben zhi kun nan 。 xin ji shu gei gao shou dai lai fang bian 。 cai niao men que bu yong zhi wang bei xin ji shu zheng jiu 。 yan yong yi qian de bi yu , yi liu de nie ying shi bu hui yin wei xiang ji de geng xin huan dai er diu diao fan wan , fan er ke neng jie zhu xian jin ji shu liu xia chuan shi jia zuo 。 yin wei nie ying de ben zhi kun nan , huan shi nie ying shi de yi shu gan jiao 。 re men ji shu ye jiu deng yu xiang ji 。 bu ting zhui xin , xue xi zhe ge kuang jia , na ge ruan jian , hao bi cheng tian zuan yan bu tong xiang ji de shuo ming shu 。 er re men ji shu hou de lai long qu mai , cai hao bi nie ying ji shu 。 wei shen me tui chu zhe ge kuang jia ? ta jie jue le shen me qi ta kuang jia bu neng jie jue de wen ti ? ta zai na li shi yong ? ta zai na li bu shi yong ? ta yong le shen me xin de she ji ? ta gai jin le na xie jiu de she ji ?Why is forever. he peng you liao tian shi ti dao Steve McConnell de 《Professional Software Development》 li mian yin le yi ge tiao cha , shuo ruan jian kai fa ji shu de ban shuai qi 20 nian 。 ye jiu shi shuo 20 nian hou wo men xian zai zhi shi li yi ban de dong xi guo shi 。 xiang dang bu huai 。 peng you da qu dao :“ ying gai shuo 20 nian hou IT jie yi ban de ji shu guo shi , wo men xue de guo shi ji shu yuan yuan chao guo zhe ge bi li 。 ju ti dao mou ren , hen ke neng 5 nian ta jiu fei le ”。 hua sui bei guan , dan ke jian xuan ze xue xi nei rong de chong yao xing 。 xue xi ben zhi ji yi ( ji shu chi zao guo shi , ji yi que chang yong chang xin ) huan you yi hao chu , jiu shi bu yong kan zhe zi ji xin ai de ji shu shou dao tiao zhan de shi hou gan hao 。C/C++ guo shi jiu guo shi le bei , zhi yao you qi ta de xi tong bian cheng yu yan 。Java dao le jiu dao le bei , wei bi wo bu neng yong .NET?Ruby tan hua yi xian you ru he 。 jia ru yong de bu shuang , huan dao qi ta dong tai yu yan jiu shi le 。J2EE bei fei le you zen yang ? wei bi wo men jiu zuo bu chu fen bu xi tong le ? zhe li huan ju le geng duo de li zi 。    yi ju hua , zhi you ren shi zhen zheng de yin tan 。 zhi ye fa zhan de mu biao , jiu shi ba zi ji bian cheng yin tan 。 na shi hou , ni jiu bu zai shi ren , er shi ren tan 。    zui hou jiu yi wo zai Bjarne de zhong duo fang tan dang zhong zhai lu de yi xie guan yu ru he xue xi C++( yi ji bian cheng ) de kan fa jie shu ba ( mei kong zhu duan fan yi le , zhi jiang qi zhong wo jiao de zui chong yao de ji duan yi le yi xia , dang ran , qi ta ye hen chong yao , zhe xie duan luo shi zai Bjarne de suo you cai fang gao zhong zhai chao chu lai de , suo yi qiang lie jian yi dou guo mu yi xia ):   I suspect that people think too little about what they want to build, too little about what would make it correct, and too much about "efficiency" and following fashions of programming style. The key questions are always: "what do I want to do?" and "how do I know that I have done if?". Strategies for testing enters into my concerns from well before I write the firat line of code, and that despite my view that you have to write code very early - rather than wait until a design is complete.    yi : wo gan jiao ren men guo duo guan zhu le suo wei “ xiao lv ” yi ji gen sui bian cheng feng ge de chao liu , que yan chong hu shi le ben bu gai bei hu shi de wen ti , ru “ wo jiu jing xiang yao gou jian shen me yang de xi tong ”、“ zen yang cai neng shi ta zheng que ”。 zui yao hai de wen ti yong yuan shi :“ wo jiu jing xiang yao zuo shen me ?” he “ ru he cai neng zhi dao wo de xi tong shi fou yi jing wan cheng le ne ?” jiu na wo lai shuo ba , wo hui zai bian xie di yi xing dai ma zhi qian jiu kao lv ce shi fang an , er qie zhe huan shi zai wo guan yu ying dang zao yu she ji wan cheng zhi qian jiu jin xing bian ma de guan dian de qian ti zhi xia 。   Obviously, C++ is very complex. Obviously, people get lost. However, most peple get lost when they get diverted into becoming language lawyers rather than getting lost when they have a clear idea of what they want to eXPress and simply look at C++ language features to see how to express it. Once you know data absreaction, class hierarchies (object-oriented programming), and parameterization with types (generic programming) in a fairly general way, the C++ language features fall in place.    yi : cheng ran ,C++ fei chang fu duo 。 cheng ran , ren men mi shi qi zhong le 。 ran er wen ti shi , da duo shu ren bu shi yin wei shou xian dui zi ji xiang yao biao da shen me you le qing chu de shu xi zhi bu guo zai qu C++ yu yan zhong sou xun he shi de yu yan te xing shi mi shi de , xiang fan , da duo shu ren shi zai bu jiao cheng wei yu yan lv shi de lu shang mi shi zai xi jie de cong lin zhong de 。 shi shi shi , zhi xu dui shu ju chou xiang 、 lei ti xi jie gou (OOP) yi ji shen shu hua lei xing (GP) you yi ge xiang dang yi ban ceng mian de le jie ,C++ fen fan de yu yan te xing ye jiu qing chu qi lai le 。   Well, I don't think I made such a trade-off. I want elegant and efficient code. Sometimes I get it. These dichotomies (between efficiency versus correctness, efficiency versus programmer time, efficiency versus high-level, et cetera.) are bogus.   I think the real problem is that "we" (that is, we software developers) are in a permanent state of emergency, grASPing at straws to get our work done. We perform many minor miracles through trial and error, excessive use of brute force, and lots and lots of testing, but--so often--it's not enough.   Software developers have become adept at the difficult art of building reasonably reliable systems out of unreliable parts. The snag is that often we do not know exactly how we did it: a system just "sort of evolved" into something minimally acceptable. Personally, I prefer to know when a system will work, and why it will.   There are more useful systems developed in languages deemed awful than in languages praised for being beautiful--many more. The purpose of a programming language is to help build good systems, where "good" can be defined in many ways. My brief definition is, correct, maintainable, and adequately fast. Aesthetics matter, but first and foremost a language must be useful; it must allow real-world programmers to express real-world ideas succinctly and affordably.   I'm sure that for every programmer that dislikes C++, there is one who likes it. However, a friend of mine went to a conference where the keynote speaker asked the audience to indicate by show of hands, one, how many people disliked C++, and two, how many people had written a C++ program. There were twice as many people in the first group than the second. Expressing dislike of something you don't know is usually known as prejudice. Also, complainers are always louder and more certain than proponents--reasonable people acknowledge flaws. I think I know more about the problems with C++ than just about anyone, but I also know how to avoid them and how to use C++'s strengths.   In any case, I don't think it is true that the programming languages are so difficult to learn. For example, every first-year university biology textbook contains more details and deeper theory than even an expert-level programming-language book. Most applications involve standards, operating systems, libraries, and tools that far exceed modern programming languages in complexity. What is difficult is the appreciation of the underlying techniques and their application to real-world problems. Obviously, most current languages have many parts that are unnecessarily complex, but the degree of those complexities compared to some ideal minimum is often exaggerated.   We need relatively complex language to deal with absolutely complex problems. I note that English is arguably the largest and most complex language in the world (measured in number of Words and idioms), but also one of the most successful.   C++ provides a nice, extended case study in the evolutionary approach. C compatibility has been far harder to maintain than I or anyone else expected. Part of the reason is that C has kept evolving, partially guided by people who insist that C++ compatibility is neither necessary nor good for C. Another reason-- probably even more important--is that organizations prefer interfaces that are in the C/C++ subset so that they can support both languages with a single effort. This leads to a constant pressure on users not to use the most powerful C++ features and to myths about why they should be used "carefully," "infrequently," or "by experts only." That, combined with backwards-looking teaching of C++, has led to many failures to reap the potential benefits of C++ as a high-level language with powerful abstraction mechanisms.   The question is how deeply integrated into the application those system dependencies are. I prefer the application to be designed conceptually in isolation from the underlying system, with an explicitly defined interface to "the outer world," and then integrated through a thin layer of interface code.   Had I had a chance to name the style of programming I like best, it would have been "class-oriented programming", but then I'm not particularly good at finding snappy names. The school of thought that I belong to - rooted in Simula and related design philosophies - emphasizes the role of compile-time checking and flexible (static) type systems. Reasoning about the behavior of a program has to be rooted in the (static) structure of the source code. The focus should be on guarantees, invariant, etc. which are closely tied to that static structure. This is the only way I know to effectively deal with correctness. Testing is essential but cannot be systematic and complete without a good internal program structure - simple-minded blackbox testing of any significant system is infeasible because of the exponential explosion of states.   So, I recommend people to think in terms of class invariants, exception handling guarantees, highly structured resource management, etc. I should add that I intensely dislike debugging (as ah hoc and unsystematic) and strongly prefer reasoning about source code and systematic testing.   Pros: flexibility, generality, performance, portability, good tool support, available on more platforms than any competitor except C, Access to hardware and system resources, good availability of programmers and designers. Cons: complexity, sub-optimal use caused by poor teaching and myths.
󰈣󰈤
  免责声明:本文仅代表作者个人观点,与王朝网络无关。王朝网络登载此文出于传递更多信息之目的,并不意味着赞同其观点或证实其描述,其原创性以及文中陈述文字和内容未经本站证实,对本文以及其中全部或者部分内容、文字的真实性、完整性、及时性本站不作任何保证或承诺,请读者仅作参考,并请自行核实相关内容。
 
 
时尚秀气模特裴裴(8)
时尚秀气模特裴裴(7)
时尚秀气模特裴裴(6)
时尚秀气模特裴裴(5)
白墙黑瓦
广州东郊[原创]
八美至丹巴的东谷天然盆景
不一样的
 
>>返回首页<<
 
 
 为你推荐
 
 
 
 转载本文
 UBB代码 HTML代码
复制到剪贴板...
 
 热帖排行
 
 
 
 
 
©2005- 王朝网络 版权所有