荣耀彩票代理

  • 热门专题

Python和Ruby相互比较优缺点暴露无遗

作者:wy  发布日期:2019-01-13 08:33:00
  •   为何Python和Ruby总是放在一起呢?为何Python和Ruby要进行比较呢?Python和Ruby又有那些不同呢?相信大家对这些问题肯定带有很多疑惑,小编为大家因为这些问题找到了答案,希望大家可以认真阅读,在你的学习中生活中工作中明白些什么收获些什么。

    荣耀彩票代理  PythonYOUYURubyDEDIFANG:

      a) PythonKAIFARENYUANDEBEIJINGFENGFUDUOCAI,ZHENYINGGUIMOHENDA,ZHEIZHIJIEDAOZHILEPythonDEGEZHONGlibBIRubyDUOHENDUOHENDUOHENDUO

    荣耀彩票代理  b) HERubyXIANGFAN,PythonDEZHEXUESHI“ZUOYIJIANSHIQINGYOUQIEZHIYOUYIZHONGFANGFA”(There should be one-- and preferably only one --obvious way to do it.)。RubyDEXINTUHUIJUEDEZHEIYANGFEICHANGboring,DANSHIWOJUEDEZHEIYIDIANJIANQINGLERENMENZAIKAIFASHIDERENZHIFUDANHEXUANZECHENGBEN,DUIYUTIGAOKAIFAXIAOLVSHIHENYOUBANGZHUDE。TONGSHI,ZHEIGETEDIANSHIDEBUTONGDERENYONGPythonXIECHULAIDEDAIMABUZHIYUXIANGCHAHENDA,ZHEIDUIYUTUANDUIHEZUOYESHIHENYOUYONGDE。(ZHEIDIANYEDAOZHILEPythonZHONGSHIYOUGONGRENDEBest PracticeDE,DANSHIRubyZHONGJIUHENNANZHAODAOYIGEGONGRENDEBest Practice)

      c) PythonZAIMIANXIANGDUIXIANGSHANGZUODEBINGBUHAO,QISHISHIBAMIANXIANGGUOCHENGHEMIANXIANGDUIXIANGZAROUQILAILE。(SUIZHEPython 3DEFAZHANXIANGXINZHEIDIANHUIYOUSUOGAIGUAN)WOGERENSUIRANGANJUEZHEIYANGBUTAIHAO,DANSHISHIJIYONGDESHIHOUJIUHUIFAXIAN,BUQIANGDIAOMIANXIANGDUIXIANGQISHINENGGOUJIANQINGCHENGXUYUANDERENZHIFUDAN,XIEQIDAIMALAIHUIBIJIAOSUIXINSUOYU,DUIYUcCHENGXUYUANLAISHUOYEGENGRONGYIJIESHOU。(HAOBA,RUGUONIJUEDEZHEIDIANSHIPythonDEQUEDIAN,NEIMEQISHINIYESHIDUIDE~)d) PythonKAISHIMANMANZOUJINDAXUEYINIANJIDEJIAOKESHU,KEYIYUJIAN,WEILAIDEPythonKAIFAZHEZHENYINGHUIJIXUBUDUANZHUANGDA。(DANGRANRubyDEZHENYINGYEHUIYUELAIYUEDA)

      e) PythonJIESHIQI,TEBIESHICPython,MUQIANBIXIANYOUDERubyJIESHIQIKUAIHENDUO。ZHEIDIANRubyDEFAMINGRENMatzYESHIHENXIANGZAIZHONGXINXIEGERubyDEXUNIJI,DANSHIKUYUYAOZUODESHIQINGHENDUO,BUZHIDAOSHENMESHIHOUNENGWANCHENG。RubyDEYUNXINGXIAOLVMUQIANLAIKANSHIZAITAIMANLEXIE。(DANGRANCHENGXUYUNXINGXIAOLVHEDAIMASHIRUHEXIEDEYEYOUHENDAGUANXI,XIANGRANGRubyCHENGXUJINKENENGKUAIDEHUA,CHULEYIBANDECHENGXUYOUHUAFANGFAWAI,HAIYAOZHUYIYAODUOYONGbuilt-inDEDONGXI,YINWEITAMENSHIYONGcXIEDE,YUNXINGKUAI)

      f) PythonDEYUFABIJIAOJIANDAN,RONGYISHANGSHOU。

      SHUOLEZHEIMEDUOPythonYOUYURubyDEDIFANG,XIANZAIZAILAISHUOSHUOWOJUEDE

    Python和Ruby

      RubyYOUYUPythonDEDIFANG:

      a) DIYIGEYINRUWODENAOHAIDEYOUDIANSHI:YOUQU!DANGNIKAISHIMANMANXUEHUISHIYONGRubyHOU,NIJIUHUIJUEDEPythonDEDAIMABIJIAOSIBAN。ZHEISHIYINWEIRubyCONGPerlZHONGJICHENGDEYITIAOZHEXUESHIHEPythonWANQUANXIANGFANDE:“MEIYIJIANSHIQINGZONGSHIYOUDUOZHONGZUOFA”(Having more than one way to do the same thing)。SUOYICHENGXUYUANDECHUANGZAOLIJIUWANQUANBEIJIFACHULAILE。DANGNIKANDAOMOUGEWENTIDEYIZHONGQIANSUOWEIJIANYOUSHIFENYOUYADEJIEJUEFANGANSHI,NIHUIYOUYIZHONGHUNZAZHEQIANGLIEXIYUEDEJINGYADE——XIE(YOUMEIDE)RubyNENGGOUJIFARENDELINGGAN。

      b) MatzZAISHEJIRubyDESHIHOUJIUXIANGFANGSHEFARANGRubyCHENGWEIYIGE“RENXINGHUA”DEYUYAN,LIQIUSHIRubyCHENGXUYUANGANJUEDAOSHIYONGRubySHIYIJIANYUYUEDESHIQING。NINENGCONGMixin、CHENGXUKUAI、YUANBIANCHENG、JIJUBAORONGXINGDEYUFADENGDENGDANGZHONGHUODEYIZHONGXIYUE。

      c) CHUNCUIDEMIANXIANGDUIXIANG,JIQIQIANGDADEYUANBIANCHENGGONGNENG。RubySHICHUNCUIDEMIANXIANGDUIXIANG。CSDNDEFANKAICENGJINGSHUOGUO:“NIXUEXILERubyYIHOU,NIJIUHUIFAXIAN,YUANLAIJava/C++SUOWEIDEMIANXIANGDUIXIANGJIUSHITMDDESHANZHAIBANBENDEMIANXIANGDUIXIANG,YUANLAIMIANXIANGDUIXIANGHAIKEYIZHEIYANGWANA”。RubyDEYUANBIANCHENGNENGLIHAIYOUKUANSONGDEYUFASHIDESHIYONGRubyKEYIHENQINGSONGDEKAIFADSL(Domain Specific Language),ZHEIYIDIANPythonSHIGAOBUDINGDE。

    荣耀彩票代理  d) Ruby on Rails!YAOBUSHIDHHKAIFACHULERoRBUZHIDAOXIANZAIHAIHUIYOUDUOSHAORENZAIYONGRuby。WUYONGZHIYI,RoRSHIKUAISUWebKAIFADESHENQI。WEISHENMERoRNEIMENIU?YOUYIGEHENZHONGYAODEYUANYINJIUSHIRoRJIANGRubyDEYUANBIANCHENGNENGLIFAHUIDAOLEJIZHI,“SHENZHIDAOLEYIZHONGBIANTAIDECHENGDU”(MatzYU,JIAN《SONGBENXINGHONGDECHENGXUSHIJIE》P.S.XIANGYAOLEJIERubySHEJISIXIANGDEHUACISHUYIDINGYAODUYIDU,QIMASHIBUFENZHANGJIE)

      e) RubyXISHOULEHENDUOYUYAN(Lisp、SmalltalkDENGDENG)DETEXING,DUIYUCHENGXUYUANLAISHUOLEJIEYIXIARubyDUIYUKAIKUOSILUSHIHENYOUBANGZHUDE,TANENGBANGZHUNIGENGHAODEKANQINGNIZHIQIANYIZHISHIYONGDEYUYANDEXIANZHIZHICHUZAINA。

    荣耀彩票代理  JINGGUOLEDUIPythonHERubyLIANGZHEDELILUNZHISHIGAIKUOHEJICHUMUBIAOSHEDING,WOMENTONGGUODUIPythonHERubyDEYOUDIANHEQUEDIANTAOLUNRANHOUJIANGLIANGZHEJINXINGBIJIAOFENXI,DECHUBUYIYANGDEJIELUNHEXIANGFA。YUANCIPIANWENZHANGNENGGOUJINIBANGZHUHEJIEJUENIDEWENTI。

延伸阅读:

About IT165 - 广告服务 - 隐私声明 - 版权申明 - 免责条款 - 网站地图 - 网友投稿 - 联系方式
本站内容来自于互联网,仅供用于网络技术学习,学习中请遵循相关法律法规