自由學習的風

幽夢影 張潮 少年讀書,如隙中窺月;中年讀書,如庭中望月;老年讀書,如臺上玩月。皆以閱歷之淺深,為所得之淺深耳。

[轉] Top 10 JavaScript traps for a C# developer

2014年6月4日 星期三

文章出處:http://www.codetails.com/2014/05/27/top-10-javascript-traps-for-a-c-developer/

C# 是好東西啊!不過,只能站在窗子上…

Top 10 JavaScript traps for a C# developer

If you are an experienced C# developer, coming into JavaScript world for application development, you will end up making few common mistakes. However some of the mistakes you would make are due to the basic differences between any strongly typed language [C#, Java etc.] and a dynamically typed language [JavaScript, Python etc]. Although dynamic feature was added to C# version 4.0, its initial design was based on static typing.
Note, I am primarily a .Net developer and have experience of developing web applications using JavaScript, and I admit that I made these mistakes when I started learning JavaScript. I spent good amount of time analyzing the root cause of the issues, just to realize that some of the mistakes were really due to my experience in C# language and assumption that JavaScript code would work exactly. I was wrong however. So in this article, I will cover top 10 JavaScript traps for a C# developer so that they don't make the same mistakes which I did.
I assume that you have basic experience with C# language, so that we can focus more on JavaScript language in this article. With that, let's jump into the traps.

1. Equality Operator

Most common trap between the two languages is the equality operator, also known as comparison operator. Unlike C# which has one equality operator [==], JavaScript has two [== and ===].
詳閱原文…


0 意見:

張貼留言