仓酷云

 找回密码
 立即注册
搜索
热搜: 活动 交友 discuz
查看: 834|回复: 7
打印 上一主题 下一主题

[学习教程] ASP.NET网页编程之编程之道(完整小赵译版)中辑

[复制链接]
灵魂腐蚀 该用户已被删除
跳转到指定楼层
楼主
发表于 2015-1-16 22:50:54 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式

马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。

您需要 登录 才可以下载或查看,没有帐号?立即注册

x
无论谁倒了对双方阵营的粉丝们也是有害无益。4.1

Aprogramshouldbelightandagile,itssubroutinesconnectedlikeastringsofpearls.Thespiritandintentoftheprogramshouldberetainedthroughout.Thereshouldbeneithertoolittlenortoomuch,neitherneedlessloopsnoruselessvariables,neitherlackofstructurenoroverwhelmingrigidity.
一个程序应当是轻灵自在的,它的子历程就象串在一根线上的珍珠。自始至终,方针明白。增之一字节则太长,减之一字节则太短。既没有不用要的轮回也没有无被援用的变量,既不短少布局化也不至于生硬机器。
AprogramshouldfollowtheLawofLeastAstonishment.Whatisthislaw?Itissimplythattheprogramshouldalwaysrespondtotheuserinthewaythatastonisheshimleast.
一个程序应当遵守``最小惊奇准绳,甚么是``最小惊奇准绳?就是说一个程序应当最小水平地引发用户的惊奇。
Aprogram,nomatterhowcomplex,shouldactasasingleunit.Theprogramshouldbedirectedbythelogicwithinratherthanbyoutwardappearances.
不管一个程序不管有何等庞大都应当是一个单一的全体。程序是被它的外部逻辑所指引而不是它的表面体现。
Iftheprogramfailsintheserequirements,itwillbeinastateofdisorderandconfusion.Theonlywaytocorrectthisistorewritetheprogram.
假如一个程序不克不及满意所要的需求,它就会处于凌乱无序的形态中。独一的前途就是重写这个程序。4.2

Anoviceaskedthemaster:"Ihaveaprogramthatsometimesrunsandsometimesaborts.Ihavefollowedtherulesofprogramming,yetIamtotallybaffled.Whatisthereasonforthis?"
一个初学者问大家:“我的一个程序偶然一般偶然不一般。我已完整遵守编程的划定规矩,并且我完整被它弄懵懂了,究竟是甚么缘故原由会招致如许呢?”
Themasterreplied:"YouareconfusedbecauseyoudonotunderstandtheTao.Onlyafoolexpectsrationalbehaviorfromhisfellowhumans.Whydoyouexpectitfromamachinethathumanshaveconstructed?Computerssimulatedeterminism;onlytheTaoisperfect.
大家说:“你狐疑是由于你不懂得道。只要傻瓜才会信任只需遵守他人所说就可以失掉想固然的了局。为何你要从一团体类本人机关的呆板中往失掉想固然的了局呢?盘算机只是决意论的产品;只要道才是独一完善的。
Therulesofprogrammingaretransitory;onlytheTaoiseternal.ThereforeyoumustcontemplatetheTaobeforeyoureceiveenlightenment."
任何编程的划定规矩都只合适于特定的情形,只要道才是永久稳定的。以是在你遭到指引之前要先往思索道。”
"ButhowwillIknowwhenIhavereceivedenlightenment?"askedthenovice.
“可是我怎样晓得我什么时候遭到指引呢?”
"Yourprogramwillthenruncorrectly,"repliedthemaster.
“当你的程序准确运转时”。大家说。4.3

AmasterwasexplainingthenatureoftheTaotooneofhisnovices,"TheTaoisembodiedinallsoftware--regardlessofhowinsignificant,"saidthemaster.
初学者请大家注释“道法天然”。大家说:“道存在于任何软件中--不管是何等没成心义的软件”。
"IstheTaoinahand-heldcalculator?"askedthenovice.
“岂非也存在于手持式的盘算嚣里?”,初学者问。
"Itis,"camethereply.
“是的,”
"IstheTaoinavideogame?"continuedthenovice.
“也在游戏机里?”,初学者又问到。
"Itiseveninavideogame,"saidthemaster.
“是的,乃至也存在于游戏机里”。大家说。
"AndistheTaointheDOSforapersonalcomputer?"
“也存在于团体盘算机的DOS里吗?”
Themastercoughedandshiftedhispositionslightly."Thelessonisoverfortoday,"hesaid.
大家咳嗽了一声,略微动了一下,说,“明天的课就到这里”。4.4

PriceWangsprogrammerwascodingsoftware.Hisfingersdanceduponthekeyboard.Theprogramcompiledwithoutanerrormessage,andtheprogramranlikeagentlewind.
###编程大家编写软件时,手指在键盘上疾速飘动。程序编译时没有一条毛病信息,程序运转起来就象一阵和风吹过。
Excellent!"thePriceexclaimed,"Yourtechniqueisfaultless!"
太出色了!你的技能已无可抉剔了。
"Technique?"saidtheprogrammer,turningfromhisterminal,"WhatIfollowistheTao--beyondalltechnique.WhenIfirstbegantoprogramIwouldseebeforemethewholeprograminonemass.AfterthreeyearsInolongersawthismass.Instead,Iusedsubroutines.ButnowIseenothing.Mywholebeingexistsinaformlessvoid.Mysensesareidle.Myspirit,freetoworkwithoutaplan,followsitsowninstinct.Inshort,myprogramwritesitself.True,sometimestherearedifficultproblems.Iseethemcoming,Islowdown,Iwatchsilently.ThenIchangeasinglelineofcodeandthedifficultiesvanishlikepuffsofidlesmoke.Ithencompiletheprogram.Isitstillandletthejoyoftheworkfillmybeing.Iclosemyeyesforamomentandthenlogoff."
“技能?”,大家转过身说,“我所遵守的是道--它超乎一切的技能。当我入手下手编程时我看到的是全部一年夜块的程序,三年后我看到的是子历程。如今我甚么也看不到了。我的全部存在是没有任何情势的虚无。我感到很安闲,总之,现实上是我的程序本人在写,偶然我看到一些成绩,我看到它们,就停上去悄悄地察看它们,然后我改动了一行代码,困难就象一阵轻烟一样子虚乌有。然后我编译程序。坐在那边享用事情的高兴。闭了一会眼睛然前进出体系。
PriceWangsaid,"Wouldthatallofmyprogrammerswereaswise!"
“甚么时分我的程序员才干都到达如许的地步!”
Mainteance
BookFive



Thusspakethemasterprogrammer:
编程大家如是说:
"Thoughaprogrambebutthreelineslong,somedayitwillhavetobemaintained."
“既使一个程序只要三行长,也总有一天必要往保护它”
5.1
Awell-useddoorneedsnooilonitshinges.
Aswift-flowingsteamdoesnogrowstagnant.
Neithersoundnorthoughtscantravelthroughavacuum.
Softwarerotsifnotused.

常常利用的门不必要往门轴里上油。
活动的器材就不会故步自封。
流水不腐,户枢不蠹。--王磊
声响和头脑都不克不及在真空里传布。
软件不必就会腐败。

Thesearegreatmysteries.
5.2

Amanageraskedaprogrammerhowlongitwouldtakehimtofinishtheprogramonwhichhewasworking."Iwillbefinishedtomorrow,"theprogrammerpromptlyreplied.
司理问程序员要多长工夫才干完成他的项目。“今天”
"Ithinkyouarebeingunrealistic,"saidthemanager."Truthfully,howlongwillittake?"
“太天南地北了,厚道说,要多久?”
Theprogrammerthoughtforamoment."IhavesomefeaturesthatIwishtoadd.Thiswilltakeatleasttwoweeks,"hefinallysaid.
程序员想了一想说。“另有一些新的功效要加出来,大概最少要两个礼拜吧。”
"Eventhatistoomuchtoexpect,"insistedthemanager,"Iwillbesatisfiedifyousimplytellmewhentheprogramiscomplete."
“即便两个礼拜生怕也太夸大了,甚么时分你只需告知我说程序已完成绩好了。”
Theprogrammeragreedtothis.
Severalyearsslated,themanagerretired.Onthewaytohisretirementlunch,hediscoveredtheprogrammerasleepathisterminal.Hehadbeenprogrammingallnight.
几年后,这个司理已退休了,在他的去职午饭上,他发明这些程序员在他的终端前睡着了,他整夜都在编程。5.3

Anoviceprogrammerwasonceassignedtocodeasimplefinancialpackage.
一个初学者被请求编写一个财政软件。

Thenoviceworkedfuriouslyformanydays,butwhenhismasterreviewedhisprogram,hediscoveredthatitcontainedascreeneditor,asetofgeneralizedgraphicsroutines,andartificialintelligenceinterface,butnottheslightestmentionofanythingfinancial.
他猖狂地事情了良多天,但他的主管检视他的程序时发明,它写了一个编纂嚣,一个图形程序集,和野生智能的界面,可是看不就任何跟财政有关的器材。
Whenthemasteraskedaboutthis,thenovicebecameindignant."Dontbesoimpatient,"hesaid,"Illputthefinancialstuffineventually."
主管请求注释时,程序员被激愤了:“你太没耐烦了,我会在最初写财政的部分。”5.4
Doesagoodfarmerneglectacrophehasplanted?
Doesagoodteacheroverlookeventhemosthumblestudent?
Doesagoodfatherallowasinglechildtostarve?
Doesagoodprogrammerrefusetomaintainhiscode?

一个好的农人不会不论他的庄稼。
一个好的先生不会不论哪怕是最差的先生。
一个好的父亲不会让他的任何一个孩子受饿。
一个好的程序员不该回绝保护他的程序。
Management
BookSix



Thusspakethemasterprogrammer:
编程大家如是说:
"Lettheprogrammerbemanyandthemanagersfew--thenallwillbeproductive."
“增添程序员,削减司理--如许他们都可进步效力。”
6.1

Whenmanagersholdendlessmeetings,theprogrammerswritegames.Whenaccountantstalkofquarterlyprofits,thedevelopmentbudgetisabouttobecut.Whenseniorscientiststalkbluesky,thecloudsareabouttorollin.
司理们忙于无休无止的集会时,程序员们在写游戏。财政主管在议论季度红利时开辟预算将会被减少。当老迷信家在聊天空的蓝色时,云团簇拥而至。
Truly,thisisnottheTaoofProgramming.
这不是编程之道。
Whenmanagersmakecommitments,gameprogramsareignored.Whenaccountantsmakelong-rangeplans,harmonyandorderareabouttoberestored.Whenseniorscientistsaddresstheproblemsathand,theproblemswillsoonbesolved.
司理分派义务时不会包含游戏,管帐师做临时企图时,应当做到八面玲珑,大快人心。迷信家提出一个成绩,就会很快失掉办理。
Truly,thisistheTaoofProgramming.
这才是编程之道。6.2

Whyareprogrammersnon-productive?Becausetheirtimeiswastedinmeetings.
为何程序员没无效率,由于他们把工夫都华侈在闭会上了。
Whyareprogrammersrebellious?Becausethemanagementinterferestoomuch.
为何程序员难于办理?由于办理者的干涉太多了。
Whyaretheprogrammersresigningonebyone?Becausetheyareburntout.
为何程序员一个接一个地告退,由于他们累坏了。
Havingworkedforpoormanagement,theynolongervaluetheirjobs.
在糟的办理下事情,他们享用不到事情的兴趣。6.3

Amanagerwasabouttobefired,butaprogrammerwhoworkedforhiminventedanewprogramthatbecamepopularandsoldwell.Asaresult,themanagerretainedhisjob.
一个司理将被开除,但他部下的一个程序员写了一个盛行的软件而且销路很旺。以是司理保住了他的事情。
Themanagertriedtogivetheprogrammerabonus,buttheprogrammerrefusedit,saying,"IwrotetheprogrambecauseIthoughitwasaninterestingconcept,andthusIexpectnoreward."
司理为程序员分红,但程序员回绝了,他说:“我写程序是由于写程序很风趣,以是我并没想过得资金”。
Themanager,uponhearingthis,remarked,"Thisprogrammer,thoughheholdsapositionofsmallesteem,understandswelltheproperdutyofanemployee.Letspromotehimtotheexaltedpositionofmanagementconsultant!"
这位司理说,“这位程序员,不论他如今是甚么地位,他都能了解一个雇员的职责地点。我们要把他提拔为办理参谋”。
Butwhentoldthis,theprogrammeroncemorerefused,saying,"IexistsothatIcanprogram.IfIwerepromoted,Iwoulddonothingbutwasteeveryonestime.CanIgonow?IhaveaprogramthatImworkingone."
这位程序员又一次回绝了,他说:“我是一个程序员以是我能够编程,假如我被提拔了,除华侈他人的工夫甚么也做不了,如今我能够走了吗?我另有一个程序没写完。”6.4

Amangerwenttohisprogrammersandtoldthem:"Asregardstoyourworkhours:youaregoingtohavetocomeinatnineinthemorningandleaveatfiveintheafternoon."Atthis,allofthembecameangryandseveralresignedonthespot.
司理对程序员说,“你们的事情工夫是早上9点到中午点。”,一切的程序员都很不满。
Sothemanagersaid:"Allright,inthatcaseyoumaysetyourownworkinghours,aslongasyoufinishyourprojectsonschedule."Theprogrammers,nowsatisfied,begantocomeinanoonandworktotheweehoursofthemorning.
司理又说:“好吧,那随你们的便,只需能定时完成义务。”,程序员们这下中意了,他们午时下班,一向事情到清晨。
CorporateWisdom
BookSeven



Thusspakethemasterprogrammer:
编程大家如是说:
"Youcandemonstrateaprogramforacorporateexecutive,butyoucantmakehimcomputerliterate."
###
“你能够向一名公司主管演示一套程序,但你不克不及让他的电脑变得象人一样。”
J2EE比较成熟一点,一些比较出名的企业应用软件都是基于J2EE的。以后的发展就不好说了。不过java比较烦,学.net的话,微软把很多工具都封装好了,学起来可能容易一点。
第二个灵魂 该用户已被删除
沙发
发表于 2015-1-20 05:30:27 | 只看该作者
通过这次激烈的讨论,我从大家身上学到了太多,开阔了眼界,不管是支持我的还是骂我的,都感谢你们。
小女巫 该用户已被删除
板凳
发表于 2015-1-28 18:51:28 | 只看该作者
微软又推出ASP.NET。这不是ASP的简单升级,而是全新一代的动态网页实现系统,用于一台WEB服务器建立强大的应用程序。是微软发展的新体系结构.NET的一部分,是ASP和.NET技术的结合。
只想知道 该用户已被删除
地板
发表于 2015-2-5 22:34:16 | 只看该作者
CGI程序在运行的时候,首先是客户向服务器上的CGI程序发送一个请求,服务器接收到客户的请求后,就会打开一个新的Process(进程)来执行CGI程序,处理客户的请求。CGI程序最后将执行的结果(HTML页面代码)传回给客户。
深爱那片海 该用户已被删除
5#
发表于 2015-2-13 23:43:33 | 只看该作者
目前在微软的.net战略中新推出的ASP.net借鉴了Java技术的优点,使用CSharp(C#)语言作为ASP.net的推荐语言,同时改进了以前ASP的安全性差等缺点。但是,使用ASP/ASP.net仍有一定的局限性,因为从某种角度来说它们只能在微软的WindowsNT/2000/XP+IIS的服务器平台上良好运行(虽然像ChilliSoft提供了在UNIX/Linux上运行ASP的解决方案.
若天明 该用户已被删除
6#
发表于 2015-3-4 03:14:55 | 只看该作者
但是java靠开源打出的一片天地,特别是在微软的垄断下能打开今天的局面还是有它的生命力的。
灵魂腐蚀 该用户已被删除
7#
 楼主| 发表于 2015-3-19 01:29:40 | 只看该作者
现在的ASP.net分为两个版本:1.1和2.0Asp.net1.1用VS2003(visualstudio2003)编程。Asp.net2.0用VS2005(visualstudio2005)编程。现在一般开发用的是VS2003。
爱飞 该用户已被删除
8#
发表于 2015-3-27 01:47:41 | 只看该作者
那么,ASP.Net有哪些改进呢?
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

QQ|Archiver|手机版|仓酷云 鄂ICP备14007578号-2

GMT+8, 2024-5-7 20:15

Powered by Discuz! X3.2

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表