4 ms·
I think it gives people a sense of satisfaction in modeling real world in the relations between classes. The assertion seems to be that if to solve a problem it
by nafey 6y ago
I think it gives people a sense of satisfaction in modeling real world in the relations between classes. The assertion seems to be that if to solve a problem it has to be correctly modelled into the type system of the language. Once the modelling is done correctly solution will arise by itself.
On the other end people who prefer weakly typed languages see problems as primarily that of data transformation. For example from HTML Form to Http Request to SQL Db to CSV File and so on.
Both approaches are differentiated by the perspective on the problem.
- quonn 6y agoBut I rarely use classes in TypeScript. I do think of things as data transformations but the types certainly help a lot.
- protonfish 6y agoPlease don't use weak/strong to denote type systems. Those terms are highly subjective and even non-technical people would quickly form an opinion about which is better. (Strong is good, weak is bad.) Static/dynamic is more accurate and less opinionated terminology.
- albntomat0 6y agoThey are not the same, at least according to the definitions I'm familiar with. Static/dynamic is whether type checking is done at compile time or run type. Strong/weak is how flexible the language is with type conversion. Another explanation: https://en.hexlet.io/courses/intro_to_programming/lessons/types/theory_unit https://en.hexlet.io/courses/intro_to_programming/lessons/ty...
- nafey 6y agoAre these dimensions orthogonal though? For example is there any Strongly typed dynamic language?
- teddyh 6y agoI think Python is mentioned as the usual example.
- elbear 6y agoPython is considered strongly typed, but usually it's placed in opposition with PHP or JavaScript. That's why I don't understand why the previous poster used strongly typed. The conversation was about static and dynamic programming languages.
- rowanG077 6y agoYes. Completely orthogonal. Strongly typed dynamic: Python Weakly typed dynamic: Javascript Strongly typed static: Haskell Weakly typed static: C
- JAlexoid 6y agoStatic vs dynamic is not for type checking, it's about conversion. As in: Static typing - 1 == "1" is false (Python style, integer isn't converted to string for comparison) Dynamic typing - 1 == "1" is true (PHP style, integer or string may be converted)
- albntomat0 6y agoWhere are you getting your definitions from? What you posted is what I understand to be weak vs strong.
- JAlexoid 6y agoBarbara Liskov defines strong typing as a compiler feature that prevents wrong type usage. Liskov, B; Zilles, S (1974). "Programming with abstract data types". http://web.cs.iastate.edu/~hridesh/teaching/362/07/01/papers/p50-liskov.pdf http://web.cs.iastate.edu/~hridesh/teaching/362/07/01/papers...
- deleted 6y ago[deleted]