仓酷云

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

[学习教程] JAVA教程之JAVA程序员眼里的C#

[复制链接]
山那边是海 该用户已被删除
跳转到指定楼层
楼主
发表于 2015-1-18 11:41:58 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式

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

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

x
在1995年5月23日以“Java”的名称正式发布了。程序|程序员JavadevelopersviewofC#.
September03,2004
Therearetwowaystocompareprogramminglanguages:areligiouswaranda"wejustdontcare"typeofattitude.Iwilltrytofindthemiddlegroundandstartwithgeneralities.ThekeyfeatureofbothJavaandC#isautomatedmemorymanagement.Ofcoursethismakesbothlanguagesuselessforwritinganoperatingsystemkernel,butitmakesapplicationdevelopmentsignificantlyeasierbecause

Chancesofamemoryleakareminimized
Wedonthavetowritecodetofreeupmemory
Wecanwritef(g(x))andnotworryaboutfreeingupmemoryusedbythereturnvalueofg(x).
So,wehavetwopopularsoftwaredevelopmentplatforms.Eachofthetwoisusedbymillionsofsoftwaredevelopersandisbackedbyaworldfamoussoftwaregiant,butneitheronecarriesanyrevolutionaryadvantages.



InfluenceofMicrosoft
HistoricallyJavacameaboutearlierthan.NETandslowlycapturednotonlytheserver-sidesoftwaremarket,butalsothemarketofcorporateclientorientedGUIapplications.ThereasonswerethatC++istoocomplexformakingforms,VisualBasicdoesntfeellikeacooldeveloperslanguage,andBorlandinvestedmoreintoJavathanintoDelphi.

However,themoreJavaapplicationsthereare,thesmallerthedemandforWindows.SoMicrosoftdecidednottosupportJava,andtocreate.NETinordertostimulatethedevelopmentofsoftwaredesignedtorunonWindows.Ofcourse.NEThassomecross-platformcompatibility,butfromthepointofviewofWindows,.NETistryingtobecomeapartoftheoperatingsystemlikeInternetExplorer.Thecareerofa.NETdevelopersupposesaclosepartnershipwithMicrosoftincludingtheuseoftheVisualStudioDevelopmentEnvironment,MSSQLdatabase,andtheversioningcontrolsystemVisualSourceSafe.

MicrosoftmarketingdeservesalotofcreditforthefactthatmanysoftwaredevelopmentcompaniestendtothinkaboutsoftwareentirelywithintheMicrosoftframework.Becauseofthat,sometimeswehavetoputasidebelovedJava,andmakeuseofC#.Thegoodnewsis,theexperiencegainedwhileworkingwithJavaishelpfulwith.NET,anddevelopmentof.NETismotivatingprogressofJava.



CVSvs.VSS
ThemajorityofJavadevelopershavegottenusedtoCVS,afterwhichamovetoVisualSourceSafecombinedwithitsintegrationintoVisualStudioandthesolutions-projectsconceptisperceivedasquitepainful.TobefairwemustnotethattheuseofCVSinalargeprojectistheoreticallypossible,buttriggersanegativereactionofpeople,usedtoworkingwithVSS.

HereIcouldthrowsomepunchesonthesubjectof"whyisCVSbetterthanVSS",butIwillnotdothatbecauseCVSisntperfecteither.Thenthereisaprojectcalled"Subversion"whichisopenlypositionedasthereplacementforCVS.NeitherdoesMicrosoftconsiderVSSasitsflagshipproduct,andisworkingonareplacementforitintheformoftheVisualStudio2005TeamSystem.



TheinfluenceofVB.NET
ManylanguagescanbecompiledintobytecodeforJVM,butpracticallyallthesoftwarefortheJavaplatformiswritteninJavaitself.Aprojectfor.NETcanequallylikelybewrittenineitherC#orVB.NET,andquiteoftenbothlanguagesareused.

ClearlyC#andVB.NEThaveveryfewdifferences,exceptforthesyntax,butcreateadivideinthecommunityofdevelopers.EvenifyouwriteexclusivelyinC#,intheresultsofasupportdocumentationsearchyouwillalwaysfindmaterialrelatedtoVB.NET.InadesktopversionofMSDNonecanfilterthecontentbyprogramminglanguage,yetIstillfindtheJavadocumentationmuchmoreconvenientandhelpful.



GUIdevelopment
GUIdevelopmentinC#isatypicalexampleofRAD,likeDelphi.InJavatheGUIisusuallydonewithSwing.EventhoughSwingisquitelargeandcomplex,thefactthatthearchitectureiswellthoughtoutandscalablecombinedwiththeavailabilityofthesourcecodeallowsfordevelopmentofGUIofanycomplexity.



Webapplicationdevelopment
IhavealotofexperienceinwebapplicationdevelopmentinJava,andneverhaveIworkedwithASP.NET.HoweverIreadilyacceptASP.NEThavingsomeminoradvantageswhenitcomestocreatingsmallscalewebsites.Howevertheseadvantagesseparateweb-applicationsintoadistinctsegmentofsoftware.ManydevelopersspecializeineitherwebdevelopmentorGUIdevelopment.InJavaweb-applicationscaneasilybecreatedwithouttheuseofspecialtechnologieslikeJSP,JSTLorStruts.AllyouhavetosayisextendsHttpServlet.

OfcourseJavawillnoteasilygiveupthemarketofwebdevelopment.WecanexpectmorenewsfromJavaServerFacesandFabrique.Inanycasewebpagedevelopmentisnotamongthemostcomplicatedproblemsforamodernprogramminglanguage.



Iseverythingobject?
InJavathereisapopularslogan"Everythingisobject",inC#thiswouldnotbetrue.ThefirstthingthatstandsoutistheexistenceofstructuresinC#.Obviouslywearemotivatedtousestructurestoincreaseproductivity,butIthinkmoderncomputersareproductiveenoughnottorequiretheadditionofanotherentityinaprogramminglanguage.

AlsoanonymousclassesarereplacedbydelegatesinC#.Thisistheideathatifamethodhasadefinitesetofargumentsandagivenreturntype,itisabsolutelyunimportantwhatitsnameisandwhetherornotitisstatic,oranyothernonsense.Youcanjustcallit.

Whileweareonthesubjectofdelegates,weshouldalsomentionevents.TheyreallydodecreasethecodevolumeinGUIdevelopment.HoweverthiscomesatapriceofgoingagainstOOPprinciples.

InadditionC#hassomeaddedabilities,whicharenotpresentinJava.Withoutgoingintomuchdetail,Iwillmentionoperatoroverloading,andkeywordssuchasvirtual,override,ref,outandparam.



Theinfluenceofthedevelopmentplatformontheprogrammersself-consciousness
Withoutadoubt,theonethingthatinfluencesthequalityofsoftwareisthequalityofsoftwaredevelopers,andnottheprogramminglanguage.Nevertheless,myexperiencetellsmethatinthemajorityofJavaprojectsAntisusedforbuildmanagement.Ontheotherhandin.NET,buildsareoftendonewithtoolsbuiltintoVisualStudio,eventhoughanalogousinstrumentsexistfor.NET.Besides,C#doesnothaveclearrulesfornamingclassesandstoringthemondisk.Thisoftencreatesadditionalconfusion(whichqualifiedprogrammerssuccessfullyovercome).

C#doesnthavecheckedexceptions,thereasonsforwhichareexplainedhere.Thisdecisionhasitsreasons,butifthecompilerdoesntcontrolhandlingcheckedexception,thereneedstobemoreinformationonhowtoworkwitherrorsthroughothercommunicationchannels.Otherwisesomeprogrammerswillnotevenknowwhatexceptionsare.



Thetigersarechargingforward
TherearecertainareaswhereJavaisclearlydominating,forexamplecellularphonegamesandtheJavaCardtechnology.However,thestruggleformarketsharebetweenC#andJavawillgoonforalongtimetocome.Bothplatformswillbeimproved.ForexamplebothJava5and.NET2.0willsupportgenerics.

Itisobviousthatthesuccessofeveryindividualprojectwilldependnotontheprogramminglanguageused,butontheunderstandingofthetask,knowinghowtogiveunderstandablenamestomethods,abilitytoavoidrepetitiouscode,andotheruniversalvirtues.



Acknowledgements
IreallyappreciatethehelpofDmitryJemerov,thankstowhomyoudidnthavetoreadanyofthenonsensewhichIwroteatfirst.IalsothankDataArtcompany,whichgavemeachancetostudyC#onthejob,mycolleaguesatDataArt,whogavemeintellectualhelpandboostedmymoral,andtheJetBrainscompanyforgoodtimingindevelopingtheReSarpertool,whichallowsmetohavealmostasmuchfunwithC#asIamusedtohavingwithIntelliJIDEA.AspecialthankstoAlexeyPchelintsevforeditingtheRussianversionandtoPavelSokolovforthetranslation.



References

TheC#ProgrammingLanguageforJavaDevelopers
http://msdn.microsoft.com/vstudio/java/gettingstarted/csharpforjava/

J2EEfundamentalsfor.NETdevelopers
http://www-106.ibm.com/developerworks/java/library/j-roadmap1/
YakovSirotkin
SeniorDeveloper,DataArt

大型的应用一般不会用这些框架(因为性能考虑);开发人员根据需要选择用一些框架,也可以不选用框架;不用框架并不代表要自己写框架;修改框架的可能性更小。
简单生活 该用户已被删除
沙发
发表于 2015-1-21 12:58:03 | 只看该作者
还好,SUN提供了Javabean可以把你的JSP中的 Java代码封装起来,便于调用也便于重用。
爱飞 该用户已被删除
板凳
发表于 2015-1-30 18:44:29 | 只看该作者
应用在电视机、电话、闹钟、烤面包机等家用电器的控制和通信。由于这些智能化家电的市场需求没有预期的高,Sun公司放弃了该项计划。随着1990年代互联网的发展
第二个灵魂 该用户已被删除
地板
发表于 2015-2-6 08:18:03 | 只看该作者
如果要向java web方向发展也要吧看看《Java web从入门到精通》学完再到《Struts2.0入门到精通》这样你差不多就把代码给学完了。有兴趣可以看一些设计模块和框架的包等等。
谁可相欹 该用户已被删除
5#
发表于 2015-2-6 12:47:26 | 只看该作者
当然你也可以参加一些开源项目,一方面可以提高自己,另一方面也是为中国软件事业做贡献嘛!开发者在互联网上用CVS合作开发,用QQ,MSN,E-mail讨论联系,天南海北的程序员分散在各地却同时开发同一个软件,是不是很有意思呢?
若天明 该用户已被删除
6#
发表于 2015-2-13 22:13:17 | 只看该作者
其实说这种话的人就如当年小日本号称“三个月拿下中国”一样大言不惭。不是Tomjava泼你冷水,你现在只是学到了Java的骨架,却还没有学到Java的精髓。接下来你得研究设计模式了。
深爱那片海 该用户已被删除
7#
发表于 2015-2-16 08:48:10 | 只看该作者
如果要向java web方向发展也要吧看看《Java web从入门到精通》学完再到《Struts2.0入门到精通》这样你差不多就把代码给学完了。有兴趣可以看一些设计模块和框架的包等等。
兰色精灵 该用户已被删除
8#
发表于 2015-3-5 02:20:41 | 只看该作者
当然你也可以参加一些开源项目,一方面可以提高自己,另一方面也是为中国软件事业做贡献嘛!开发者在互联网上用CVS合作开发,用QQ,MSN,E-mail讨论联系,天南海北的程序员分散在各地却同时开发同一个软件,是不是很有意思呢?
透明 该用户已被删除
9#
发表于 2015-3-5 16:27:04 | 只看该作者
还好,SUN提供了Javabean可以把你的JSP中的 Java代码封装起来,便于调用也便于重用。
变相怪杰 该用户已被删除
10#
发表于 2015-3-7 05:48:13 | 只看该作者
Java自面世后就非常流行,发展迅速,对C++语言形成了有力冲击。Java 技术具有卓越的通用性、高效性、平台移植性和安全性,广泛应用于个人PC、数据中心、游戏控制台
只想知道 该用户已被删除
11#
发表于 2015-3-12 23:47:01 | 只看该作者
如果你学过HTML,那么事情要好办的多,如果没有,那你快去补一补HTML基础吧。其实JSP中的Java语法也不多,它更象一个脚本语言,有点象ASP。
活着的死人 该用户已被删除
12#
发表于 2015-3-13 00:08:39 | 只看该作者
那么我书也看了,程序也做了,别人问我的问题我都能解决了,是不是就成为高手了呢?当然没那么简单,这只是万里长征走完了第一步。不信?那你出去接一个项目,你知道怎么下手吗,你知道怎么设计吗,你知道怎么组织人员进行开发吗?你现在脑子里除了一些散乱的代码之外,可能再没有别的东西了吧!
灵魂腐蚀 该用户已被删除
13#
发表于 2015-3-13 23:07:29 | 只看该作者
是一种突破用户端机器环境和CPU
蒙在股里 该用户已被删除
14#
发表于 2015-3-19 23:01:28 | 只看该作者
《JAVA语言程序设计》或《JAVA从入门到精通》这两本书开始学,等你编程有感觉的时候也可以回看一下。《JAVA读书笔记》这本书,因为讲的代码很多,也很容易看懂,涉及到面也到位。是你学习技术巩固的好书,学完后就看看《JAVA编程思想》这本书,找找一个自己写的代码跟书上的代码有什么不一样。
飘灵儿 该用户已被删除
15#
发表于 2015-4-1 18:10:13 | 只看该作者
Java 编程语言的风格十分接近C、C++语言。
山那边是海 该用户已被删除
16#
 楼主| 发表于 2015-4-5 01:41:55 | 只看该作者
关于设计模式的资料,还是向大家推荐banq的网站 [url]http://www.jdon.com/[/url],他把GOF的23种模式以通俗易懂的方式诠释出来,纯Java描述,真是经典中的经典。
再见西城 该用户已被删除
17#
发表于 2015-4-8 04:37:42 | 只看该作者
你现在最缺的是实际的工作经验,而不是书本上那些凭空想出来的程序。
莫相离 该用户已被删除
18#
发表于 2015-4-10 07:34:41 | 只看该作者
应用在电视机、电话、闹钟、烤面包机等家用电器的控制和通信。由于这些智能化家电的市场需求没有预期的高,Sun公司放弃了该项计划。随着1990年代互联网的发展
19#
发表于 2015-4-11 01:13:22 | 只看该作者
一直感觉JAVA很大,很杂,找不到学习方向,前两天在网上找到了这篇文章,感觉不错,给没有方向的我指了一个方向,先不管对不对,做下来再说。
冷月葬花魂 该用户已被删除
20#
发表于 2015-4-14 16:46:02 | 只看该作者
有时间再研究一下MVC结构(把Model-View-Control分离开的设计思想)
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

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

GMT+8, 2024-9-21 05:42

Powered by Discuz! X3.2

© 2001-2013 Comsenz Inc.

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