快速掌握一个语言最常用的50%
现在的开发工作要求我们能够快速掌握一门语言。
一般来说应对这种挑战有两种态度:其一,粗粗看看语法,就撸起袖子开干,边查Google边学习;其二是花很多时间完整地把整个语言学习一遍,做到胸有成竹,然后再开始做实际工作。
然而这两种方法都有弊病。
第二种方法的问题当然很明显,不仅浪费了时间,偏离了目标,而且学习效率不高。因为没有实际问题驱动的语言学习通常是不牢固不深入的。有的人学着学着成了语言专家,反而忘了自己原本是要解决问题来的。
第一种路子也有问题,在对于这种语言的脾气秉性还没有了解的情况下大刀阔斧地拼凑代码,写出来的东西肯定不入流。
说穿新鞋走老路,新瓶装旧酒,那都是小问题,真正严重的是这样的程序员可以在短时间内堆积大量充满缺陷的垃圾代码。由于通常开发阶段的测试完备程度有限,这些垃圾代码往往能通过这个阶段,从而潜伏下来,在后期成为整个项目的毒瘤,反反复复让后来的维护者陷入西西弗斯困境。
实际上语言学习有一定规律可循,对于已经掌握一门语言的开发者来说,对于一般的语言,完全可以以最快的速度,在几天至一周之内掌握其最常用的50%,而且保证路子基本正宗,没有出偏的弊病。
其实真正写程序不怕完全不会,最怕一知半解的去攒解决方案。
因为你完全不会,就自然会去认真查书学习,如果学习能力好的话,写出来的代码质量不会差。而一知半解,自己动手土法炼钢,那搞出来的基本上都是废铜烂铁。比如错误处理和序列化,很多人不去了解“正路子”,而是凭借自己的一知半解去攒野路子,这是最危险的。因此,即使时间再紧张,这些内容也是必须首先完整了解一遍的。掌握这些内容之后进入实际开发,即使有问题,也基本不会伤及项目大体。而开发者本人则可以安步当车,慢慢在实践中提高自己。
以下列出一个学习提纲,主要针对的是有经验的人,初学者不合适。
这个提纲只能用于一般的庸俗编程语言学习,目前在流行编程语言排行榜上排前20的基本上都是庸俗语言。
如果你要学的是LISP之类非庸俗语言,或是某个软件中的二次开发语言,这里的建议未必合适。
还是那句话,仅供参考。
- 首先了解该语言的基本数据类型,基本语法和主要语言构造,主要数学运算符和print函数的使用,达到能够写谭浩强程序设计书课后数学习题的程度;
- 其次掌握数组和其他集合类的使用,有基础的话可以理解一下泛型,如果理解不了也问题不大,后面可以补;
- 简单字符串处理。所谓简单,就是Regex和Parser以下的内容,什么查找替换,截断去字串之类的。不过这个阶段有一个难点,就是字符编码问题。如果理解不了,可以先跳过,否则的话最好在这时候把这个问题搞定,免留后患;
- 基本面向对象或者函数式编程的特征,无非是什么继承、多态、Lambda函数之类的,如果有经验的话很快就明白了;
- 异常、错误处理、断言、日志和调试支持,对单元测试的支持。你不一定要用TDD,但是在这个时候应该掌握在这个语言里做TDD的基本技能;
- 程序代码和可执行代码的组织机制,运行时模块加载、符号查找机制,这是初学时的一个难点,因为大部分书都不太注意介绍这个极为重要的内容;
- 基本输入输出和文件处理,输入输出流类的组织,这通常是比较繁琐的一部分,可以提纲挈领学一下,搞清楚概念,用到的时候查就是了。到这个阶段可以写大部分控制台应用了;
- 该语言如何进行callback方法调用,如何支持事件驱动编程模型。在现代编程环境下,这个问题是涉及开发思想的一个核心问题,几乎每种语言在这里都会用足功夫,.NET的delegate,Java的anonymous inner class,Java 7的closure,C++OX的 tr1::function/bind,五花八门。如果能彻底理解这个问题,不但程序就不至于写得太走样,而且对该语言的设计思路也能有比较好的认识;
- 如果有必要,可在这时研究regex和XML处理问题,如无必要可跳过;
- 序列化和反序列化,掌握一下缺省的机制就可以了;
- 如果必要,可了解一下线程、并发和异步调用机制,主要是为了读懂别人的代码,如果自己要写这类代码,必须专门花时间严肃认真系统地学习,严禁半桶水上阵;
- 动态编程,反射和元数据编程,数据和程序之间的相互转化机制,运行时编译和执行的机制,有抱负的开发者在这块可以多下些功夫,能够使你对语言的认识高出一个层面;
- 如果有必要,可研究一下该语言对于泛型的支持,不必花太多时间,只要能使用现成的泛型集合和泛型函数就可以了,可在以后闲暇时抽时间系统学习。需要注意的是,泛型技术跟多线程技术一样,用不好就成为万恶之源,必须系统学习,谨慎使用,否则不如不学不用;
- 如果还有时间,最好咨询一下有经验的人,看看这个语言较常用的特色features是什么,如果之前没学过,应当补一下。比如Ruby的block interator, Java的dynamic proxy,C# 3的LINQ和extension method。没时间的话,我认为也可以边做边学,没有大问题。
- 有必要的话,在工作的闲暇时间,可以着重考察两个问题,第一,这个语言有哪些惯用法和模式,第二,这个语言的编译/解释执行机制。 至此语言的基本部分就可以说掌握了,之后是做数据库、网络还是做图形,可以根据具体需求去搞,找相应的成熟框架或库,边做边学,加深理解。对于一个庸俗语言,我自己把上面的内容走一遍大概要花2-3周时间,不能算很快,但也耽误不了太多事情,毕竟不是每个月都学新语言。掌握了以上的内容,就给练武术打好了基本功,虽然不见得有多优秀,但是肯定是根正苗红,将来不必绕大弯子。就算是临时使用的语言,把上面这个提纲精简一下,只看蓝色重体字的部分,大致能在几天到一周内搞定,不算是太耗时,而且写出来的代码不会太不靠谱。 以上提纲未设及内存模型。对于C/C++,这个问题很重要,要放在显著位置来考虑,但对于其他语言,这个问题被透明化了,除非你要做hardcore项目,否则不必太关注。
版权声明:除特别注明外,本站所有文章均为王晨曦个人站点原创
转载请注明:出处来自王晨曦个人站点 » 如何快速的学习一门语言
Hello There. I found your blog using msn. This is a really well written article. I will make sure to bookmark it and come back to read more of your useful information. Thanks for the post. I'll certainly return.
I am genuinely grateful to the holder of this web site who has shared this great post at at this time.
This paragraph presents clear idea in support of the new users of blogging, that really how to do running a blog.
These are in fact wonderful ideas in concerning blogging. You have touched some fastidious factors here. Any way keep up wrinting.
I got this web site from my friend who shared with me concerning this web site and at the moment this time I am browsing this web page and reading very informative articles at this time.
"May I simply say what a comfort to discover someone that genuinely knows what they're discussing on the net. You actually understand how to bring a problem to light and make it important. More and more people really need to look at this and understand this side of the story. I can't believe you are not more popular since you definitely possess the gift."
I think the admin of this site is truly working hard for his website, as here every information is quality based data.
Hello there! This is kind of off topic but I need some guidance from an established blog. Is it very hard to set up your own blog? I'm not very techincal but I can figure things out pretty fast. I'm thinking about creating my own but I'm not sure where to begin. Do you have any points or suggestions? Appreciate it
I am curious to find out what blog platform you happen to be working with? I'm experiencing some small security issues with my latest site and I'd like to find something more safeguarded. Do you have any suggestions?
WOW just what I was looking for. Came here by searching for %keyword%
I have been exploring for a bit for any high-quality articles or weblog posts in this sort of area . Exploring in Yahoo I eventually stumbled upon this site. Reading this info So i am glad to show that I have an incredibly good uncanny feeling I came upon exactly what I needed. I such a lot indubitably will make certain to do not overlook this site and provides it a look regularly.
Hey there! I understand this is kind of off-topic however I needed to ask. Does operating a well-established blog such as yours take a massive amount work? I'm completely new to blogging but I do write in my journal every day. I'd like to start a blog so I can share my experience and thoughts online. Please let me know if you have any kind of suggestions or tips for brand new aspiring blog owners. Appreciate it!
I am extremely inspired with your writing skills and also with the format for your weblog. Is that this a paid subject matter or did you customize it yourself? Anyway keep up the nice high quality writing, it's rare to see a great weblog like this one nowadays..
What's Taking place i'm new to this, I stumbled upon this I have found It positively helpful and it has helped me out loads. I'm hoping to give a contribution & aid different customers like its helped me. Great job.
For latest information you have to go to see web and on the web I found this website as a best web page for latest updates.
Doctor is an erudite possession that originates from the Latin oath of the same spelling and meaning.[1] The account is at an agentive noun of the Latin verb docere [d??ke?r?] 'to guide'. It has been habituated to as an visionary label in Europe since the 13th century, when the pre-eminent doctorates were awarded at the University of Bologna and the University of Paris. Having happen to established in European universities, this custom spread all the world. Contracted "Dr" or "Dr.", it is employed as a designation with a view a woman who has obtained a doctorate (e.g., PhD). In various parts of the world it is also acclimatized via medical practitioners, regardless of whether they hold a doctoral-level degree.
Purchase Doryx Doxakne Usa Best Website
ou acheter du viagra
Generic Worldwide Zentel Free Shipping Dallas
Instagram takipçi satın alarak fenomen olmak istemezmisiniz? Sizlere en iyi fırsatları sunan bu websitesinden hemen takipçi alarak düşmeyen kaliteli takipçilere sahip olabilirsiniz link : instagram Takipçi Satın Al
http://buytadalafshop.com/ - buying cialis online reviews
My programmer is trying to convince me to move to .net from PHP. I have always disliked the idea because of the expenses. But he's tryiong none the less. I've been using Movable-type on various websites for about a year and am anxious about switching to another platform. I have heard good things about blogengine.net. Is there a way I can transfer all my wordpress posts into it? Any help would be greatly appreciated!
Wow, fantastic blog layout! How long have you been blogging for? you made blogging look easy. The overall look of your website is magnificent, let alone the content!
http://buylasixshop.com/ - Lasix
Cheap Viagra Samples
Hi there, its nice piece of writing on the topic of media print, we all understand media is a fantastic source of information.
An interesting discussion is worth comment. I do think that you need to publish more on this subject, it might not be a taboo matter but generally people don't talk about these issues. To the next! All the best!!
I’m not that much of a online reader to be honest but your sites really nice, keep it up! I'll go ahead and bookmark your site to come back down the road. Cheers
It's not my first time to pay a visit this website, i am browsing this web page dailly and obtain pleasant facts from here everyday.
I am really thankful to the holder of this web page who has shared this enormous paragraph at here.
Great article! That is the kind of info that are supposed to be shared across the net. Disgrace on the search engines for no longer positioning this submit upper! Come on over and talk over with my web site . Thank you =)
Priligy Medicina
It is actually a great and helpful piece of info. I'm happy that you just shared this useful info with us. Please stay us informed like this. Thanks for sharing.
neurontin vs tramadol [url=http://neu-ron-tin.com/#]gabapentin 600 mg coupon [/url] can you overdose on neurontin how to take gabapentin for anxiety
drugs like provigil [url=http://pro-vi-gil.com/#]provigil purchase online [/url] will modafinil keep me awake how do doctors prescribe provigil
cheap ventolin how does ventolin hfa work albuterol when sick
Iron Doors film retelling
토토사이트
CBDfx Best Disposable Vape Pens. Disposition of Oral Cannabidiol-Rich Cannabis Extracts in Children with Epilepsy. Seed Banks FAQ. [url=https://2020cannabis.org/how-long-to-germinate/]how long to germinate[/url]
This really answered my downside, thank you!
levitra for sale in uk viagra sale australia [url=https://edshopmtrs.com/]viagra cheap thailand[/url] where to buy viagra in canada
buy viagra nigeria viagra online australia cheap [url=https://edshopmtrs.com/]cuanto sale el viagra en farmacias[/url] can buy viagra vietnam
ルイヴィトン財布スーパーコピー 45kg Gas Bottle 42868-1
ルイヴィトンコピー財布 Pleated Dresses Gate Valve
Animal Vase Fluted G type Fin Tube with Fin Root Thickness 0.5mm and 0.3mm at tip ルイヴィトン財布コピー
Antioxidant Foods For Skin Sectional Pull Out Sofabed Mechanism イヴィトン財布コピー激安代引き
Blackout Curtain Fabric イヴィトン財布コピー激安代引き Kids Party Favors
イヴィトン財布コピー激安代引き Holiday Inn Express Formula Blue 2.0 Hospitality Bedroom Hotel Furniture Lifting Solar Panels Onto Roof
Cast Iron Sewer Pipe Fittings ヴィトン財布コピー Electronic Eyelet Button Holer Sewing Machine
slot gacor
Vfd Inverter イヴィトン財布コピー激安代引き AI Face Recognition Temperature infrared Thermal Scanner Camera Access Control Machine
2 Wheel Drive Electric Scooter Ring Rod Insulators For TV Tower ルイヴィトン財布コピー
스포츠중계
ルイヴィトン財布コピー Android 10 Uhf Rfid Data Terminal E330D E336D Loader Hydraulic pump solenoid valve coil wire
Mini Ultrasonic Pest Chaser Candy Pouch Packing Machine ルイヴィトン財布スーパーコピー