[Turn] dynamic language static language strongly typed language weakly typed language (reprint please delete the brackets content) -

(Reprinted please delete the brackets content) -

First, the advantages of a static language Where?

 

Quote

 

It is like Java or C # so strongly typed language in quasi-static to implement complex business logic, the development of large-scale commercial systems, as well as those of the life cycle of a long application also has a very strong advantage

 

 

 

This is a common sense exists in people's hearts. I admit that I feel inside myself subconsciously static strongly typed language for the development of complex, large-scale systems. The weakly typed scripting language is not suitable for development too complex and large projects. But participating in this discussion, I suddenly began to doubt this view, the fact that what is not so?

 

First define what criteria:

 

Statically typed language refers to the variable data types when compiled to determine the language, most statically typed language requirements must specify the data type, some have type inference capability of modern languages may be able to partially mitigate this requirement before using variables. 
Dynamic type language is to determine the type of language data at run time. Before using the variable type declaration is not required, the type of a variable is usually the type that value is assigned. 
Strongly typed language once the type of the variable is determined, the language can not be transformed. Actually looks like the so-called transformation are achieved through intermediate variables, the type of the original variable is certainly no change. 
A weakly typed language on the contrary, the type of a variable is determined by its application context. For example, direct language support strings and integers can be directly used to get the + sign. Of course, in support of operator overloading, strongly typed language is also achieved by way of the outside in the form to do this, but this is completely different connotation 
usually say, java / python are considered strongly typed, and VB / perl / C are weakly typed. 

 

Quote

 

Point one: statically typed language because the type of compulsory declaration, the IDE can do a very good perception of the code, because there is support IDE, so the development of large systems, complex systems more secure.

 

 

 

For it is like Java, IDEA / Eclipse does in the above-aware code has been very strong, and this will undoubtedly be able to increase the ability to control large systems complex systems. But in addition to Java IDE has such a strong weapon outside, it seems that another language has never been so strong IDE. The Visual Studio C # GUI development and in terms of Wizard is very strong, but the code on perception and not the slightest bit of difference Eclipse. As simply a Visual C ++ compiler only, Visual ashamed to mention the word. Not to mention so many C / C ++ developers are picked vi Hangchihangchi wrote hundreds of thousands of lines of code it. Especially as Linux Kernel that millions of lines of code, which is written using vi Ah, complicated enough, large enough, long enough life cycle of it.

 

 

 

Quote

 

Second point: Static relatively closed features, making third-party development kits for violation of the code can be reduced to very low. Dynamic languages ​​on the relatively poor performance at this point, I think we have collected from the Internet to download a JS package, and then put experienced conflict in the project code

 

 

 

That is a statically typed language can guarantee namespace divided package in order to avoid naming conflicts, good isolation of the code. But this view is also unconvincing.

 

Statically typed language, C, VB namespace lack of good segmentation, prone to conflict, but did not affect them to do out of the system is not big enough, not complicated.

 

The Visual C ++ development of DLL version conflict is notorious, it seems that C ++ namespace is not a great deal of help to it.

 

And a dynamically typed language Ruby / Python / Perl has a better name space, especially Python and Perl, CPAN above third-party libraries such as tons of tons, I have never heard of any conflict issues.

 

Indeed, like PHP, JavaScript lack of dynamic languages ​​such namespace is prone to problems, but this seems to be because they lack OO mechanisms leading to, not because they lead to a dynamic type, right?

 

When it comes to large-scale systems, complex business logic, Google the company many things are developed in python, it also proves that dynamically typed languages ​​can not do large-scale complex systems. In fact, I think:

 

Dynamically typed language, especially high-level dynamically typed language, but can make people do not need a distraction to consider programming problem, and concentrate on your business logic to realize that the thought process of achieving process, the process of describing the problem with DSL is the process of programming in this regard, like Unix Shell, ruby, SQL, PHP is even worthy of DSL respective areas of language. And obviously statically typed language basically do not meet this requirement.

 

That advantage statically typed language what is it? I think that the efficiency is very high. So place whenever the need to focus on execution performance would have to use a statically typed language. Other aspects seems to be no particular advantage.

 

Some comments:

 

1. Yahoo look at it, it is written in PHP. You may also use JAVA to draw up that kind of performance.

 

2. I feel a thing, dynamic language flexible enough, so although it can make people think more focus on business logic, but also to come close to the direction of artificial intelligence, but it is also more dependent on technology developers themselves skills, beginners, intermediate developers, it is difficult to make good use of it. The statically typed language, and teaching of basic subjects of our computer (c / pascal / basic) continuity is better, so for fresh graduates, better acceptance and learning. So I think it is learning / training / development costs accounted for a major factor. A very appropriate example: javascript regular expressions, although powerful, but it is not easy to understand and learn. Generally only copy / paste to use. So in many cases, still prefer to deal with js standard handwriting.

 

3. I feel similarly there is an important feature of Java such quasi-static strongly typed language. Once the programmer to master the basic rules of grammar and writing specifications, readability will be much stronger to write out of the program because it limit itself more. In a large system, among Team members know each other in writing what is critical, it has also become an important basis for communication.

 

However, Ruby such a language, although it seems more in line with "the problem that is described to solve the problem," but for the same period of logic, which also meets the requirements, but a big difference in wording. I have seen read Ruby solution algorithm used to solve a number of lines written out, who can understand?

 

4. I often see is that Java programmers fart bigger things to write hundreds of lines, Ruby few lines to get

 

5. Statically typed language refers to the variable data types when compiled to determine the language, most statically typed language requirements must specify the data type, some have type inference capability of modern languages may be able to partially mitigate this requirement before using variables. 
Dynamic type language is to determine the type of language data at run time. Before using the variable type declaration is not required, the type of a variable is usually the type that value is assigned. 
Strongly typed language once the type of the variable is determined, the language can not be transformed. Actually looks like the so-called transformation are achieved through intermediate variables, the type of the original variable is certainly no change. 
A weakly typed language on the contrary, the type of a variable is determined by its application context. For example, direct language support strings and integers can be directly used to get the + sign. Of course, in support of operator overloading, strongly typed language is also achieved by way of the outside in the form to do this, but this is completely different connotation 
usually say, java / python are considered strongly typed, and VB / perl / C is weakly typed. 
but compared to the classification of dynamic / static language, the more strongly typed / weak type is a relative concept.

 

6. If a dynamic language, unit testing work on a lot more than static languages

 

robbin back to this one. In fact, you missed the point, when using such a framework similar to the RoR application code size is very small, so the corresponding part to be tested very little, much less than the part of statically typed languages ​​to be tested.

 

In addition, the lack of unit tests did not you say so horrible. We now do not write unit tests, ruby ​​code has more than 6,000 lines of programming or, troubleshooting or, as easily, how can you blow so scary.

 

7. commercial complex systems is that communication difficulties on the organization, a large company, can have a personal internal business processes to thrash pretty good, but also to the people who make it clear to the software process that simply can not be met seeking to do. Such a ruby ​​but has an advantage, you can quickly develop, promote exchanges, to develop models of business people out to look at, with the use of natural exchange them much easier.

 

Now a developer of personnel development efficiency higher than ever before, mainly because of advances in development languages ​​and compilers, this trend will only continue, do not hold the past and hold dogma, java is in continuous improvement, plus a reflection, added assert, added generics, the next version, also added support for the script.

 

8. In fact, statically typed languages, in addition to considerations of performance, the biggest advantage is that we can provide static type safety, the compiler can check every one of your function call is not to write the correct name, is not providing the right kind of parameter. Such a system, with custom types of features, you can make a lot of mistakes (than many people thought it would be and more) can be found and positioned at compile time.

 

9. I was on slashdot discussions on similar topics've seen people complain dynamic languages, that man is engaged in the banking system, there are about 100,000 lines of code python, because the last tiny bugs that can not be maintained constantly and, seemingly to go to the java platform. (If the last two years on slashdot posts and comments regarding ruby and python look at the side, probably still be able to find this keep abreast of) 
this description of man's point of view, his main problem is not unit testing or test unit did not reach statement coverage or more weak condition combination coverage, resulting in the normal flow occurs when certain non-flow through these statements untested cause a syntax error and eventually the whole program will hang. for business systems, this is a very serious matter . Like I said earlier, my own program more than once to die on the logging statement, because initially I did not test such statements by nature. 
As there is no unit tests with code thousands of lines of three to five people in the project it is not apparent. In fact, the workshop-style development can still make a lot of things to come, five years ago, the country is basically no way to develop unit tests, still can Wande Zhuan. 
However, my own experience, although I do not follow TDD, but unit testing is sufficiently detailed, and this test network gave me confidence (especially when you modify the code and large-scale reconstruction) before unimaginable. I estimate that thousands of lines of the program, will be able to taste the benefits of incremental unit tests. 
10. The compiler helps programmers in the end how much the people still have to be specific. Many compiler can check out all belong to typing errors, spelling errors. For robbin, even if no compiler, error checking this is a piece of cake. But for experienced programmers who are not very rich, I am afraid the situation will be greatly different. After all, an important aspect of the experience programmer difference is the difference between Debug capability and experience. To master, carefully read it twice on the program can be found errors, some novice could take twelve hours, I came across this situation many times in the actual project.

 

The following are some examples

 

None Type: compilation of
weak type, static type: C / C ++
weakly typed, dynamic type checking: Perl / PHP
strongly typed, static type checking: Java / C #
strongly typed, dynamic type checking: Python, Scheme
static explicit type: Java / C
static implicit type: Ocaml, Haskell

 




---------------------
Author: liluxiang
Source: CNBLOGS
Original: https: //www.cnblogs.com/liluxiang/p/9502210.html
Disclaimer: This article author original article, reproduced, please attach Bowen link!
Content analysis By: CSDN, CNBLOG blog articles reprinted a key plug

Guess you like

Origin www.cnblogs.com/tangqijian/p/11869325.html