欢迎来到天天文库
浏览记录
ID:58702594
大小:51.50 KB
页数:12页
时间:2020-10-03
《外文文献和翻译.doc》由会员上传分享,免费在线阅读,更多相关内容在教育资源-天天文库。
1、JavaScriptWhenIwasayoungjourneymanprogrammer,IwouldlearnabouteveryfeatureofthelanguagesIwasusing,andIwouldattempttouseallofthosefeatureswhenIwrote.Isupposeitwasawayofshowingoff,andIsupposeitworkedbecauseIwastheguyyouwenttoifyouwantedtoknowhowtouseaparticularfeat
2、ure.EventuallyIfiguredoutthatsomeofthosefeaturesweremoretroublethantheywereworth.Someofthemwerepoorlyspecified,andsoweremorelikelytocauseportabilityproblems.Someresultedincodethatwasdifficulttoreadormodify.Someinducedmetowriteinamannerthatwastootrickyanderror-pr
3、one.Andsomeofthosefeaturesweredesignerrors.Sometimeslanguagedesignersmakemistakes.Mostprogramminglanguagescontaingoodpartsandbadparts.IdiscoveredthatIcouldbeabetterprogrammerbyusingonlythegoodpartsandavoidingthebadparts.Afterall,howcanyoubuildsomethinggoodoutofb
4、adparts?Itisrarelypossibleforstandardscommitteestoremoveimperfectionsfromalanguagebecausedoingsowouldcausethebreakageofallofthebadprogramsthatdependonthosebadparts.Theyareusuallypowerlesstodoanythingexceptheapmorefeaturesontopoftheexistingpileofimperfections.And
5、thenewfeaturesdonotalwaysinteractharmoniously,thusproducingmorebadparts.Butyouhavethepowertodefineyourownsubset.Youcanwritebetterprogramsbyrelyingexclusivelyonthegoodparts.JavaScriptisalanguagewithmorethanitsshareofbadparts.Itwentfromnon-existencetoglobaladoptio
6、ninanalarminglyshortperiodoftime.Itneverhadanintervalinthelabwhenitcouldbetriedoutandpolished.ItwentstraightintoNetscapeNavigator2justasitwas,anditwasveryrough.WhenJava™appletsfailed,JavaScriptbecamethe"LanguageoftheWeb"bydefault.JavaScript'spopularityisalmostco
7、mpletelyindependentofitsqualitiesasaprogramminglanguage.Fortunately,JavaScripthassomeextraordinarilygoodparts.InJavaScript,thereisabeautiful,elegant,highlyexpressivelanguagethatisburiedunderasteamingpileofgoodintentionsandblunders.ThebestnatureofJavaScriptissoef
8、fectivelyhiddenthatformanyyearstheprevailingopinionofJavaScriptwasthatitwasanunsightly,incompetenttoy.MyintentionhereistoexposethegoodnessinJavaScript,anoutstanding,d
此文档下载收益归作者所有