0 oy
2 kez görüntülendi
önce (120 puan) tarafından

This gets on a lot of people's nerves, and programmers usually turn away from statically typed languages for that reason. As everybody knows, although, it's better to have self- documenting code than code that wants a number of feedback (even when it has them!). Conveniently enough, most languages with attention-grabbing static kind techniques have sort inference, which is immediately analogous to self-documenting code. That was a fairly boring instance, and one which performs proper into a lure: pondering of "type" as meaning the same thing it does in a dynamic sort system. That is the boring view. Though few other languages implement this separation in fairly the identical manner or make it so hard to keep away from, many do encourage it. This is not to say that sort declarations are always bad; but in my expertise, there are few conditions in which I've wished to see them required. There are a number of generally cited benefits for static typing. The information of the compiler in a statically typed language could be utilized in a number of how, and improving performance is one of them.



Rice grain collection Many programmers have used dynamically typed languages very poorly. We've new issues, and performance will not be the place to waste time. This may be annoying if one is writing code that evolves over time or making an attempt out concepts. How can I safely thaw frozen eggs? Documentation is an important side of software program, and static typing may also help. Static sort methods build concepts that assist explain a system and what it does. Specifically, this means including plenty of comments, lengthy variable names, and so forth to obssessively observe the "type" info of variables and capabilities. Clearly, if all of this information is written in feedback, there's a pretty good chance it's going to eventually turn out to be out of date. The thought is that since everyone is aware of statically typed languages make you do everything up entrance, they aren't as good for making an attempt out some code and seeing what it's like. As mentioned within the apart above, the entire unit testing movement basically got here out of dynamically typed languages. An important level here is that static typing does not preclude proving correctness in the traditional way, nor testing the program. Another purpose, though, is testing.



It's one of many least important, though, and one of many least attention-grabbing. I'm going to record them so as from least to most vital. To kill weevils in rice, you need to freeze it for a minimum of four to 7 days. For context, here, six or seven does not rely as "a lot." On top of that, it requires greater than a cursory look to actually see the profit of those two very totally different kinds of programming. When the code is being maintained by three programmers and changing seven times per day, sustaining the correctness proofs falls behind. If I had written code that didn't instantly handle the problem however was referred to as from someplace that dealt with errors three levels up the stack, then lookup would have failed that means as a substitute, and I'd be able to write seven or eight consecutive lookup statements and compute something with the outcomes with out having to examine for Nothing all the time. It is a waste of time. The car is horrible; you cannot get up the mountain trails, and it requires gasoline on top of every little thing else.



Dry Rice grain pile Pascal has comparable goals, and requires that every one variables for a procedure or perform be declared in a single section at the top. What is the operate of filament in rice cooker? Specifically, a whole lot of programmers coming from C typically treat dynamically typed languages in a manner much like what made sense for C previous to ANSI function prototypes. Type declarations are the explanation many individuals related static types with a number of code. What are some beans starting with the letter t? The statement made firstly of this thread was that many programmers have used dynamically typed languages poorly. Many programmers have used very poor statically typed languages. The primary statically typed languages had been explicitly typed by necessity. This is an efficient thing to remember earlier than stating, as if it were obviously true, that statically typed languages require extra code. Documentation is writing for human beings, who are actually pretty good at understanding code anyway.

Bu soruya cevap vermek için lütfen giriş yapınız veya kayıt olunuz.

Hoş geldiniz, Soru Cevapla sizelere sorularınızın diğer kullanıcılarımız tarafından cevaplanması için bir ortam sağlar.

24.9k soru

35 cevap

2 yorum

14.1k kullanıcı

...